@geoffcox/sterling-svelte 2.0.4 → 2.0.6

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 (108) hide show
  1. package/dist/Autocomplete.svelte +154 -0
  2. package/dist/Autocomplete.svelte.d.ts +4 -0
  3. package/dist/Autocomplete.types.d.ts +7 -0
  4. package/dist/Autocomplete.types.js +1 -0
  5. package/dist/Button.svelte +2 -4
  6. package/dist/Button.svelte.d.ts +1 -2
  7. package/dist/Button.types.d.ts +2 -0
  8. package/dist/Button.types.js +1 -0
  9. package/dist/Callout.svelte +2 -11
  10. package/dist/Callout.svelte.d.ts +2 -12
  11. package/dist/Checkbox.svelte +2 -4
  12. package/dist/Checkbox.svelte.d.ts +1 -2
  13. package/dist/Checkbox.types.d.ts +2 -0
  14. package/dist/Checkbox.types.js +1 -0
  15. package/dist/Dialog.svelte +4 -14
  16. package/dist/Dialog.svelte.d.ts +2 -12
  17. package/dist/Dialog.types.d.ts +11 -0
  18. package/dist/Dialog.types.js +1 -0
  19. package/dist/Dropdown.svelte +3 -20
  20. package/dist/Dropdown.svelte.d.ts +2 -17
  21. package/dist/Dropdown.types.d.ts +17 -0
  22. package/dist/Dropdown.types.js +1 -0
  23. package/dist/Input.svelte +2 -4
  24. package/dist/Input.svelte.d.ts +1 -2
  25. package/dist/Input.types.d.ts +2 -0
  26. package/dist/Input.types.js +1 -0
  27. package/dist/Label.svelte +111 -24
  28. package/dist/Label.svelte.d.ts +2 -11
  29. package/dist/Label.types.d.ts +18 -0
  30. package/dist/Label.types.js +1 -0
  31. package/dist/Link.svelte +2 -6
  32. package/dist/Link.svelte.d.ts +2 -5
  33. package/dist/Link.types.d.ts +4 -0
  34. package/dist/Link.types.js +1 -0
  35. package/dist/List.svelte +3 -10
  36. package/dist/List.svelte.d.ts +2 -8
  37. package/dist/List.types.d.ts +7 -0
  38. package/dist/ListItem.svelte +2 -7
  39. package/dist/ListItem.svelte.d.ts +2 -6
  40. package/dist/ListItem.types.d.ts +5 -0
  41. package/dist/ListItem.types.js +1 -0
  42. package/dist/Menu.svelte +2 -4
  43. package/dist/Menu.svelte.d.ts +2 -3
  44. package/dist/Menu.types.d.ts +2 -0
  45. package/dist/Menu.types.js +1 -0
  46. package/dist/MenuBar.svelte +2 -9
  47. package/dist/MenuBar.svelte.d.ts +2 -7
  48. package/dist/MenuBar.types.d.ts +6 -0
  49. package/dist/MenuButton.svelte +2 -12
  50. package/dist/MenuButton.svelte.d.ts +2 -14
  51. package/dist/MenuButton.types.d.ts +13 -0
  52. package/dist/MenuButton.types.js +1 -0
  53. package/dist/MenuItem.svelte +4 -21
  54. package/dist/MenuItem.svelte.d.ts +2 -16
  55. package/dist/MenuItem.types.d.ts +14 -0
  56. package/dist/MenuSeparator.svelte +2 -4
  57. package/dist/MenuSeparator.svelte.d.ts +2 -3
  58. package/dist/MenuSeparator.types.d.ts +2 -0
  59. package/dist/MenuSeparator.types.js +1 -0
  60. package/dist/Popover.svelte +3 -13
  61. package/dist/Popover.svelte.d.ts +2 -12
  62. package/dist/Popover.types.d.ts +10 -0
  63. package/dist/Progress.svelte +2 -10
  64. package/dist/Progress.svelte.d.ts +2 -9
  65. package/dist/Progress.types.d.ts +8 -0
  66. package/dist/Radio.svelte +2 -6
  67. package/dist/Radio.svelte.d.ts +2 -5
  68. package/dist/Radio.types.d.ts +4 -0
  69. package/dist/Radio.types.js +1 -0
  70. package/dist/Select.svelte +4 -23
  71. package/dist/Select.svelte.d.ts +2 -19
  72. package/dist/Select.types.d.ts +19 -0
  73. package/dist/Select.types.js +1 -0
  74. package/dist/Slider.svelte +3 -13
  75. package/dist/Slider.svelte.d.ts +2 -12
  76. package/dist/Slider.types.d.ts +11 -0
  77. package/dist/Slider.types.js +1 -0
  78. package/dist/Switch.svelte +2 -13
  79. package/dist/Switch.svelte.d.ts +2 -15
  80. package/dist/Switch.types.d.ts +14 -0
  81. package/dist/Switch.types.js +1 -0
  82. package/dist/Tab.svelte +2 -6
  83. package/dist/Tab.svelte.d.ts +2 -5
  84. package/dist/Tab.types.d.ts +4 -0
  85. package/dist/Tab.types.js +1 -0
  86. package/dist/TabList.svelte +3 -10
  87. package/dist/TabList.svelte.d.ts +2 -8
  88. package/dist/TabList.types.d.ts +7 -0
  89. package/dist/TextArea.svelte +4 -11
  90. package/dist/TextArea.svelte.d.ts +3 -10
  91. package/dist/TextArea.types.d.ts +7 -0
  92. package/dist/Tooltip.svelte +24 -16
  93. package/dist/Tooltip.svelte.d.ts +2 -8
  94. package/dist/Tooltip.types.d.ts +7 -0
  95. package/dist/Tooltip.types.js +1 -0
  96. package/dist/Tree.svelte +2 -11
  97. package/dist/Tree.svelte.d.ts +2 -9
  98. package/dist/Tree.types.d.ts +8 -0
  99. package/dist/TreeChevron.svelte +8 -8
  100. package/dist/TreeChevron.svelte.d.ts +2 -6
  101. package/dist/TreeChevron.types.d.ts +5 -0
  102. package/dist/TreeChevron.types.js +1 -0
  103. package/dist/TreeItem.svelte +4 -11
  104. package/dist/TreeItem.svelte.d.ts +2 -9
  105. package/dist/TreeItem.types.d.ts +8 -0
  106. package/dist/index.d.ts +32 -10
  107. package/dist/index.js +4 -3
  108. package/package.json +3 -2
@@ -1,10 +1,4 @@
1
- import { type Snippet } from 'svelte';
2
- import type { CalloutProps } from './Callout.types';
3
- type Props = Omit<CalloutProps, 'reference'> & {
4
- disabled?: boolean;
5
- hoverDelayMilliseconds?: number;
6
- tip?: string | Snippet;
7
- };
8
- declare const Tooltip: import("svelte").Component<Props, {}, "open">;
1
+ import type { TooltipProps } from './Tooltip.types';
2
+ declare const Tooltip: import("svelte").Component<TooltipProps, {}, "open">;
9
3
  type Tooltip = ReturnType<typeof Tooltip>;
10
4
  export default Tooltip;
@@ -0,0 +1,7 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { CalloutProps } from './Callout.types';
3
+ export type TooltipProps = Omit<CalloutProps, 'reference'> & {
4
+ disabled?: boolean;
5
+ hoverDelayMilliseconds?: number;
6
+ tip?: string | Snippet;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
package/dist/Tree.svelte CHANGED
@@ -2,18 +2,9 @@
2
2
 
3
3
  <script lang="ts">
4
4
  import { setContext } from 'svelte';
5
- import type { HTMLAttributes } from 'svelte/elements';
6
5
  import { usingKeyboard } from './mediaQueries/usingKeyboard';
7
6
  import { TREE_CONTEXT_KEY } from './Tree.constants';
8
- import type { TreeContext } from './Tree.types';
9
-
10
- type Props = HTMLAttributes<HTMLDivElement> & {
11
- disabled?: boolean | null;
12
- expandedValues?: string[];
13
- selectedValue?: string;
14
- onExpandCollapse?: (expandedValues: string[]) => void;
15
- onSelect?: (selectedValue: string | undefined) => void;
16
- };
7
+ import type { TreeContext, TreeProps } from './Tree.types';
17
8
 
18
9
  let {
19
10
  children,
@@ -24,7 +15,7 @@
24
15
  onSelect,
25
16
  selectedValue = $bindable(undefined),
26
17
  ...rest
27
- }: Props = $props();
18
+ }: TreeProps = $props();
28
19
 
29
20
  let treeRef: HTMLDivElement;
30
21
 
@@ -1,12 +1,5 @@
1
- import type { HTMLAttributes } from 'svelte/elements';
2
- type Props = HTMLAttributes<HTMLDivElement> & {
3
- disabled?: boolean | null;
4
- expandedValues?: string[];
5
- selectedValue?: string;
6
- onExpandCollapse?: (expandedValues: string[]) => void;
7
- onSelect?: (selectedValue: string | undefined) => void;
8
- };
9
- declare const Tree: import("svelte").Component<Props, {
1
+ import type { TreeProps } from './Tree.types';
2
+ declare const Tree: import("svelte").Component<TreeProps, {
10
3
  blur: () => void;
11
4
  focus: (options?: FocusOptions) => void;
12
5
  }, "selectedValue" | "expandedValues">;
@@ -1,5 +1,13 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
1
2
  export type TreeContext = {
2
3
  disabled: boolean | null | undefined;
3
4
  expandedValues: string[];
4
5
  selectedValue: string | undefined;
5
6
  };
7
+ export type TreeProps = HTMLAttributes<HTMLDivElement> & {
8
+ disabled?: boolean | null;
9
+ expandedValues?: string[];
10
+ selectedValue?: string;
11
+ onExpandCollapse?: (expandedValues: string[]) => void;
12
+ onSelect?: (selectedValue: string | undefined) => void;
13
+ };
@@ -2,14 +2,14 @@
2
2
 
3
3
  <script lang="ts">
4
4
  import { onMount } from 'svelte';
5
- import type { HTMLAttributes } from 'svelte/elements';
6
-
7
- type Props = HTMLAttributes<HTMLDivElement> & {
8
- expanded?: boolean | null | undefined;
9
- hasChildren?: boolean | null | undefined;
10
- };
11
-
12
- let { class: _class, expanded = false, hasChildren = false, ...rest }: Props = $props();
5
+ import type { TreeChevronProps } from './TreeChevron.types';
6
+
7
+ let {
8
+ class: _class,
9
+ expanded = false,
10
+ hasChildren = false,
11
+ ...rest
12
+ }: TreeChevronProps = $props();
13
13
 
14
14
  let previousExpanded = expanded;
15
15
  let mounted = false;
@@ -1,8 +1,4 @@
1
- import type { HTMLAttributes } from 'svelte/elements';
2
- type Props = HTMLAttributes<HTMLDivElement> & {
3
- expanded?: boolean | null | undefined;
4
- hasChildren?: boolean | null | undefined;
5
- };
6
- declare const TreeChevron: import("svelte").Component<Props, {}, "">;
1
+ import type { TreeChevronProps } from './TreeChevron.types';
2
+ declare const TreeChevron: import("svelte").Component<TreeChevronProps, {}, "">;
7
3
  type TreeChevron = ReturnType<typeof TreeChevron>;
8
4
  export default TreeChevron;
@@ -0,0 +1,5 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ export type TreeChevronProps = HTMLAttributes<HTMLDivElement> & {
3
+ expanded?: boolean | null | undefined;
4
+ hasChildren?: boolean | null | undefined;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,8 +1,8 @@
1
1
  <svelte:options runes={true} />
2
2
 
3
3
  <script lang="ts">
4
- import { getContext, setContext, type Snippet } from 'svelte';
5
- import type { HTMLAttributes, KeyboardEventHandler, MouseEventHandler } from 'svelte/elements';
4
+ import { getContext, setContext } from 'svelte';
5
+ import type { KeyboardEventHandler, MouseEventHandler } from 'svelte/elements';
6
6
  import type { SlideParams, TransitionConfig } from 'svelte/transition';
7
7
  import { slide } from 'svelte/transition';
8
8
  import { prefersReducedMotion } from './mediaQueries/prefersReducedMotion';
@@ -10,14 +10,7 @@
10
10
  import type { TreeContext } from './Tree.types';
11
11
  import TreeChevron from './TreeChevron.svelte';
12
12
  import { TREE_ITEM_CONTEXT_KEY } from './TreeItem.constants';
13
- import type { TreeItemContext } from './TreeItem.types';
14
-
15
- type Props = HTMLAttributes<HTMLDivElement> & {
16
- disabled?: boolean | null | undefined;
17
- icon?: Snippet;
18
- label?: string | Snippet;
19
- value: string;
20
- };
13
+ import type { TreeItemContext, TreeItemProps } from './TreeItem.types';
21
14
 
22
15
  let {
23
16
  children,
@@ -28,7 +21,7 @@
28
21
  style,
29
22
  value,
30
23
  ...rest
31
- }: Props = $props();
24
+ }: TreeItemProps = $props();
32
25
 
33
26
  const slideNoOp = (node: Element, params?: SlideParams): TransitionConfig => {
34
27
  return { delay: 0, duration: 0 };
@@ -1,12 +1,5 @@
1
- import { type Snippet } from 'svelte';
2
- import type { HTMLAttributes } from 'svelte/elements';
3
- type Props = HTMLAttributes<HTMLDivElement> & {
4
- disabled?: boolean | null | undefined;
5
- icon?: Snippet;
6
- label?: string | Snippet;
7
- value: string;
8
- };
9
- declare const TreeItem: import("svelte").Component<Props, {
1
+ import type { TreeItemProps } from './TreeItem.types';
2
+ declare const TreeItem: import("svelte").Component<TreeItemProps, {
10
3
  collapse: () => boolean;
11
4
  expand: () => boolean;
12
5
  toggleExpanded: () => boolean;
@@ -1,4 +1,12 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
1
3
  export type TreeItemContext = {
2
4
  depth: number;
3
5
  disabled: boolean | null | undefined;
4
6
  };
7
+ export type TreeItemProps = HTMLAttributes<HTMLDivElement> & {
8
+ disabled?: boolean | null | undefined;
9
+ icon?: Snippet;
10
+ label?: string | Snippet;
11
+ value: string;
12
+ };
package/dist/index.d.ts CHANGED
@@ -10,15 +10,6 @@ export { prefersColorSchemeDark } from './mediaQueries/prefersColorSchemeDark';
10
10
  export { prefersReducedMotion } from './mediaQueries/prefersReducedMotion';
11
11
  export { usingKeyboard } from './mediaQueries/usingKeyboard';
12
12
  export { idGenerator } from './idGenerator';
13
- export type { ListContext } from './List.types';
14
- export type { MenuBarContext } from './MenuBar.types';
15
- export type { MenuItemContext, MenuItemRegistration, MenuItemRole } from './MenuItem.types';
16
- export type { PopoverPlacement } from './Popover.types';
17
- export type { ProgressOrientation } from './Progress.types';
18
- export type { TabListContext } from './TabList.types';
19
- export type { TextAreaResize } from './TextArea.types';
20
- export type { TreeContext } from './Tree.types';
21
- export type { TreeItemContext } from './TreeItem.types';
22
13
  export { LABEL_STATUSES, LABEL_VARIANTS } from './Label.constants';
23
14
  export { LIST_CONTEXT_KEY } from './List.constants';
24
15
  export { MENU_BAR_CONTEXT_KEY } from './MenuBar.constants';
@@ -29,6 +20,37 @@ export { TAB_LIST_CONTEXT_KEY } from './TabList.constants';
29
20
  export { TEXT_AREA_RESIZES } from './TextArea.constants';
30
21
  export { TREE_CONTEXT_KEY } from './Tree.constants';
31
22
  export { TREE_ITEM_CONTEXT_KEY } from './TreeItem.constants';
23
+ export type { AutocompleteProps } from './Autocomplete.types';
24
+ export type { ButtonProps } from './Button.types';
25
+ export type { CalloutProps } from './Callout.types';
26
+ export type { CheckboxProps } from './Checkbox.types';
27
+ export type { DialogProps } from './Dialog.types';
28
+ export type { DropdownProps } from './Dropdown.types';
29
+ export type { InputProps } from './Input.types';
30
+ export type { LabelProps } from './Label.types';
31
+ export type { LinkProps } from './Link.types';
32
+ export type { ListItemProps } from './ListItem.types';
33
+ export type { ListContext, ListProps } from './List.types';
34
+ export type { MenuBarContext, MenuBarProps } from './MenuBar.types';
35
+ export type { MenuButtonProps } from './MenuButton.types';
36
+ export type { MenuItemContext, MenuItemRegistration, MenuItemRole, MenuItemProps } from './MenuItem.types';
37
+ export type { MenuProps } from './Menu.types';
38
+ export type { MenuSeparatorProps } from './MenuSeparator.types';
39
+ export type { PaginationProps } from './Pagination.types';
40
+ export type { PopoverPlacement, PopoverProps } from './Popover.types';
41
+ export type { ProgressOrientation, ProgressProps } from './Progress.types';
42
+ export type { RadioProps } from './Radio.types';
43
+ export type { SelectProps } from './Select.types';
44
+ export type { SliderProps } from './Slider.types';
45
+ export type { SwitchProps } from './Switch.types';
46
+ export type { TabListContext, TabListProps } from './TabList.types';
47
+ export type { TabProps } from './Tab.types';
48
+ export type { TextAreaProps, TextAreaResize } from './TextArea.types';
49
+ export type { TooltipProps } from './Tooltip.types';
50
+ export type { TreeChevronProps } from './TreeChevron.types';
51
+ export type { TreeItemContext, TreeItemProps } from './TreeItem.types';
52
+ export type { TreeContext, TreeProps } from './Tree.types';
53
+ import Autocomplete from './Autocomplete.svelte';
32
54
  import Button from './Button.svelte';
33
55
  import Callout from './Callout.svelte';
34
56
  import Checkbox from './Checkbox.svelte';
@@ -58,4 +80,4 @@ import Tooltip from './Tooltip.svelte';
58
80
  import Tree from './Tree.svelte';
59
81
  import TreeChevron from './TreeChevron.svelte';
60
82
  import TreeItem from './TreeItem.svelte';
61
- export { Button, Callout, Checkbox, Dialog, Dropdown, Input, Label, Link, List, ListItem, Menu, MenuBar, MenuButton, MenuItem, MenuSeparator, Pagination, Popover, Progress, Radio, Select, Slider, Switch, Tab, TabList, TextArea, Tooltip, Tree, TreeChevron, TreeItem };
83
+ export { Autocomplete, Button, Callout, Checkbox, Dialog, Dropdown, Input, Label, Link, List, ListItem, Menu, MenuBar, MenuButton, MenuItem, MenuSeparator, Pagination, Popover, Progress, Radio, Select, Slider, Switch, Tab, TabList, TextArea, Tooltip, Tree, TreeChevron, TreeItem };
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ export { prefersReducedMotion } from './mediaQueries/prefersReducedMotion';
12
12
  export { usingKeyboard } from './mediaQueries/usingKeyboard';
13
13
  // ----- functions ----- //
14
14
  export { idGenerator } from './idGenerator';
15
- // ----- Component constants ----- //
15
+ // ----- constants ----- //
16
16
  export { LABEL_STATUSES, LABEL_VARIANTS } from './Label.constants';
17
17
  export { LIST_CONTEXT_KEY } from './List.constants';
18
18
  export { MENU_BAR_CONTEXT_KEY } from './MenuBar.constants';
@@ -23,7 +23,8 @@ export { TAB_LIST_CONTEXT_KEY } from './TabList.constants';
23
23
  export { TEXT_AREA_RESIZES } from './TextArea.constants';
24
24
  export { TREE_CONTEXT_KEY } from './Tree.constants';
25
25
  export { TREE_ITEM_CONTEXT_KEY } from './TreeItem.constants';
26
- // ----- Components ----- //
26
+ // ----- components ----- //
27
+ import Autocomplete from './Autocomplete.svelte';
27
28
  import Button from './Button.svelte';
28
29
  import Callout from './Callout.svelte';
29
30
  import Checkbox from './Checkbox.svelte';
@@ -53,4 +54,4 @@ import Tooltip from './Tooltip.svelte';
53
54
  import Tree from './Tree.svelte';
54
55
  import TreeChevron from './TreeChevron.svelte';
55
56
  import TreeItem from './TreeItem.svelte';
56
- export { Button, Callout, Checkbox, Dialog, Dropdown, Input, Label, Link, List, ListItem, Menu, MenuBar, MenuButton, MenuItem, MenuSeparator, Pagination, Popover, Progress, Radio, Select, Slider, Switch, Tab, TabList, TextArea, Tooltip, Tree, TreeChevron, TreeItem };
57
+ export { Autocomplete, Button, Callout, Checkbox, Dialog, Dropdown, Input, Label, Link, List, ListItem, Menu, MenuBar, MenuButton, MenuItem, MenuSeparator, Pagination, Popover, Progress, Radio, Select, Slider, Switch, Tab, TabList, TextArea, Tooltip, Tree, TreeChevron, TreeItem };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geoffcox/sterling-svelte",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "author": "Geoff Cox",
5
5
  "description": "A modern, accessible, and lightweight component library for Svelte.",
6
6
  "license": "MIT",
@@ -19,6 +19,7 @@
19
19
  "component",
20
20
  "components",
21
21
  "controls",
22
+ "autocomplete",
22
23
  "button",
23
24
  "callout",
24
25
  "checkbox",
@@ -74,7 +75,7 @@
74
75
  "@eslint/js": "^9.18.0",
75
76
  "@fontsource/atkinson-hyperlegible": "^5.1.1",
76
77
  "@fontsource/source-code-pro": "^4.5.14",
77
- "@geoffcox/sterling-svelte-themes": "^2.0.0",
78
+ "@geoffcox/sterling-svelte-themes": "^2.0.2",
78
79
  "@sveltejs/adapter-static": "^3.0.8",
79
80
  "@sveltejs/kit": "^2.16.0",
80
81
  "@sveltejs/package": "^2.0.0",