@human-kit/svelte-components 1.0.0-alpha.5 → 1.0.0-alpha.7

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.
Files changed (55) hide show
  1. package/dist/button/README.md +48 -0
  2. package/dist/button/TODO.md +13 -0
  3. package/dist/button/index.d.ts +5 -0
  4. package/dist/button/index.js +4 -0
  5. package/dist/button/index.parts.d.ts +1 -0
  6. package/dist/button/index.parts.js +1 -0
  7. package/dist/button/root/README.md +43 -0
  8. package/dist/button/root/button-root.svelte +362 -0
  9. package/dist/button/root/button-root.svelte.d.ts +21 -0
  10. package/dist/button/root/button-test.svelte +76 -0
  11. package/dist/button/root/button-test.svelte.d.ts +11 -0
  12. package/dist/calendar/index.d.ts +3 -3
  13. package/dist/calendar/index.js +3 -3
  14. package/dist/calendar/trigger-next/calendar-trigger-next.svelte +9 -4
  15. package/dist/calendar/trigger-next/calendar-trigger-next.svelte.d.ts +2 -1
  16. package/dist/calendar/trigger-previous/calendar-trigger-previous.svelte +9 -4
  17. package/dist/calendar/trigger-previous/calendar-trigger-previous.svelte.d.ts +2 -1
  18. package/dist/checkbox/index.d.ts +3 -3
  19. package/dist/checkbox/index.js +3 -3
  20. package/dist/clock/index.d.ts +5 -5
  21. package/dist/clock/index.js +5 -5
  22. package/dist/combobox/button/combobox-button.svelte +5 -4
  23. package/dist/combobox/index.d.ts +3 -3
  24. package/dist/combobox/index.js +3 -3
  25. package/dist/combobox/input/combobox-input.svelte +17 -2
  26. package/dist/combobox/list/combobox-listbox.svelte.d.ts +1 -1
  27. package/dist/combobox/popover/combobox-popover.svelte +47 -1
  28. package/dist/combobox/root/combobox.svelte +13 -0
  29. package/dist/combobox/root/context.d.ts +2 -0
  30. package/dist/combobox/tag-remove/combobox-tag-remove.svelte +3 -2
  31. package/dist/datepicker/index.d.ts +3 -3
  32. package/dist/datepicker/index.js +3 -3
  33. package/dist/datepicker/trigger/date-picker-trigger.svelte +5 -5
  34. package/dist/dialog/index.d.ts +3 -3
  35. package/dist/dialog/index.js +2 -2
  36. package/dist/index.d.ts +31 -29
  37. package/dist/index.js +31 -29
  38. package/dist/listbox/index.d.ts +3 -3
  39. package/dist/listbox/index.js +3 -3
  40. package/dist/listbox/item/README.md +2 -1
  41. package/dist/listbox/item/listbox-item.svelte +129 -1
  42. package/dist/listbox/item/listbox-item.svelte.d.ts +2 -0
  43. package/dist/listbox/root/listbox-test.svelte +14 -2
  44. package/dist/listbox/root/listbox-test.svelte.d.ts +1 -0
  45. package/dist/listbox/root/listbox.svelte.d.ts +2 -2
  46. package/dist/popover/index.d.ts +3 -3
  47. package/dist/popover/index.js +3 -3
  48. package/dist/popover/trigger/popover-trigger-button.svelte +4 -3
  49. package/dist/table/index.d.ts +3 -3
  50. package/dist/table/index.js +3 -3
  51. package/dist/table/root/table-root.svelte.d.ts +1 -1
  52. package/dist/timepicker/index.d.ts +5 -5
  53. package/dist/timepicker/index.js +5 -5
  54. package/dist/timepicker/trigger/time-picker-trigger.svelte +5 -5
  55. package/package.json +6 -1
@@ -1,9 +1,14 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
3
  import type { HTMLButtonAttributes } from 'svelte/elements';
4
+ import { ButtonRoot } from '../../button/index.js';
4
5
  import { useCalendarContext } from '../root/context';
5
6
 
6
- type CalendarTriggerPreviousProps = Omit<HTMLButtonAttributes, 'children'> & {
7
+ type CalendarTriggerPreviousProps = Omit<
8
+ HTMLButtonAttributes,
9
+ 'children' | 'class' | 'disabled' | 'aria-disabled'
10
+ > & {
11
+ class?: string;
7
12
  children?: Snippet;
8
13
  };
9
14
 
@@ -22,11 +27,11 @@
22
27
  }
23
28
  </script>
24
29
 
25
- <button
30
+ <ButtonRoot
26
31
  type="button"
27
32
  class={className}
28
33
  aria-label="Previous page"
29
- disabled={isDisabled}
34
+ {isDisabled}
30
35
  onclick={handleClick}
31
36
  {...restProps}
32
37
  >
@@ -35,4 +40,4 @@
35
40
  {:else}
36
41
  Prev
37
42
  {/if}
38
- </button>
43
+ </ButtonRoot>
@@ -1,6 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  import type { HTMLButtonAttributes } from 'svelte/elements';
3
- type CalendarTriggerPreviousProps = Omit<HTMLButtonAttributes, 'children'> & {
3
+ type CalendarTriggerPreviousProps = Omit<HTMLButtonAttributes, 'children' | 'class' | 'disabled' | 'aria-disabled'> & {
4
+ class?: string;
4
5
  children?: Snippet;
5
6
  };
6
7
  declare const CalendarTriggerPrevious: import("svelte").Component<CalendarTriggerPreviousProps, {}, "">;
@@ -1,6 +1,6 @@
1
- export * as Checkbox from './index.parts.ts';
1
+ export * as Checkbox from './index.parts.js';
2
2
  export { default as CheckboxRoot } from './root/checkbox-root.svelte';
3
3
  export { default as CheckboxIndicator } from './indicator/checkbox-indicator.svelte';
4
- export { getCheckboxContext, setCheckboxContext, useCheckboxContext, type CheckboxContext, type CheckboxState } from './root/context.ts';
5
- import * as CheckboxParts from './index.parts.ts';
4
+ export { getCheckboxContext, setCheckboxContext, useCheckboxContext, type CheckboxContext, type CheckboxState } from './root/context.js';
5
+ import * as CheckboxParts from './index.parts.js';
6
6
  export default CheckboxParts;
@@ -1,6 +1,6 @@
1
- export * as Checkbox from './index.parts.ts';
1
+ export * as Checkbox from './index.parts.js';
2
2
  export { default as CheckboxRoot } from './root/checkbox-root.svelte';
3
3
  export { default as CheckboxIndicator } from './indicator/checkbox-indicator.svelte';
4
- export { getCheckboxContext, setCheckboxContext, useCheckboxContext } from './root/context.ts';
5
- import * as CheckboxParts from './index.parts.ts';
4
+ export { getCheckboxContext, setCheckboxContext, useCheckboxContext } from './root/context.js';
5
+ import * as CheckboxParts from './index.parts.js';
6
6
  export default CheckboxParts;
@@ -1,10 +1,10 @@
1
- export * as Clock from './index.parts.ts';
1
+ export * as Clock from './index.parts.js';
2
2
  export { default as ClockRoot } from './root/clock-root.svelte';
3
3
  export { default as ClockAxis } from './axis/clock-axis.svelte';
4
4
  export { default as ClockWheelColumn } from './wheel-column/clock-wheel-column.svelte';
5
5
  export { default as ClockWheelItem } from './wheel-item/clock-wheel-item.svelte';
6
- export { getClockContext, setClockContext, useClockContext, type ClockContext, type ClockEditableSegmentType } from './root/context.ts';
7
- export { type TimePickerGranularity as ClockGranularity, type TimePickerHourCycle as ClockHourCycle, type TimePickerTimeValue as ClockTimeValue } from './root/time-utils';
8
- export { type ClockColumnInfo } from './root/resolve-visible-columns';
9
- import * as ClockParts from './index.parts.ts';
6
+ export { getClockContext, setClockContext, useClockContext, type ClockContext, type ClockEditableSegmentType } from './root/context.js';
7
+ export { type TimePickerGranularity as ClockGranularity, type TimePickerHourCycle as ClockHourCycle, type TimePickerTimeValue as ClockTimeValue } from './root/time-utils.js';
8
+ export { type ClockColumnInfo } from './root/resolve-visible-columns.js';
9
+ import * as ClockParts from './index.parts.js';
10
10
  export default ClockParts;
@@ -1,10 +1,10 @@
1
- export * as Clock from './index.parts.ts';
1
+ export * as Clock from './index.parts.js';
2
2
  export { default as ClockRoot } from './root/clock-root.svelte';
3
3
  export { default as ClockAxis } from './axis/clock-axis.svelte';
4
4
  export { default as ClockWheelColumn } from './wheel-column/clock-wheel-column.svelte';
5
5
  export { default as ClockWheelItem } from './wheel-item/clock-wheel-item.svelte';
6
- export { getClockContext, setClockContext, useClockContext } from './root/context.ts';
7
- export {} from './root/time-utils';
8
- export {} from './root/resolve-visible-columns';
9
- import * as ClockParts from './index.parts.ts';
6
+ export { getClockContext, setClockContext, useClockContext } from './root/context.js';
7
+ export {} from './root/time-utils.js';
8
+ export {} from './root/resolve-visible-columns.js';
9
+ import * as ClockParts from './index.parts.js';
10
10
  export default ClockParts;
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
3
  import type { HTMLButtonAttributes } from 'svelte/elements';
4
+ import { ButtonRoot } from '../../button/index.js';
4
5
  import { useComboBoxContext } from '../root/context';
5
6
 
6
7
  type ComboBoxButtonProps = HTMLButtonAttributes & {
@@ -26,14 +27,14 @@
26
27
 
27
28
  <!-- * CHANGE: CHANGE NAME FROM BUTTON TO TRIGGER -->
28
29
 
29
- <button
30
+ <ButtonRoot
30
31
  type="button"
31
32
  {tabindex}
32
33
  aria-label={ctx.isOpen ? 'Close menu' : 'Open menu'}
33
34
  aria-expanded={ctx.isOpen}
34
35
  aria-controls={`combobox-listbox-${ctx.instanceId}`}
35
- disabled={ctx.isDisabled}
36
- data-pressed={ctx.isOpen}
36
+ isDisabled={ctx.isDisabled}
37
+ pressed={ctx.isOpen}
37
38
  onmousedown={handleMouseDown}
38
39
  class={className}
39
40
  {...restProps}
@@ -56,4 +57,4 @@
56
57
  <path d="m6 9 6 6 6-6" />
57
58
  </svg>
58
59
  {/if}
59
- </button>
60
+ </ButtonRoot>
@@ -1,4 +1,4 @@
1
- export * as ComboBox from './index.parts.ts';
1
+ export * as ComboBox from './index.parts.js';
2
2
  export { default as ComboBoxRoot } from './root/combobox.svelte';
3
3
  export { default as ComboBoxInput } from './input/combobox-input.svelte';
4
4
  export { default as ComboBoxButton } from './button/combobox-button.svelte';
@@ -9,6 +9,6 @@ export { default as ComboBoxItemIndicator } from './item-indicator/combobox-item
9
9
  export { default as ComboBoxTags } from './tags/combobox-tags.svelte';
10
10
  export { default as ComboBoxTag } from './tag/combobox-tag.svelte';
11
11
  export { default as ComboBoxTagRemove } from './tag-remove/combobox-tag-remove.svelte';
12
- export { getComboBoxContext, setComboBoxContext, useComboBoxContext, type ComboBoxContext } from './root/context.ts';
13
- import * as ComboBoxParts from './index.parts.ts';
12
+ export { getComboBoxContext, setComboBoxContext, useComboBoxContext, type ComboBoxContext } from './root/context.js';
13
+ import * as ComboBoxParts from './index.parts.js';
14
14
  export default ComboBoxParts;
@@ -1,5 +1,5 @@
1
1
  // Namespace export for component composition: <ComboBox.Root>, <ComboBox.Input>, etc.
2
- export * as ComboBox from './index.parts.ts';
2
+ export * as ComboBox from './index.parts.js';
3
3
  // Direct named exports for individual imports
4
4
  export { default as ComboBoxRoot } from './root/combobox.svelte';
5
5
  export { default as ComboBoxInput } from './input/combobox-input.svelte';
@@ -12,7 +12,7 @@ export { default as ComboBoxTags } from './tags/combobox-tags.svelte';
12
12
  export { default as ComboBoxTag } from './tag/combobox-tag.svelte';
13
13
  export { default as ComboBoxTagRemove } from './tag-remove/combobox-tag-remove.svelte';
14
14
  // Context and types
15
- export { getComboBoxContext, setComboBoxContext, useComboBoxContext } from './root/context.ts';
15
+ export { getComboBoxContext, setComboBoxContext, useComboBoxContext } from './root/context.js';
16
16
  // Default export as namespace object
17
- import * as ComboBoxParts from './index.parts.ts';
17
+ import * as ComboBoxParts from './index.parts.js';
18
18
  export default ComboBoxParts;
@@ -1,6 +1,10 @@
1
1
  <script lang="ts">
2
2
  import type { HTMLInputAttributes } from 'svelte/elements';
3
3
  import { useComboBoxContext } from '../root/context';
4
+ import {
5
+ shouldShowFocusVisible,
6
+ trackInteractionModality
7
+ } from '../../primitives/input-modality';
4
8
  import { cn } from '../../utils/cn';
5
9
 
6
10
  type ComboBoxInputProps = HTMLInputAttributes & {
@@ -42,6 +46,8 @@
42
46
  }
43
47
 
44
48
  function handleFocus() {
49
+ ctx.setFocusVisible(shouldShowFocusVisible(inputRef));
50
+
45
51
  // Open on focus if trigger is 'focus'
46
52
  // Use a small delay to avoid opening immediately on programmatic focus
47
53
  // (e.g., from a focus trap). This gives time for refs to be set up.
@@ -54,7 +60,9 @@
54
60
  }
55
61
  }
56
62
 
57
- function handleMouseDown() {
63
+ function handleMouseDown(event: MouseEvent) {
64
+ trackInteractionModality(event, inputRef);
65
+ ctx.setFocusVisible(false);
58
66
  ctx.setFocusedTagId(null);
59
67
  // Open on press if trigger is 'press'
60
68
  if (ctx.trigger === 'press' && !ctx.isOpen && !ctx.isDisabled && !ctx.isReadOnly) {
@@ -62,7 +70,14 @@
62
70
  }
63
71
  }
64
72
 
73
+ function handleKeyDown(event: KeyboardEvent) {
74
+ trackInteractionModality(event, inputRef);
75
+ ctx.setFocusVisible(shouldShowFocusVisible(inputRef));
76
+ ctx.handleKeydown(event);
77
+ }
78
+
65
79
  function handleBlur() {
80
+ ctx.setFocusVisible(false);
66
81
  // Restore selection label or deselect if empty
67
82
  ctx.handleInputBlur();
68
83
  }
@@ -89,7 +104,7 @@
89
104
  onfocus={handleFocus}
90
105
  onmousedown={handleMouseDown}
91
106
  onblur={handleBlur}
92
- onkeydown={ctx.handleKeydown}
107
+ onkeydown={handleKeyDown}
93
108
  class={cn(
94
109
  'bg-depth-2 sunken placeholder:text-muted-foreground hover:bg-depth-1 focus:ring-border h-8 w-full rounded-xs border px-2 text-sm shadow-xs transition-all ease-out outline-none focus:ring focus:ring-offset-1 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
95
110
  className
@@ -17,7 +17,7 @@ declare function $$render<T extends object = object>(): {
17
17
  } & {
18
18
  context?: ListBoxContext;
19
19
  element?: HTMLElement;
20
- }, "children" | "id" | "value" | "selectionMode" | "selectionBehavior" | "defaultValue" | "onChange" | "items" | "context" | "element"> & {
20
+ }, "children" | "value" | "id" | "element" | "selectionMode" | "selectionBehavior" | "defaultValue" | "onChange" | "items" | "context"> & {
21
21
  /** Optional items for dynamic rendering - overrides items from ComboBox context */
22
22
  items?: Iterable<T>;
23
23
  /** Content of the listbox. Receives item in dynamic mode. */
@@ -2,6 +2,8 @@
2
2
  import type { Snippet } from 'svelte';
3
3
  import { useComboBoxContext } from '../root/context';
4
4
  import { Popover } from '../../popover';
5
+ import { focusWithModality, type InputModality } from '../../primitives/input-modality';
6
+ import type { PopoverOpenChangeDetails } from '../../popover/root/context';
5
7
 
6
8
  /**
7
9
  * ComboBox.Popover - Just the floating container wrapper.
@@ -16,7 +18,51 @@
16
18
 
17
19
  const ctx = useComboBoxContext();
18
20
 
19
- function handleOpenChange(open: boolean) {
21
+ function resolveFocusTarget(details?: PopoverOpenChangeDetails): HTMLElement | null {
22
+ const rawTarget = details?.event?.target;
23
+ if (!(rawTarget instanceof Node)) return null;
24
+ if (ctx.inputRef?.contains(rawTarget)) return null;
25
+ return rawTarget instanceof HTMLElement ? rawTarget : rawTarget.parentElement;
26
+ }
27
+
28
+ function handleOpenChange(open: boolean, details?: PopoverOpenChangeDetails) {
29
+ if (!open) {
30
+ // Cancel Popover.Root's close to prevent scheduleTriggerCloseFocus from
31
+ // setting stale data-focused on the trigger. The combobox passes triggerRef
32
+ // via prop (not Popover.Trigger), so Popover.Root never registers a
33
+ // blur-cleanup listener and any data-focused it sets persists forever.
34
+ //
35
+ // IMPORTANT: the actual state change is deferred to a microtask so that
36
+ // when Popover.Root's closePopover re-reads `isOpen` after the callback,
37
+ // the derived value is still `true` and the guard succeeds. A synchronous
38
+ // ctx.onOpenChange(false) would update the upstream signal immediately,
39
+ // making the derived `false` and bypassing the guard despite the cancel.
40
+ details?.cancel();
41
+
42
+ if (details?.reason === 'outside-press') {
43
+ const target = resolveFocusTarget(details);
44
+ queueMicrotask(() => {
45
+ ctx.onOpenChange(false);
46
+
47
+ if (target) {
48
+ focusWithModality(target, 'pointer' satisfies InputModality);
49
+ }
50
+
51
+ // If focus is still on the input (non-focusable target), blur it
52
+ // so focusWithin becomes false.
53
+ if (document.activeElement === ctx.inputRef) {
54
+ ctx.inputRef?.blur();
55
+ }
56
+ });
57
+ return;
58
+ }
59
+
60
+ queueMicrotask(() => {
61
+ ctx.onOpenChange(false);
62
+ });
63
+ return;
64
+ }
65
+
20
66
  ctx.onOpenChange(open);
21
67
  }
22
68
 
@@ -346,6 +346,13 @@
346
346
  !!wrapperRef && !!document.activeElement && wrapperRef.contains(document.activeElement);
347
347
  if (!focusWithin) {
348
348
  focusVisible = false;
349
+ // Clean up stale data-focused/data-focus-visible that Popover.Root's
350
+ // focus-state module may have set imperatively on the wrapper (the
351
+ // wrapper is briefly used as triggerRef before the input overrides it).
352
+ if (wrapperRef) {
353
+ delete wrapperRef.dataset.focused;
354
+ delete wrapperRef.dataset.focusVisible;
355
+ }
349
356
  }
350
357
  }
351
358
 
@@ -358,6 +365,10 @@
358
365
  queueMicrotask(syncFocusWithin);
359
366
  }
360
367
 
368
+ function setFocusVisibleState(visible: boolean) {
369
+ focusVisible = visible && focusWithin;
370
+ }
371
+
361
372
  // Use navigation hook methods for keyboard navigation
362
373
  function selectFocusedItem() {
363
374
  if (navigation.focusedId !== null) {
@@ -694,6 +705,7 @@
694
705
  unregisterItem: navigation.unregister,
695
706
  handleKeydown,
696
707
  handleInputBlur,
708
+ setFocusVisible: setFocusVisibleState,
697
709
  get focusedTagId() {
698
710
  return focusedTagId;
699
711
  },
@@ -712,6 +724,7 @@
712
724
  aria-labelledby={ariaLabelledby}
713
725
  class={className}
714
726
  data-combobox
727
+ data-focused={focusWithin || undefined}
715
728
  data-disabled={isDisabled || undefined}
716
729
  data-readonly={isReadOnly || undefined}
717
730
  data-focus-within={focusWithin || undefined}
@@ -80,6 +80,8 @@ export type ComboBoxContext<T extends object = object> = {
80
80
  handleKeydown: (event: KeyboardEvent) => void;
81
81
  /** Handle input blur - restore selection or deselect if empty */
82
82
  handleInputBlur: () => void;
83
+ /** Update root-level focus-visible state based on current modality. */
84
+ setFocusVisible: (visible: boolean) => void;
83
85
  /** Currently focused tag ID (virtual focus for tag navigation) */
84
86
  focusedTagId: string | number | null;
85
87
  /** Set focused tag ID (virtual focus for tag navigation) */
@@ -2,6 +2,7 @@
2
2
  import type { Snippet } from 'svelte';
3
3
  import type { HTMLButtonAttributes } from 'svelte/elements';
4
4
  import { getContext } from 'svelte';
5
+ import { ButtonRoot } from '../../button/index.js';
5
6
  import { cn } from '../../utils/cn';
6
7
  import { TAG_CONTEXT_KEY, type TagContext } from '../tag/combobox-tag.svelte';
7
8
 
@@ -27,7 +28,7 @@
27
28
  </script>
28
29
 
29
30
  {#if !tagCtx.disabled}
30
- <button
31
+ <ButtonRoot
31
32
  type="button"
32
33
  onclick={handleClick}
33
34
  aria-label={`Remove ${tagCtx.label}`}
@@ -49,5 +50,5 @@
49
50
  />
50
51
  </svg>
51
52
  {/if}
52
- </button>
53
+ </ButtonRoot>
53
54
  {/if}
@@ -1,4 +1,4 @@
1
- export * as DatePicker from './index.parts.ts';
1
+ export * as DatePicker from './index.parts.js';
2
2
  export { default as DatePickerRoot } from './root/date-picker-root.svelte';
3
3
  export { default as DatePickerInput } from './input/date-picker-input.svelte';
4
4
  export { default as DatePickerSegment } from './segment/date-picker-segment.svelte';
@@ -13,6 +13,6 @@ export { default as DatePickerGridHeader } from '../calendar/grid-header/calenda
13
13
  export { default as DatePickerHeaderCell } from '../calendar/header-cell/calendar-header-cell.svelte';
14
14
  export { default as DatePickerGridBody } from '../calendar/grid-body/calendar-grid-body.svelte';
15
15
  export { default as DatePickerBodyCell } from '../calendar/body-cell/calendar-body-cell.svelte';
16
- export { getDatePickerContext, setDatePickerContext, useDatePickerContext, type DatePickerContext, type DatePickerOpenChangeDetails, type DatePickerOpenChangeReason, type DatePickerSegmentPart, type DatePickerSegmentType } from './root/context.ts';
17
- import * as DatePickerParts from './index.parts.ts';
16
+ export { getDatePickerContext, setDatePickerContext, useDatePickerContext, type DatePickerContext, type DatePickerOpenChangeDetails, type DatePickerOpenChangeReason, type DatePickerSegmentPart, type DatePickerSegmentType } from './root/context.js';
17
+ import * as DatePickerParts from './index.parts.js';
18
18
  export default DatePickerParts;
@@ -1,4 +1,4 @@
1
- export * as DatePicker from './index.parts.ts';
1
+ export * as DatePicker from './index.parts.js';
2
2
  export { default as DatePickerRoot } from './root/date-picker-root.svelte';
3
3
  export { default as DatePickerInput } from './input/date-picker-input.svelte';
4
4
  export { default as DatePickerSegment } from './segment/date-picker-segment.svelte';
@@ -13,6 +13,6 @@ export { default as DatePickerGridHeader } from '../calendar/grid-header/calenda
13
13
  export { default as DatePickerHeaderCell } from '../calendar/header-cell/calendar-header-cell.svelte';
14
14
  export { default as DatePickerGridBody } from '../calendar/grid-body/calendar-grid-body.svelte';
15
15
  export { default as DatePickerBodyCell } from '../calendar/body-cell/calendar-body-cell.svelte';
16
- export { getDatePickerContext, setDatePickerContext, useDatePickerContext } from './root/context.ts';
17
- import * as DatePickerParts from './index.parts.ts';
16
+ export { getDatePickerContext, setDatePickerContext, useDatePickerContext } from './root/context.js';
17
+ import * as DatePickerParts from './index.parts.js';
18
18
  export default DatePickerParts;
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
3
  import type { HTMLButtonAttributes } from 'svelte/elements';
4
+ import { ButtonRoot } from '../../button/index.js';
4
5
  import { useDatePickerContext } from '../root/context';
5
6
  import {
6
7
  shouldShowFocusVisible,
@@ -86,14 +87,13 @@
86
87
  </script>
87
88
 
88
89
  {#if !datePicker.isReadOnly}
89
- <button
90
- bind:this={buttonRef}
90
+ <ButtonRoot
91
+ bind:element={buttonRef}
91
92
  type="button"
92
- disabled={datePicker.isDisabled}
93
+ isDisabled={datePicker.isDisabled}
93
94
  class={className}
94
95
  aria-haspopup="dialog"
95
96
  aria-expanded={datePicker.open}
96
- data-disabled={datePicker.isDisabled || undefined}
97
97
  data-focused={isFocused || undefined}
98
98
  data-focus-visible={isFocused && datePicker.focusVisible ? 'true' : undefined}
99
99
  onmousedown={handleMouseDown}
@@ -106,5 +106,5 @@
106
106
  {#if children}
107
107
  {@render children()}
108
108
  {/if}
109
- </button>
109
+ </ButtonRoot>
110
110
  {/if}
@@ -1,4 +1,4 @@
1
- import * as DialogParts from './index.parts.ts';
1
+ import * as DialogParts from './index.parts.js';
2
2
  export declare const Dialog: typeof DialogParts;
3
3
  export default DialogParts;
4
4
  export { default as DialogRoot } from './root/dialog-root.svelte';
@@ -6,5 +6,5 @@ export { default as DialogTrigger } from './trigger/dialog-trigger.svelte';
6
6
  export { default as DialogPortal } from './portal/dialog-portal.svelte';
7
7
  export { default as DialogOverlay } from './overlay/dialog-overlay.svelte';
8
8
  export { default as DialogContent } from './content/dialog-content.svelte';
9
- export { getDialogContext, setDialogContext, type DialogContext } from './root/context';
10
- export type { DialogStateHelpers } from './root/types';
9
+ export { getDialogContext, setDialogContext, type DialogContext } from './root/context.js';
10
+ export type { DialogStateHelpers } from './root/types.js';
@@ -1,6 +1,6 @@
1
1
  // Dialog component with namespace pattern
2
2
  // Usage: <Dialog.Root>, <Dialog.Trigger>, <Dialog.Portal>, <Dialog.Overlay>, <Dialog.Content>
3
- import * as DialogParts from './index.parts.ts';
3
+ import * as DialogParts from './index.parts.js';
4
4
  // Named export for namespace usage: import { Dialog } from '...'
5
5
  export const Dialog = DialogParts;
6
6
  // Default export for backwards compatibility
@@ -12,4 +12,4 @@ export { default as DialogPortal } from './portal/dialog-portal.svelte';
12
12
  export { default as DialogOverlay } from './overlay/dialog-overlay.svelte';
13
13
  export { default as DialogContent } from './content/dialog-content.svelte';
14
14
  // Re-export context utilities
15
- export { getDialogContext, setDialogContext } from './root/context';
15
+ export { getDialogContext, setDialogContext } from './root/context.js';
package/dist/index.d.ts CHANGED
@@ -1,29 +1,31 @@
1
- export { Checkbox } from './checkbox/index.ts';
2
- export { ComboBox } from './combobox/index.ts';
3
- export { Calendar } from './calendar/index.ts';
4
- export { Clock } from './clock/index.ts';
5
- export { DatePicker } from './datepicker/index.ts';
6
- export { TimePicker } from './timepicker/index.ts';
7
- export { Dialog } from './dialog/index.ts';
8
- export { ListBox } from './listbox/index.ts';
9
- export { Popover } from './popover/index.ts';
10
- export { Table } from './table/index.ts';
11
- export { default as Input } from './input/index.ts';
12
- export { default as Label } from './label/index.ts';
13
- export { default as LocaleProvider } from './locale-provider/index.ts';
14
- export { Portal } from './portal/index.ts';
15
- export * from './locale-provider/index.ts';
16
- export * from './checkbox/index.ts';
17
- export * from './combobox/index.ts';
18
- export * from './calendar/index.ts';
19
- export * from './clock/index.ts';
20
- export * from './datepicker/index.ts';
21
- export * from './timepicker/index.ts';
22
- export * from './dialog/index.ts';
23
- export * from './listbox/index.ts';
24
- export * from './popover/index.ts';
25
- export * from './table/index.ts';
26
- export * from './primitives/index.ts';
27
- export { cn } from './utils/index.ts';
28
- export * from './utils/index.ts';
29
- export * from './utils/index.ts';
1
+ export { Button } from './button/index.js';
2
+ export { Checkbox } from './checkbox/index.js';
3
+ export { ComboBox } from './combobox/index.js';
4
+ export { Calendar } from './calendar/index.js';
5
+ export { Clock } from './clock/index.js';
6
+ export { DatePicker } from './datepicker/index.js';
7
+ export { TimePicker } from './timepicker/index.js';
8
+ export { Dialog } from './dialog/index.js';
9
+ export { ListBox } from './listbox/index.js';
10
+ export { Popover } from './popover/index.js';
11
+ export { Table } from './table/index.js';
12
+ export { default as Input } from './input/index.js';
13
+ export { default as Label } from './label/index.js';
14
+ export { default as LocaleProvider } from './locale-provider/index.js';
15
+ export { Portal } from './portal/index.js';
16
+ export * from './locale-provider/index.js';
17
+ export * from './button/index.js';
18
+ export * from './checkbox/index.js';
19
+ export * from './combobox/index.js';
20
+ export * from './calendar/index.js';
21
+ export * from './clock/index.js';
22
+ export * from './datepicker/index.js';
23
+ export * from './timepicker/index.js';
24
+ export * from './dialog/index.js';
25
+ export * from './listbox/index.js';
26
+ export * from './popover/index.js';
27
+ export * from './table/index.js';
28
+ export * from './primitives/index.js';
29
+ export { cn } from './utils/index.js';
30
+ export * from './utils/index.js';
31
+ export * from './utils/index.js';
package/dist/index.js CHANGED
@@ -1,35 +1,37 @@
1
1
  // Main library entry point
2
2
  // Components (namespace exports)
3
- export { Checkbox } from './checkbox/index.ts';
4
- export { ComboBox } from './combobox/index.ts';
5
- export { Calendar } from './calendar/index.ts';
6
- export { Clock } from './clock/index.ts';
7
- export { DatePicker } from './datepicker/index.ts';
8
- export { TimePicker } from './timepicker/index.ts';
9
- export { Dialog } from './dialog/index.ts';
10
- export { ListBox } from './listbox/index.ts';
11
- export { Popover } from './popover/index.ts';
12
- export { Table } from './table/index.ts';
3
+ export { Button } from './button/index.js';
4
+ export { Checkbox } from './checkbox/index.js';
5
+ export { ComboBox } from './combobox/index.js';
6
+ export { Calendar } from './calendar/index.js';
7
+ export { Clock } from './clock/index.js';
8
+ export { DatePicker } from './datepicker/index.js';
9
+ export { TimePicker } from './timepicker/index.js';
10
+ export { Dialog } from './dialog/index.js';
11
+ export { ListBox } from './listbox/index.js';
12
+ export { Popover } from './popover/index.js';
13
+ export { Table } from './table/index.js';
13
14
  // Simple components
14
- export { default as Input } from './input/index.ts';
15
- export { default as Label } from './label/index.ts';
16
- export { default as LocaleProvider } from './locale-provider/index.ts';
17
- export { Portal } from './portal/index.ts';
18
- export * from './locale-provider/index.ts';
15
+ export { default as Input } from './input/index.js';
16
+ export { default as Label } from './label/index.js';
17
+ export { default as LocaleProvider } from './locale-provider/index.js';
18
+ export { Portal } from './portal/index.js';
19
+ export * from './locale-provider/index.js';
19
20
  // Re-export named exports from components
20
- export * from './checkbox/index.ts';
21
- export * from './combobox/index.ts';
22
- export * from './calendar/index.ts';
23
- export * from './clock/index.ts';
24
- export * from './datepicker/index.ts';
25
- export * from './timepicker/index.ts';
26
- export * from './dialog/index.ts';
27
- export * from './listbox/index.ts';
28
- export * from './popover/index.ts';
29
- export * from './table/index.ts';
21
+ export * from './button/index.js';
22
+ export * from './checkbox/index.js';
23
+ export * from './combobox/index.js';
24
+ export * from './calendar/index.js';
25
+ export * from './clock/index.js';
26
+ export * from './datepicker/index.js';
27
+ export * from './timepicker/index.js';
28
+ export * from './dialog/index.js';
29
+ export * from './listbox/index.js';
30
+ export * from './popover/index.js';
31
+ export * from './table/index.js';
30
32
  // Primitives
31
- export * from './primitives/index.ts';
33
+ export * from './primitives/index.js';
32
34
  // Utilities
33
- export { cn } from './utils/index.ts';
34
- export * from './utils/index.ts';
35
- export * from './utils/index.ts';
35
+ export { cn } from './utils/index.js';
36
+ export * from './utils/index.js';
37
+ export * from './utils/index.js';
@@ -1,6 +1,6 @@
1
- export * as ListBox from './index.parts.ts';
1
+ export * as ListBox from './index.parts.js';
2
2
  export { default as ListBoxRoot } from './root/listbox.svelte';
3
3
  export { default as ListBoxItem } from './item/listbox-item.svelte';
4
- export { useListBoxContext, createListBoxContext, type ListBoxContext } from './root/context.ts';
5
- import * as ListBoxParts from './index.parts.ts';
4
+ export { useListBoxContext, createListBoxContext, type ListBoxContext } from './root/context.js';
5
+ import * as ListBoxParts from './index.parts.js';
6
6
  export default ListBoxParts;
@@ -1,10 +1,10 @@
1
1
  // Namespace export for component composition: <ListBox.Root>, <ListBox.Item>
2
- export * as ListBox from './index.parts.ts';
2
+ export * as ListBox from './index.parts.js';
3
3
  // Direct named exports for individual imports
4
4
  export { default as ListBoxRoot } from './root/listbox.svelte';
5
5
  export { default as ListBoxItem } from './item/listbox-item.svelte';
6
6
  // Context and types
7
- export { useListBoxContext, createListBoxContext } from './root/context.ts';
7
+ export { useListBoxContext, createListBoxContext } from './root/context.js';
8
8
  // Default export as namespace object
9
- import * as ListBoxParts from './index.parts.ts';
9
+ import * as ListBoxParts from './index.parts.js';
10
10
  export default ListBoxParts;