@aphexcms/ui 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,5 +21,6 @@ declare const Root: import("svelte").Component<{
21
21
  children?: import("svelte").Snippet | undefined;
22
22
  } & {
23
23
  _internal_variant?: "context-menu" | "dropdown-menu" | "menubar";
24
+ _internal_should_skip_exit_animation?: () => boolean;
24
25
  }, {}, "open">;
25
26
  export { CheckboxItem, Content, Root as DropdownMenu, CheckboxItem as DropdownMenuCheckboxItem, Content as DropdownMenuContent, Group as DropdownMenuGroup, Item as DropdownMenuItem, Label as DropdownMenuLabel, RadioGroup as DropdownMenuRadioGroup, RadioItem as DropdownMenuRadioItem, Separator as DropdownMenuSeparator, Shortcut as DropdownMenuShortcut, Sub as DropdownMenuSub, SubContent as DropdownMenuSubContent, SubTrigger as DropdownMenuSubTrigger, Trigger as DropdownMenuTrigger, GroupHeading as DropdownMenuGroupHeading, Group, GroupHeading, Item, Label, RadioGroup, RadioItem, Root, Separator, Shortcut, Sub, SubContent, SubTrigger, Trigger };
@@ -0,0 +1,2 @@
1
+ import Root from './slider.svelte';
2
+ export { Root, Root as Slider };
@@ -0,0 +1,4 @@
1
+ import Root from './slider.svelte';
2
+ export { Root,
3
+ //
4
+ Root as Slider };
@@ -0,0 +1,50 @@
1
+ <script lang="ts">
2
+ import { Slider as SliderPrimitive } from 'bits-ui';
3
+ import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ value = $bindable(),
8
+ orientation = 'horizontal',
9
+ class: className,
10
+ ...restProps
11
+ }: WithoutChildrenOrChild<SliderPrimitive.RootProps> = $props();
12
+ </script>
13
+
14
+ <!--
15
+ Discriminated Unions + Destructing (required for bindable) do not
16
+ get along, so we shut typescript up by casting `value` to `never`.
17
+ -->
18
+ <SliderPrimitive.Root
19
+ bind:ref
20
+ bind:value={value as never}
21
+ data-slot="slider"
22
+ {orientation}
23
+ class={cn(
24
+ 'relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col',
25
+ className
26
+ )}
27
+ {...restProps}
28
+ >
29
+ {#snippet children({ thumbItems })}
30
+ <span
31
+ data-slot="slider-track"
32
+ data-orientation={orientation}
33
+ class={cn(
34
+ 'bg-muted bg-muted relative grow overflow-hidden rounded-full data-horizontal:h-1 data-horizontal:w-full data-horizontal:w-full data-vertical:h-full data-vertical:h-full data-vertical:w-1'
35
+ )}
36
+ >
37
+ <SliderPrimitive.Range
38
+ data-slot="slider-range"
39
+ class={cn('bg-primary absolute select-none data-horizontal:h-full data-vertical:w-full')}
40
+ />
41
+ </span>
42
+ {#each thumbItems as thumb (thumb.index)}
43
+ <SliderPrimitive.Thumb
44
+ data-slot="slider-thumb"
45
+ index={thumb.index}
46
+ class="border-ring ring-ring/50 relative block size-3 shrink-0 rounded-full border bg-white transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50"
47
+ />
48
+ {/each}
49
+ {/snippet}
50
+ </SliderPrimitive.Root>
@@ -0,0 +1,5 @@
1
+ import { Slider as SliderPrimitive } from 'bits-ui';
2
+ import { type WithoutChildrenOrChild } from '../../../utils.js';
3
+ declare const Slider: import("svelte").Component<WithoutChildrenOrChild<SliderPrimitive.RootProps>, {}, "ref" | "value">;
4
+ type Slider = ReturnType<typeof Slider>;
5
+ export default Slider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aphexcms/ui",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "Shared UI components for Aphex CMS (shadcn-svelte)",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -125,6 +125,11 @@
125
125
  "svelte": "./dist/components/ui/skeleton/index.js",
126
126
  "default": "./dist/components/ui/skeleton/index.js"
127
127
  },
128
+ "./shadcn/slider": {
129
+ "types": "./dist/components/ui/slider/index.d.ts",
130
+ "svelte": "./dist/components/ui/slider/index.js",
131
+ "default": "./dist/components/ui/slider/index.js"
132
+ },
128
133
  "./shadcn/sonner": {
129
134
  "types": "./dist/components/ui/sonner/index.d.ts",
130
135
  "svelte": "./dist/components/ui/sonner/index.js",
@@ -168,13 +173,13 @@
168
173
  "tailwind-variants": "^3.2.2"
169
174
  },
170
175
  "devDependencies": {
171
- "@internationalized/date": "^3.10.0",
176
+ "@internationalized/date": "^3.12.2",
172
177
  "@lucide/svelte": "^0.561.0",
173
178
  "@sveltejs/kit": "^2.59.1",
174
179
  "@sveltejs/package": "^2.5.6",
175
180
  "@sveltejs/vite-plugin-svelte": "^6.2.1",
176
181
  "@tailwindcss/vite": "^4.1.17",
177
- "bits-ui": "^2.14.4",
182
+ "bits-ui": "^2.18.1",
178
183
  "clsx": "^2.1.1",
179
184
  "mode-watcher": "^1.1.0",
180
185
  "svelte": "^5.55.5",
package/src/app.css CHANGED
@@ -4,6 +4,12 @@
4
4
 
5
5
  @custom-variant dark (&:is(.dark *));
6
6
 
7
+ /* bits-ui sets data-orientation on slider/progress parts; the shadcn components use
8
+ `data-horizontal:`/`data-vertical:` variants to size the track. Declare them so those
9
+ utilities resolve (otherwise the slider track collapses to zero height — invisible). */
10
+ @custom-variant data-horizontal (&[data-orientation='horizontal']);
11
+ @custom-variant data-vertical (&[data-orientation='vertical']);
12
+
7
13
  :root {
8
14
  --background: oklch(0.98 0.01 95.1);
9
15
  --foreground: oklch(0.34 0.03 95.72);
@@ -22,7 +28,8 @@
22
28
  --destructive: oklch(0.58 0.2 27);
23
29
  --border: oklch(0.88 0.01 97.36);
24
30
  --input: oklch(0.76 0.02 98.35);
25
- --ring: oklch(0.59 0.17 253.06);
31
+ /* Brand orange — was an unthemed blue default; dark mode already uses the brand. */
32
+ --ring: var(--primary);
26
33
  --chart-1: oklch(0.56 0.13 43);
27
34
  --chart-2: oklch(0.69 0.16 290.41);
28
35
  --chart-3: oklch(0.88 0.03 93.13);
@@ -1,7 +0,0 @@
1
- import { Tooltip as TooltipPrimitive } from 'bits-ui';
2
- import Trigger from './tooltip-trigger.svelte';
3
- import Content from './tooltip-content.svelte';
4
- declare const Root: import("svelte").Component<TooltipPrimitive.RootProps, {}, "open">;
5
- declare const Provider: import("svelte").Component<TooltipPrimitive.ProviderProps, {}, "">;
6
- declare const Portal: import("svelte").Component<TooltipPrimitive.PortalProps, {}, "">;
7
- export { Root, Trigger, Content, Provider, Portal, Root as Tooltip, Content as TooltipContent, Trigger as TooltipTrigger, Provider as TooltipProvider, Portal as TooltipPortal };