Skip to content

Commit

Permalink
Hot fix utils path error (#40)
Browse files Browse the repository at this point in the history
* fix

* fix paths

* ...

* resolve issues?

* format

---------

Co-authored-by: Claire Olmstead <olmsteadclaire@gmail.com>
  • Loading branch information
claireolmstead and claireolmstead authored Oct 28, 2024
1 parent 6d6dfd7 commit 748c408
Show file tree
Hide file tree
Showing 14 changed files with 138 additions and 135 deletions.
25 changes: 14 additions & 11 deletions scripts/package.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,27 @@ rootPackage['scripts'] = {};
rootPackage.main = 'index.js';
rootPackage.module = 'index.js';
rootPackage.exports = {
'.': {
types: './index.d.ts',
svelte: './index.js',
default: './index.js',
},
'./tailwind.config': './tailwind.config.js',
'./tailwindColors': './styles/tailwindColors.js',
"./styles": "./styles/index.css"
'.': {
types: './index.d.ts',
svelte: './index.js',
default: './index.js',
},
'./tailwind.config': './tailwind.config.js',
'./tailwindColors': './styles/tailwindColors.js',
'./styles': './styles/index.css',
};

rootPackage.style = {
"./styles": "./styles/index.css"
}
'./styles': './styles/index.css',
};

// Don't keep dev dependencies
delete rootPackage['devDependencies'];
rootPackage.devDependencies = {
'bits-ui': '^0.21.16',
};

// Write it out
fs.writeFileSync(`${path.join(__dirname, '../dist', 'package.json')}`, JSON.stringify(rootPackage, null, 2), (err) => {
if (err) throw new Error(err);
if (err) throw new Error(err);
});
22 changes: 11 additions & 11 deletions src/lib/atoms/IconButton.svelte
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<script lang="ts">
import {cn} from '../utils/utils';
import { cn } from '../utils/utils';
export let label: string = '';
export let href: string = '';
export let isRound = false;
export let label: string = '';
export let href: string = '';
export let isRound = false;
</script>

<a
aria-label={label}
class={cn(
aria-label={label}
class={cn(
`flex h-f32 w-f32 items-center justify-center bg-black p-1 transition-colors duration-[0.3s] hover:bg-brightBlue`,
isRound ? 'rounded-full' : 'rounded',
$$restProps.class
)}
{href}
target="_blank"
{href}
target="_blank"
>
<div class="h-auto w-full text-white">
<slot/>
</div>
<div class="h-auto w-full text-white">
<slot />
</div>
</a>
28 changes: 14 additions & 14 deletions src/lib/atoms/Input.svelte
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<script lang="ts">
import {cn} from '../utils/utils';
import FormElement from './FormElement.svelte';
import { cn } from '../utils/utils';
import FormElement from './FormElement.svelte';
export let label = '';
export let isRequired = false;
export let description = '';
export let value = '';
export let placeholder = 'Enter some text...';
export let error: string | undefined;
export let label = '';
export let isRequired = false;
export let description = '';
export let value = '';
export let placeholder = 'Enter some text...';
export let error: string | undefined;
</script>

<FormElement {label} {isRequired} {description} {value} {placeholder} {error}>
<input
class={cn(
<input
class={cn(
'border-input aria-[invalid]:border-destructive data-[placeholder]:[&>span]:text-muted-foreground sm flex h-10 w-full max-w-[388px] items-center justify-between rounded-md border bg-cream px-3 py-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
error ? 'border-2 border-error' : 'border border-gray3',
$$restProps.class
)}
type="text"
{placeholder}
bind:value
/>
type="text"
{placeholder}
bind:value
/>
</FormElement>
22 changes: 11 additions & 11 deletions src/lib/atoms/Textarea.svelte
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<script lang="ts">
import {cn} from '../utils/utils';
import FormElement from './FormElement.svelte';
import { cn } from '../utils/utils';
import FormElement from './FormElement.svelte';
export let label = '';
export let isRequired = false;
export let description = '';
export let value: string = '';
export let placeholder = 'Enter some text...';
export let error: string | undefined;
export let label = '';
export let isRequired = false;
export let description = '';
export let value: string = '';
export let placeholder = 'Enter some text...';
export let error: string | undefined;
</script>

<FormElement {label} {isRequired} {description} {value} {placeholder} {error}>
<textarea
class={cn(
class={cn(
'border-input aria-[invalid]:border-destructive data-[placeholder]:[&>span]:text-muted-foreground sm flex h-10 w-full max-w-[388px] items-center justify-between rounded-md border bg-cream px-3 py-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
error ? 'border-2 border-error' : 'border border-gray3'
)}
{placeholder}
bind:value
{placeholder}
bind:value
></textarea>
</FormElement>
2 changes: 1 addition & 1 deletion src/lib/features/Card.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { UserFilled } from '/src/lib/assets/index';
import { UserFilled } from '../assets';
export let title = 'Default Card Header';
export let bgColor = 'cream';
Expand Down
34 changes: 17 additions & 17 deletions src/lib/shadcnComponents/ui/accordion/accordion-content.svelte
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<script lang="ts">
import {Accordion as AccordionPrimitive} from 'bits-ui';
import {slide} from 'svelte/transition';
import {cn} from '../../../utils/utils';
import { Accordion as AccordionPrimitive } from 'bits-ui';
import { slide } from 'svelte/transition';
import { cn } from '../../../utils/utils';
type $$Props = AccordionPrimitive.ContentProps;
type $$Props = AccordionPrimitive.ContentProps;
let className: $$Props['class'] = undefined;
export let transition: $$Props['transition'] = slide;
export let transitionConfig: $$Props['transitionConfig'] = {
duration: 200,
};
export {className as class};
let className: $$Props['class'] = undefined;
export let transition: $$Props['transition'] = slide;
export let transitionConfig: $$Props['transitionConfig'] = {
duration: 200,
};
export { className as class };
</script>

<AccordionPrimitive.Content
class={cn('sm overflow-hidden transition-all', className)}
{transition}
{transitionConfig}
{...$$restProps}
class={cn('sm overflow-hidden transition-all', className)}
{transition}
{transitionConfig}
{...$$restProps}
>
<div class="pb-4 pt-0 text-normal">
<slot/>
</div>
<div class="pb-4 pt-0 text-normal">
<slot />
</div>
</AccordionPrimitive.Content>
14 changes: 7 additions & 7 deletions src/lib/shadcnComponents/ui/accordion/accordion-item.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script lang="ts">
import {Accordion as AccordionPrimitive} from 'bits-ui';
import {cn} from '../../../utils/utils';
import { Accordion as AccordionPrimitive } from 'bits-ui';
import { cn } from '../../../utils/utils';
type $$Props = AccordionPrimitive.ItemProps;
type $$Props = AccordionPrimitive.ItemProps;
let className: $$Props['class'] = undefined;
export let value: $$Props['value'];
export {className as class};
let className: $$Props['class'] = undefined;
export let value: $$Props['value'];
export { className as class };
</script>

<AccordionPrimitive.Item {value} class={cn('border-b', className)} {...$$restProps}>
<slot/>
<slot />
</AccordionPrimitive.Item>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { Accordion as AccordionPrimitive } from 'bits-ui';
import { Chevron } from '../../../../lib/assets/index';
import { Chevron } from '../../../../lib/assets';
import { cn } from '../../../utils/utils';
type $$Props = AccordionPrimitive.TriggerProps;
Expand Down
48 changes: 24 additions & 24 deletions src/lib/shadcnComponents/ui/dialog/dialog-content.svelte
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<script lang="ts">
import {Dialog as DialogPrimitive} from 'bits-ui';
import {Exit} from '../../../assets/index';
import * as Dialog from './index.js';
import {cn, flyAndScale} from '../../../utils/utils';
import { Dialog as DialogPrimitive } from 'bits-ui';
import { Exit } from '../../../assets/index';
import * as Dialog from './index.js';
import { cn, flyAndScale } from '../../../utils/utils';
type $$Props = DialogPrimitive.ContentProps;
type $$Props = DialogPrimitive.ContentProps;
let className: $$Props['class'] = undefined;
export let transition: $$Props['transition'] = flyAndScale;
export let transitionConfig: $$Props['transitionConfig'] = {
duration: 200,
};
export {className as class};
let className: $$Props['class'] = undefined;
export let transition: $$Props['transition'] = flyAndScale;
export let transitionConfig: $$Props['transitionConfig'] = {
duration: 200,
};
export { className as class };
</script>

<Dialog.Portal>
<Dialog.Overlay/>
<DialogPrimitive.Content
{transition}
{transitionConfig}
class={cn(
<Dialog.Overlay />
<DialogPrimitive.Content
{transition}
{transitionConfig}
class={cn(
'normal fixed left-[50%] top-[50%] z-50 grid w-full max-w-[500px] translate-x-[-50%] translate-y-[-50%] gap-f24 rounded-lg bg-cream p-f48 shadow-lg md:w-full',
className
)}
{...$$restProps}
>
<slot/>
<DialogPrimitive.Close class="absolute right-f24 top-f24 disabled:pointer-events-none">
<Exit class="h-4 w-4 text-navy"/>
<span class="sr-only">Close</span>
</DialogPrimitive.Close>
</DialogPrimitive.Content>
{...$$restProps}
>
<slot />
<DialogPrimitive.Close class="absolute right-f24 top-f24 disabled:pointer-events-none">
<Exit class="h-4 w-4 text-navy" />
<span class="sr-only">Close</span>
</DialogPrimitive.Close>
</DialogPrimitive.Content>
</Dialog.Portal>
12 changes: 6 additions & 6 deletions src/lib/shadcnComponents/ui/dialog/dialog-description.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script lang="ts">
import {Dialog as DialogPrimitive} from 'bits-ui';
import {cn} from '../../../utils/utils.js';
import { Dialog as DialogPrimitive } from 'bits-ui';
import { cn } from '../../../utils/utils.js';
type $$Props = DialogPrimitive.DescriptionProps;
type $$Props = DialogPrimitive.DescriptionProps;
let className: $$Props['class'] = undefined;
export {className as class};
let className: $$Props['class'] = undefined;
export { className as class };
</script>

<DialogPrimitive.Description class={cn('sm', className)} {...$$restProps}>
<slot/>
<slot />
</DialogPrimitive.Description>
12 changes: 6 additions & 6 deletions src/lib/shadcnComponents/ui/dialog/dialog-footer.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script lang="ts">
import type {HTMLAttributes} from 'svelte/elements';
import {cn} from '../../../utils/utils.js';
import type { HTMLAttributes } from 'svelte/elements';
import { cn } from '../../../utils/utils.js';
type $$Props = HTMLAttributes<HTMLDivElement>;
type $$Props = HTMLAttributes<HTMLDivElement>;
let className: $$Props['class'] = undefined;
export {className as class};
let className: $$Props['class'] = undefined;
export { className as class };
</script>

<div class={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...$$restProps}>
<slot/>
<slot />
</div>
12 changes: 6 additions & 6 deletions src/lib/shadcnComponents/ui/dialog/dialog-header.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script lang="ts">
import type {HTMLAttributes} from 'svelte/elements';
import {cn} from '../../../utils/utils.js';
import type { HTMLAttributes } from 'svelte/elements';
import { cn } from '../../../utils/utils.js';
type $$Props = HTMLAttributes<HTMLDivElement>;
type $$Props = HTMLAttributes<HTMLDivElement>;
let className: $$Props['class'] = undefined;
export {className as class};
let className: $$Props['class'] = undefined;
export { className as class };
</script>

<div class={cn('flex flex-col space-y-f4', className)} {...$$restProps}>
<slot/>
<slot />
</div>
28 changes: 14 additions & 14 deletions src/lib/shadcnComponents/ui/dialog/dialog-overlay.svelte
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<script lang="ts">
import {Dialog as DialogPrimitive} from 'bits-ui';
import {fade} from 'svelte/transition';
import {cn} from '../../../utils/utils.js';
import { Dialog as DialogPrimitive } from 'bits-ui';
import { fade } from 'svelte/transition';
import { cn } from '../../../utils/utils.js';
type $$Props = DialogPrimitive.OverlayProps;
type $$Props = DialogPrimitive.OverlayProps;
let className: $$Props['class'] = undefined;
export let transition: $$Props['transition'] = fade;
export let transitionConfig: $$Props['transitionConfig'] = {
duration: 150,
};
export {className as class};
let className: $$Props['class'] = undefined;
export let transition: $$Props['transition'] = fade;
export let transitionConfig: $$Props['transitionConfig'] = {
duration: 150,
};
export { className as class };
</script>

<DialogPrimitive.Overlay
{transition}
{transitionConfig}
class={cn('fixed inset-0 z-50 bg-shadow/5 backdrop-blur-sm', className)}
{...$$restProps}
{transition}
{transitionConfig}
class={cn('fixed inset-0 z-50 bg-shadow/5 backdrop-blur-sm', className)}
{...$$restProps}
/>
Loading

0 comments on commit 748c408

Please sign in to comment.