@slurp-ui/react 1.1.1 → 1.3.0

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 (207) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/AvatarGroup/AvatarGroup.d.ts +26 -0
  3. package/dist/AvatarGroup/AvatarGroup.js +46 -0
  4. package/dist/AvatarGroup/AvatarGroup.js.map +1 -0
  5. package/dist/AvatarGroup/index.d.ts +3 -0
  6. package/dist/AvatarGroup/index.js +2 -0
  7. package/dist/Bloom/Bloom.js +3 -2
  8. package/dist/Bloom/Bloom.js.map +1 -1
  9. package/dist/Calendar/Calendar.d.ts +42 -0
  10. package/dist/Calendar/Calendar.js +178 -0
  11. package/dist/Calendar/Calendar.js.map +1 -0
  12. package/dist/Calendar/dates.d.ts +3 -0
  13. package/dist/Calendar/dates.js +46 -0
  14. package/dist/Calendar/dates.js.map +1 -0
  15. package/dist/Calendar/index.d.ts +3 -0
  16. package/dist/Calendar/index.js +2 -0
  17. package/dist/Carousel/Carousel.js +2 -0
  18. package/dist/Carousel/Carousel.js.map +1 -1
  19. package/dist/Choice/Choice.js +2 -0
  20. package/dist/Choice/Choice.js.map +1 -1
  21. package/dist/Code/Code.d.ts +38 -0
  22. package/dist/Code/Code.js +82 -0
  23. package/dist/Code/Code.js.map +1 -0
  24. package/dist/Code/index.d.ts +3 -0
  25. package/dist/Code/index.js +2 -0
  26. package/dist/Compare/Compare.d.ts +23 -0
  27. package/dist/Compare/Compare.js +61 -0
  28. package/dist/Compare/Compare.js.map +1 -0
  29. package/dist/Compare/index.d.ts +3 -0
  30. package/dist/Compare/index.js +2 -0
  31. package/dist/Consent/Consent.d.ts +30 -0
  32. package/dist/Consent/Consent.js +70 -0
  33. package/dist/Consent/Consent.js.map +1 -0
  34. package/dist/Consent/index.d.ts +3 -0
  35. package/dist/Consent/index.js +2 -0
  36. package/dist/Contents/Contents.d.ts +35 -0
  37. package/dist/Contents/Contents.js +63 -0
  38. package/dist/Contents/Contents.js.map +1 -0
  39. package/dist/Contents/index.d.ts +3 -0
  40. package/dist/Contents/index.js +2 -0
  41. package/dist/DateField/DateField.d.ts +29 -0
  42. package/dist/DateField/DateField.js +118 -0
  43. package/dist/DateField/DateField.js.map +1 -0
  44. package/dist/DateField/index.d.ts +3 -0
  45. package/dist/DateField/index.js +2 -0
  46. package/dist/Dialog/Dialog.d.ts +2 -0
  47. package/dist/Dialog/Dialog.js +89 -30
  48. package/dist/Dialog/Dialog.js.map +1 -1
  49. package/dist/Dock/Dock.d.ts +5 -0
  50. package/dist/Dock/Dock.js +13 -2
  51. package/dist/Dock/Dock.js.map +1 -1
  52. package/dist/ErrorSummary/ErrorSummary.d.ts +26 -0
  53. package/dist/ErrorSummary/ErrorSummary.js +68 -0
  54. package/dist/ErrorSummary/ErrorSummary.js.map +1 -0
  55. package/dist/ErrorSummary/index.d.ts +3 -0
  56. package/dist/ErrorSummary/index.js +2 -0
  57. package/dist/FileDrop/FileDrop.d.ts +34 -0
  58. package/dist/FileDrop/FileDrop.js +145 -0
  59. package/dist/FileDrop/FileDrop.js.map +1 -0
  60. package/dist/FileDrop/index.d.ts +3 -0
  61. package/dist/FileDrop/index.js +2 -0
  62. package/dist/Filters/Filters.js +2 -0
  63. package/dist/Filters/Filters.js.map +1 -1
  64. package/dist/Footer/Footer.d.ts +37 -0
  65. package/dist/Footer/Footer.js +63 -0
  66. package/dist/Footer/Footer.js.map +1 -0
  67. package/dist/Footer/index.d.ts +3 -0
  68. package/dist/Footer/index.js +2 -0
  69. package/dist/Hairline/Hairline.d.ts +16 -0
  70. package/dist/Hairline/Hairline.js +23 -0
  71. package/dist/Hairline/Hairline.js.map +1 -0
  72. package/dist/Hairline/index.d.ts +3 -0
  73. package/dist/Hairline/index.js +2 -0
  74. package/dist/Hint/Hint.js +20 -1
  75. package/dist/Hint/Hint.js.map +1 -1
  76. package/dist/Kbd/Kbd.d.ts +7 -0
  77. package/dist/Kbd/Kbd.js +20 -0
  78. package/dist/Kbd/Kbd.js.map +1 -0
  79. package/dist/Kbd/index.d.ts +3 -0
  80. package/dist/Kbd/index.js +2 -0
  81. package/dist/Lightbox/Lightbox.d.ts +30 -0
  82. package/dist/Lightbox/Lightbox.js +74 -0
  83. package/dist/Lightbox/Lightbox.js.map +1 -0
  84. package/dist/Lightbox/index.d.ts +3 -0
  85. package/dist/Lightbox/index.js +2 -0
  86. package/dist/ListRow/ListRow.d.ts +5 -1
  87. package/dist/ListRow/ListRow.js +5 -1
  88. package/dist/ListRow/ListRow.js.map +1 -1
  89. package/dist/Media/Media.d.ts +28 -0
  90. package/dist/Media/Media.js +65 -0
  91. package/dist/Media/Media.js.map +1 -0
  92. package/dist/Media/index.d.ts +3 -0
  93. package/dist/Media/index.js +2 -0
  94. package/dist/Menu/Menu.d.ts +13 -0
  95. package/dist/Menu/Menu.js +43 -11
  96. package/dist/Menu/Menu.js.map +1 -1
  97. package/dist/Menu/index.d.ts +2 -2
  98. package/dist/Menu/index.js +1 -1
  99. package/dist/MultiSuggest/MultiSuggest.d.ts +39 -0
  100. package/dist/MultiSuggest/MultiSuggest.js +267 -0
  101. package/dist/MultiSuggest/MultiSuggest.js.map +1 -0
  102. package/dist/MultiSuggest/index.d.ts +3 -0
  103. package/dist/MultiSuggest/index.js +2 -0
  104. package/dist/Notice/Notice.js +2 -0
  105. package/dist/Notice/Notice.js.map +1 -1
  106. package/dist/NumberField/NumberField.d.ts +32 -0
  107. package/dist/NumberField/NumberField.js +126 -0
  108. package/dist/NumberField/NumberField.js.map +1 -0
  109. package/dist/NumberField/index.d.ts +3 -0
  110. package/dist/NumberField/index.js +2 -0
  111. package/dist/PageNav/PageNav.d.ts +25 -0
  112. package/dist/PageNav/PageNav.js +57 -0
  113. package/dist/PageNav/PageNav.js.map +1 -0
  114. package/dist/PageNav/index.d.ts +3 -0
  115. package/dist/PageNav/index.js +2 -0
  116. package/dist/Pages/Pages.js +2 -0
  117. package/dist/Pages/Pages.js.map +1 -1
  118. package/dist/PinField/PinField.d.ts +26 -0
  119. package/dist/PinField/PinField.js +73 -0
  120. package/dist/PinField/PinField.js.map +1 -0
  121. package/dist/PinField/index.d.ts +3 -0
  122. package/dist/PinField/index.js +2 -0
  123. package/dist/Prose/Prose.d.ts +15 -0
  124. package/dist/Prose/Prose.js +25 -0
  125. package/dist/Prose/Prose.js.map +1 -0
  126. package/dist/Prose/index.d.ts +3 -0
  127. package/dist/Prose/index.js +2 -0
  128. package/dist/Quote/Quote.d.ts +19 -0
  129. package/dist/Quote/Quote.js +52 -0
  130. package/dist/Quote/Quote.js.map +1 -0
  131. package/dist/Quote/index.d.ts +3 -0
  132. package/dist/Quote/index.js +2 -0
  133. package/dist/Rail/Rail.d.ts +37 -0
  134. package/dist/Rail/Rail.js +61 -0
  135. package/dist/Rail/Rail.js.map +1 -0
  136. package/dist/Rail/index.d.ts +3 -0
  137. package/dist/Rail/index.js +2 -0
  138. package/dist/Rating/Rating.js +2 -0
  139. package/dist/Rating/Rating.js.map +1 -1
  140. package/dist/Search/Search.js +2 -0
  141. package/dist/Search/Search.js.map +1 -1
  142. package/dist/SecretField/SecretField.d.ts +17 -0
  143. package/dist/SecretField/SecretField.js +59 -0
  144. package/dist/SecretField/SecretField.js.map +1 -0
  145. package/dist/SecretField/index.d.ts +3 -0
  146. package/dist/SecretField/index.js +2 -0
  147. package/dist/Settings/Settings.js +2 -0
  148. package/dist/Settings/Settings.js.map +1 -1
  149. package/dist/Sheet/Sheet.d.ts +8 -3
  150. package/dist/Sheet/Sheet.js +1 -1
  151. package/dist/Sheet/Sheet.js.map +1 -1
  152. package/dist/Sheet/index.d.ts +2 -2
  153. package/dist/SkipLink/SkipLink.d.ts +22 -0
  154. package/dist/SkipLink/SkipLink.js +32 -0
  155. package/dist/SkipLink/SkipLink.js.map +1 -0
  156. package/dist/SkipLink/index.d.ts +3 -0
  157. package/dist/SkipLink/index.js +2 -0
  158. package/dist/SlurpProvider/SlurpProvider.d.ts +7 -1
  159. package/dist/SlurpProvider/SlurpProvider.js +14 -6
  160. package/dist/SlurpProvider/SlurpProvider.js.map +1 -1
  161. package/dist/Steps/Steps.js +2 -0
  162. package/dist/Steps/Steps.js.map +1 -1
  163. package/dist/Suggest/Suggest.js +2 -0
  164. package/dist/Suggest/Suggest.js.map +1 -1
  165. package/dist/Table/Table.d.ts +12 -0
  166. package/dist/Table/Table.js +56 -10
  167. package/dist/Table/Table.js.map +1 -1
  168. package/dist/Tag/Tag.d.ts +14 -0
  169. package/dist/Tag/Tag.js +26 -0
  170. package/dist/Tag/Tag.js.map +1 -0
  171. package/dist/Tag/index.d.ts +3 -0
  172. package/dist/Tag/index.js +2 -0
  173. package/dist/Timeline/Timeline.d.ts +23 -0
  174. package/dist/Timeline/Timeline.js +49 -0
  175. package/dist/Timeline/Timeline.js.map +1 -0
  176. package/dist/Timeline/index.d.ts +3 -0
  177. package/dist/Timeline/index.js +2 -0
  178. package/dist/Toast/Toast.js +31 -7
  179. package/dist/Toast/Toast.js.map +1 -1
  180. package/dist/Tree/Tree.d.ts +24 -0
  181. package/dist/Tree/Tree.js +113 -0
  182. package/dist/Tree/Tree.js.map +1 -0
  183. package/dist/Tree/index.d.ts +3 -0
  184. package/dist/Tree/index.js +2 -0
  185. package/dist/index.d.ts +63 -8
  186. package/dist/index.js +31 -2
  187. package/dist/internal/labels.js +12 -0
  188. package/dist/internal/labels.js.map +1 -0
  189. package/dist/lib/labels.d.ts +210 -0
  190. package/dist/lib/labels.js +139 -0
  191. package/dist/lib/labels.js.map +1 -0
  192. package/dist/lib/theme.d.ts +134 -4
  193. package/dist/lib/theme.js.map +1 -1
  194. package/dist/styles.css +1912 -138
  195. package/dist/tokens.css +9 -0
  196. package/dist/utils/focus.d.ts +1 -1
  197. package/dist/utils/focus.js +2 -2
  198. package/dist/utils/focus.js.map +1 -1
  199. package/dist/utils/index.d.ts +3 -1
  200. package/dist/utils/index.js +3 -1
  201. package/dist/utils/useClipboard.d.ts +14 -0
  202. package/dist/utils/useClipboard.js +30 -0
  203. package/dist/utils/useClipboard.js.map +1 -0
  204. package/dist/utils/useScrollSpy.d.ts +14 -0
  205. package/dist/utils/useScrollSpy.js +27 -0
  206. package/dist/utils/useScrollSpy.js.map +1 -0
  207. package/package.json +5 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tree.js","names":[],"sources":["../../src/Tree/Tree.tsx"],"sourcesContent":["import { ChevronRightIcon } from '@slurp-ui/icons';\nimport { cx } from '@slurp-ui/utils';\nimport { useRef, useState, type ElementType, type KeyboardEvent, type ReactNode } from 'react';\n\nimport { useAnimationRoot } from '../internal/animation';\nimport { useCss, useThemeProps } from '../internal/styled';\nimport type { PolymorphicProps } from '../lib/polymorphic';\nimport { useControlled } from '../utils/useControlled';\n\nexport interface TreeItem {\n id: string;\n label: ReactNode;\n /** Nested items; a node with children expands. */\n children?: TreeItem[];\n}\n\nexport interface TreeOwnProps {\n /** Names the tree. */\n label: string;\n items: TreeItem[];\n /** The chosen node. */\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (id: string) => void;\n /** Ids open at first. */\n defaultExpanded?: string[];\n}\n\nexport type TreeProps<E extends ElementType = 'ul'> = PolymorphicProps<E, TreeOwnProps>;\n\ninterface Flat {\n item: TreeItem;\n level: number;\n parent: string | null;\n}\n\n/** A nested list (files, categories): one tab stop, arrows move, Right opens, Left closes or goes to the parent. */\nexport function Tree<E extends ElementType = 'ul'>(props: TreeProps<E>) {\n const {\n as,\n css,\n className,\n label,\n items,\n value: valueProp,\n defaultValue = null,\n onValueChange,\n defaultExpanded = [],\n ...rest\n } = useThemeProps('Tree', props as TreeProps);\n const [value, setValue] = useControlled<string | null>({\n value: valueProp,\n defaultValue,\n onChange: onValueChange as ((v: string | null) => void) | undefined,\n });\n const [open, setOpen] = useState<string[]>(defaultExpanded);\n const [current, setCurrent] = useState<string | null>(null);\n const root = useRef<HTMLElement>(null);\n const Root = (as ?? 'ul') as ElementType;\n const styled = useCss('Tree', 'root', css);\n const animated = useAnimationRoot(rest);\n\n const visible: Flat[] = [];\n const walk = (list: TreeItem[], level: number, parent: string | null) => {\n for (const item of list) {\n visible.push({ item, level, parent });\n if (item.children?.length && open.includes(item.id)) walk(item.children, level + 1, item.id);\n }\n };\n walk(items, 1, null);\n const tabStop = visible.some((v) => v.item.id === current)\n ? current\n : (visible[0]?.item.id ?? null);\n\n const focusId = (id: string | undefined) => {\n if (!id) return;\n setCurrent(id);\n root.current?.querySelector<HTMLElement>(`[data-id=\"${CSS.escape(id)}\"]`)?.focus();\n };\n const toggle = (id: string, on: boolean) =>\n setOpen((o) => (on ? [...o, id] : o.filter((x) => x !== id)));\n\n const keys = (e: KeyboardEvent, f: Flat, i: number) => {\n const { item } = f;\n const has = Boolean(item.children?.length);\n const isOpen = open.includes(item.id);\n if (e.key === 'ArrowDown') focusId(visible[i + 1]?.item.id);\n else if (e.key === 'ArrowUp') focusId(visible[i - 1]?.item.id);\n else if (e.key === 'Home') focusId(visible[0]?.item.id);\n else if (e.key === 'End') focusId(visible.at(-1)?.item.id);\n else if (e.key === 'ArrowRight') {\n if (has && !isOpen) toggle(item.id, true);\n else if (has) focusId(visible[i + 1]?.item.id);\n } else if (e.key === 'ArrowLeft') {\n if (has && isOpen) toggle(item.id, false);\n else if (f.parent) focusId(f.parent);\n } else if (e.key === 'Enter' || e.key === ' ') {\n if (has) toggle(item.id, !isOpen);\n setValue(item.id);\n } else return;\n e.preventDefault();\n };\n\n const render = (list: TreeItem[], level: number): ReactNode =>\n list.map((item) => {\n const i = visible.findIndex((v) => v.item.id === item.id);\n const has = Boolean(item.children?.length);\n const isOpen = open.includes(item.id);\n const flat = visible[i];\n return (\n <li key={item.id} role=\"none\">\n <div\n role=\"treeitem\"\n data-id={item.id}\n tabIndex={item.id === tabStop ? 0 : -1}\n aria-level={level}\n aria-expanded={has ? isOpen : undefined}\n aria-selected={value === item.id}\n className=\"slurp-tree-item\"\n style={{ paddingInlineStart: `calc(var(--slurp-space-3) + ${(level - 1) * 20}px)` }}\n onFocus={() => setCurrent(item.id)}\n onKeyDown={(e) => flat && e.target === e.currentTarget && keys(e, flat, i)}\n onClick={() => {\n setCurrent(item.id);\n if (has) toggle(item.id, !isOpen);\n setValue(item.id);\n }}\n >\n <span\n className=\"slurp-tree-chevron\"\n data-open={isOpen ? '' : undefined}\n aria-hidden=\"true\"\n >\n {has && <ChevronRightIcon size={16} />}\n </span>\n <span className=\"slurp-tree-label\">{item.label}</span>\n </div>\n {has && isOpen && (\n <ul role=\"group\" className=\"slurp-tree-group\">\n {render(item.children as TreeItem[], level + 1)}\n </ul>\n )}\n </li>\n );\n });\n\n return (\n <>\n {styled.style}\n <Root\n ref={root}\n role=\"tree\"\n aria-label={label}\n className={cx('slurp-tree', styled.className, className)}\n {...animated}\n >\n {render(items, 1)}\n </Root>\n </>\n );\n}\n"],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+
2
+ import { Tree, TreeItem, TreeProps } from "./Tree.js";
3
+ export { Tree, type TreeItem, type TreeProps, Tree as default };
@@ -0,0 +1,2 @@
1
+
2
+ export { Tree, Tree as default } from "./Tree.js";
package/dist/index.d.ts CHANGED
@@ -6,6 +6,8 @@ import { AccentScope, AccentScopeProps } from "./AccentScope/AccentScope.js";
6
6
  import "./AccentScope/index.js";
7
7
  import { Avatar, AvatarProps } from "./Avatar/Avatar.js";
8
8
  import "./Avatar/index.js";
9
+ import { AVATAR_GROUP_LABELS, AvatarGroup, AvatarGroupLabels, AvatarGroupProps } from "./AvatarGroup/AvatarGroup.js";
10
+ import "./AvatarGroup/index.js";
9
11
  import { Bento, BentoProps } from "./Bento/Bento.js";
10
12
  import "./Bento/index.js";
11
13
  import { Bloom, BloomPlacement, BloomProps } from "./Bloom/Bloom.js";
@@ -14,6 +16,8 @@ import { Appearance, Button, ButtonProps, ButtonTone, ControlSize } from "./Butt
14
16
  import { Bubble, BubbleProps } from "./Bubble/Bubble.js";
15
17
  import "./Bubble/index.js";
16
18
  import "./Button/index.js";
19
+ import { CALENDAR_LABELS, Calendar, CalendarLabels, CalendarProps, CalendarValue, DateRange } from "./Calendar/Calendar.js";
20
+ import "./Calendar/index.js";
17
21
  import { Card, CardProps } from "./Card/Card.js";
18
22
  import "./Card/index.js";
19
23
  import { CAROUSEL_LABELS, Carousel, CarouselLabels, CarouselProps } from "./Carousel/Carousel.js";
@@ -26,49 +30,88 @@ import { Chip, ChipProps } from "./Chip/Chip.js";
26
30
  import "./Chip/index.js";
27
31
  import { CHOICE_LABELS, Choice, ChoiceLabels, ChoiceOption, ChoiceProps } from "./Choice/Choice.js";
28
32
  import "./Choice/index.js";
33
+ import { CODE_LABELS, Code, CodeLabels, CodeProps } from "./Code/Code.js";
34
+ import "./Code/index.js";
35
+ import { COMPARE_LABELS, Compare, CompareLabels, CompareProps } from "./Compare/Compare.js";
36
+ import "./Compare/index.js";
37
+ import { CONSENT_LABELS, Consent, ConsentLabels, ConsentProps } from "./Consent/Consent.js";
38
+ import "./Consent/index.js";
39
+ import { CONTENTS_LABELS, Contents, ContentsItem, ContentsLabels, ContentsProps } from "./Contents/Contents.js";
40
+ import "./Contents/index.js";
29
41
  import { Count, CountProps } from "./Count/Count.js";
30
42
  import "./Count/index.js";
31
- import { DIALOG_LABELS, Dialog, DialogLabels, DialogProps } from "./Dialog/Dialog.js";
43
+ import { DATEFIELD_LABELS, DateField, DateFieldLabels, DateFieldProps } from "./DateField/DateField.js";
44
+ import "./DateField/index.js";
45
+ import { DIALOG_LABELS, Dialog, DialogLabels, DialogProps, SheetSide } from "./Dialog/Dialog.js";
32
46
  import "./Dialog/index.js";
33
47
  import { DOCK_LABELS, Dock, DockActionProps, DockBackProps, DockCrumbProps, DockCrumbsProps, DockLabels, DockProps, DockSearchProps } from "./Dock/Dock.js";
34
48
  import "./Dock/index.js";
35
49
  import { Empty, EmptyProps } from "./Empty/Empty.js";
36
50
  import "./Empty/index.js";
51
+ import { ERRORSUMMARY_LABELS, ErrorSummary, ErrorSummaryItem, ErrorSummaryLabels, ErrorSummaryProps } from "./ErrorSummary/ErrorSummary.js";
52
+ import "./ErrorSummary/index.js";
37
53
  import { Fact, FactProps } from "./Fact/Fact.js";
38
54
  import "./Fact/index.js";
39
55
  import { Field, FieldProps } from "./Field/Field.js";
40
56
  import "./Field/index.js";
57
+ import { FILEDROP_LABELS, FileDrop, FileDropLabels, FileDropProps } from "./FileDrop/FileDrop.js";
58
+ import "./FileDrop/index.js";
41
59
  import { FILTERS_LABELS, Filters, FiltersGroupProps, FiltersLabels, FiltersProps } from "./Filters/Filters.js";
42
60
  import "./Filters/index.js";
43
61
  import { Flow, FlowProps } from "./Flow/Flow.js";
44
62
  import "./Flow/index.js";
45
63
  import { Fold, FoldProps } from "./Fold/Fold.js";
46
64
  import "./Fold/index.js";
65
+ import { Footer, FooterBottom, FooterGroup, FooterGroupProps, FooterLink, FooterLinkProps, FooterProps } from "./Footer/Footer.js";
66
+ import "./Footer/index.js";
47
67
  import { Frame, FrameProps } from "./Frame/Frame.js";
48
68
  import "./Frame/index.js";
49
69
  import { Ground } from "./Ground/Ground.js";
70
+ import { Hairline, HairlineProps } from "./Hairline/Hairline.js";
71
+ import "./Hairline/index.js";
50
72
  import { Hint, HintProps } from "./Hint/Hint.js";
51
73
  import "./Hint/index.js";
74
+ import { Kbd, KbdProps } from "./Kbd/Kbd.js";
75
+ import "./Kbd/index.js";
76
+ import { LIGHTBOX_LABELS, Lightbox, LightboxImage, LightboxLabels, LightboxProps } from "./Lightbox/Lightbox.js";
77
+ import "./Lightbox/index.js";
52
78
  import { Link, LinkProps } from "./Link/Link.js";
53
79
  import "./Link/index.js";
54
80
  import { List, ListProps, ListRow, ListRowProps } from "./ListRow/ListRow.js";
55
81
  import "./ListRow/index.js";
56
82
  import { Mark, MarkProps } from "./Mark/Mark.js";
57
83
  import "./Mark/index.js";
58
- import { Menu, MenuItem, MenuItemProps, MenuProps } from "./Menu/Menu.js";
84
+ import { Media, MediaProps } from "./Media/Media.js";
85
+ import "./Media/index.js";
86
+ import { Menu, MenuGroup, MenuGroupProps, MenuItem, MenuItemProps, MenuProps, MenuSeparator } from "./Menu/Menu.js";
59
87
  import "./Menu/index.js";
88
+ import { SUGGEST_LABELS, Suggest, SuggestLabels, SuggestOption, SuggestProps } from "./Suggest/Suggest.js";
89
+ import { MULTI_SUGGEST_LABELS, MultiSuggest, MultiSuggestLabels, MultiSuggestProps } from "./MultiSuggest/MultiSuggest.js";
90
+ import "./MultiSuggest/index.js";
60
91
  import { NOTICE_LABELS, Notice, NoticeLabels, NoticeProps, StatusTone } from "./Notice/Notice.js";
61
92
  import "./Notice/index.js";
93
+ import { NUMBERFIELD_LABELS, NumberField, NumberFieldLabels, NumberFieldProps } from "./NumberField/NumberField.js";
94
+ import "./NumberField/index.js";
95
+ import { PAGENAV_LABELS, PageNav, PageNavLabels, PageNavProps, PageNavTarget } from "./PageNav/PageNav.js";
96
+ import "./PageNav/index.js";
62
97
  import { PAGES_LABELS, PageItem, Pages, PagesLabels, PagesProps, pageItems } from "./Pages/Pages.js";
63
98
  import "./Pages/index.js";
99
+ import { PinField, PinFieldProps } from "./PinField/PinField.js";
100
+ import "./PinField/index.js";
64
101
  import { Placeholder, PlaceholderProps } from "./Placeholder/Placeholder.js";
65
102
  import "./Placeholder/index.js";
66
103
  import { Portal, PortalProps } from "./Portal/Portal.js";
67
104
  import "./Portal/index.js";
68
105
  import { Progress, ProgressProps } from "./Progress/Progress.js";
69
106
  import "./Progress/index.js";
107
+ import { Prose, ProseProps } from "./Prose/Prose.js";
108
+ import "./Prose/index.js";
109
+ import { Quote, QuoteProps } from "./Quote/Quote.js";
110
+ import "./Quote/index.js";
70
111
  import { Radio, RadioGroup, RadioGroupProps, RadioProps } from "./Radio/Radio.js";
71
112
  import "./Radio/index.js";
113
+ import { Rail, RailGroup, RailGroupProps, RailLink, RailLinkProps, RailProps } from "./Rail/Rail.js";
114
+ import "./Rail/index.js";
72
115
  import { Range, RangeProps } from "./Range/Range.js";
73
116
  import "./Range/index.js";
74
117
  import { RATING_LABELS, Rating, RatingLabels, RatingProps } from "./Rating/Rating.js";
@@ -79,24 +122,32 @@ import { Score, ScoreProps } from "./Score/Score.js";
79
122
  import "./Score/index.js";
80
123
  import { SEARCH_LABELS, Search, SearchLabels, SearchProps } from "./Search/Search.js";
81
124
  import "./Search/index.js";
125
+ import { SECRETFIELD_LABELS, SecretField, SecretFieldLabels, SecretFieldProps } from "./SecretField/SecretField.js";
126
+ import "./SecretField/index.js";
82
127
  import { Segmented, SegmentedOption, SegmentedProps } from "./Segmented/Segmented.js";
83
128
  import "./Segmented/index.js";
84
129
  import { SETTINGS_LABELS, Settings, SettingsLabels, SettingsLanguage, SettingsProps } from "./Settings/Settings.js";
85
130
  import "./Settings/index.js";
86
- import { Sheet, SheetProps } from "./Sheet/Sheet.js";
131
+ import { Sheet, SheetOwnProps, SheetProps } from "./Sheet/Sheet.js";
87
132
  import "./Sheet/index.js";
88
133
  import { Shelf, ShelfProps } from "./Shelf/Shelf.js";
89
134
  import "./Shelf/index.js";
90
- import { Stage, StageProps } from "./Stage/Stage.js";
91
- import { Tile, TileProps } from "./Tile/Tile.js";
135
+ import { SKIPLINK_LABELS, SkipLink, SkipLinkLabels, SkipLinkProps } from "./SkipLink/SkipLink.js";
136
+ import "./SkipLink/index.js";
92
137
  import { STEPS_LABELS, StepItem, Steps, StepsLabels, StepsProps } from "./Steps/Steps.js";
93
- import { SUGGEST_LABELS, Suggest, SuggestLabels, SuggestOption, SuggestProps } from "./Suggest/Suggest.js";
94
138
  import { TABLE_LABELS, Table, TableColumn, TableLabels, TableProps, TableSort } from "./Table/Table.js";
139
+ import { TOAST_LABELS, ToastLabels, ToastOptions, ToastProvider, ToastProviderProps, useToast } from "./Toast/Toast.js";
140
+ import { LabelsInput, SlurpLabels, labelsEn, labelsIt } from "./lib/labels.js";
141
+ import { Stage, StageProps } from "./Stage/Stage.js";
142
+ import { Tile, TileProps } from "./Tile/Tile.js";
95
143
  import { Surface, SurfaceProps } from "./Surface/Surface.js";
96
144
  import { Swatch, SwatchGroup, SwatchGroupProps, SwatchOption, SwatchProps } from "./Swatch/Swatch.js";
97
145
  import { Switch, SwitchProps } from "./Switch/Switch.js";
98
146
  import { TabItem, Tabs, TabsProps } from "./Tabs/Tabs.js";
99
147
  import { Text, TextProps, TextTone } from "./Text/Text.js";
148
+ import { Tree, TreeItem, TreeProps } from "./Tree/Tree.js";
149
+ import { Timeline, TimelineItem, TimelineProps } from "./Timeline/Timeline.js";
150
+ import { Tag, TagProps } from "./Tag/Tag.js";
100
151
  import { AccentInput, ColorSchemeMode, ComponentsConfig, DEFAULT_STORAGE_KEY, MotionOptions, ResolvedColorScheme, Theme, ThemeOptions, TokenOverrides, createTheme } from "./lib/theme.js";
101
152
  import { SlurpProvider, SlurpProviderProps } from "./SlurpProvider/SlurpProvider.js";
102
153
  import { ColorSchemeScript, ColorSchemeScriptProps } from "./SlurpProvider/ColorSchemeScript.js";
@@ -110,10 +161,12 @@ import "./Swatch/index.js";
110
161
  import "./Switch/index.js";
111
162
  import "./Table/index.js";
112
163
  import "./Tabs/index.js";
164
+ import "./Tag/index.js";
113
165
  import "./Text/index.js";
114
166
  import "./Tile/index.js";
115
- import { TOAST_LABELS, ToastLabels, ToastOptions, ToastProvider, ToastProviderProps, useToast } from "./Toast/Toast.js";
167
+ import "./Timeline/index.js";
116
168
  import "./Toast/index.js";
169
+ import "./Tree/index.js";
117
170
  import { VisuallyHidden, VisuallyHiddenProps } from "./VisuallyHidden/VisuallyHidden.js";
118
171
  import "./VisuallyHidden/index.js";
119
172
  import { CONTRAST_MIN, alpha, contrast, meetsContrast, onColor, vivid } from "./lib/color.js";
@@ -129,5 +182,7 @@ import { useForkRef } from "./utils/useForkRef.js";
129
182
  import { COMPACT_QUERY, useMediaQuery } from "./utils/useMediaQuery.js";
130
183
  import { RovingFocusOptions, useRovingFocus } from "./utils/useRovingFocus.js";
131
184
  import { FindInPage, focusHit, useFindInPage } from "./utils/useFindInPage.js";
185
+ import { useClipboard } from "./utils/useClipboard.js";
186
+ import { useScrollSpy } from "./utils/useScrollSpy.js";
132
187
  import "./utils/index.js";
133
- export { type AccentInput, AccentScope, type AccentScopeProps, AnimationGroup, type AnimationGroupProps, type AnimationProps, type Appearance, Avatar, type AvatarProps, type BaseProps, Bento, type BentoItem, type BentoProps, type BentoSpan, Bloom, type BloomPlacement, type BloomProps, Bubble, type BubbleProps, Button, type ButtonProps, type ButtonTone, CAROUSEL_LABELS, CHOICE_LABELS, COMPACT_QUERY, CONTRAST_MIN, Card, type CardProps, Carousel, type CarouselLabels, type CarouselProps, Cell, type CellProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Choice, type ChoiceLabels, type ChoiceOption, type ChoiceProps, type ColorSchemeMode, ColorSchemeScript, type ColorSchemeScriptProps, type ColorSchemeState, type ColorValue, type ComponentsConfig, type ContentRef, type ControlSize, type ControlledOptions, Count, type CountProps, type CrumbEnd, DEFAULT_STORAGE_KEY, DIALOG_LABELS, DOCK_LABELS, Dialog, type DialogLabels, type DialogProps, type DismissOptions, Dock, type DockActionProps, type DockBackProps, type DockCrumbProps, type DockCrumbsProps, type DockLabels, type DockProps, type DockSearchProps, Empty, type EmptyProps, FILTERS_LABELS, FOCUSABLE, Fact, type FactProps, Field, type FieldProps, Filters, type FiltersGroupProps, type FiltersLabels, type FiltersProps, type FindInPage, Flow, type FlowProps, Fold, type FoldProps, Frame, type FrameProps, Ground, Hint, type HintProps, Link, type LinkProps, List, type ListProps, ListRow, type ListRowProps, Mark, type MarkProps, type MaybeResponsive, Menu, MenuItem, type MenuItemProps, type MenuProps, type MotionOptions, type MoveFocusOptions, NOTICE_LABELS, Notice, type NoticeLabels, type NoticeProps, PAGES_LABELS, type PageItem, Pages, type PagesLabels, type PagesProps, Placeholder, type PlaceholderProps, type PolymorphicProps, Portal, type PortalProps, Progress, type ProgressProps, RATING_LABELS, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RadiusValue, Range, type RangeProps, Rating, type RatingLabels, type RatingProps, type ResolvedColorScheme, type Responsive, ResultRow, type ResultRowProps, type RovingFocusOptions, SEARCH_LABELS, SETTINGS_LABELS, STEPS_LABELS, SUGGEST_LABELS, Score, type ScoreProps, Search, type SearchLabels, type SearchProps, Segmented, type SegmentedOption, type SegmentedProps, Settings, type SettingsLabels, type SettingsLanguage, type SettingsProps, Sheet, type SheetProps, Shelf, type ShelfProps, type SlurpControls, type SlurpCss, type SlurpEnterOptions, type SlurpNavigate, type SlurpNavigateOptions, SlurpProvider, type SlurpProviderProps, type SpaceValue, Stage, type StageProps, type StatusTone, type StepItem, Steps, type StepsLabels, type StepsProps, Suggest, type SuggestLabels, type SuggestOption, type SuggestProps, Surface, type SurfaceProps, Swatch, SwatchGroup, type SwatchGroupProps, type SwatchOption, type SwatchProps, Switch, type SwitchProps, TABLE_LABELS, TOAST_LABELS, type TabItem, Table, type TableColumn, type TableLabels, type TableProps, type TableSort, Tabs, type TabsProps, Text, type TextProps, type TextTone, type Theme, type ThemeOptions, Tile, type TileProps, type ToastLabels, type ToastOptions, ToastProvider, type ToastProviderProps, type TokenOverrides, VisuallyHidden, type VisuallyHiddenProps, alpha, bentoLayout, contrast, createTheme, crumbPath, focusFirst, focusHit, matchRanges, matchesAll, meetsContrast, moveFocus, normalizeText, onColor, pageItems, useAnimationTarget, useColorScheme, useControlled, useDismiss, useFindInPage, useForkRef, useMediaQuery, useRovingFocus, useSlurp, useSlurpEnter, useSlurpNavigate, useTheme, useToast, vivid };
188
+ export { AVATAR_GROUP_LABELS, type AccentInput, AccentScope, type AccentScopeProps, AnimationGroup, type AnimationGroupProps, type AnimationProps, type Appearance, Avatar, AvatarGroup, type AvatarGroupLabels, type AvatarGroupProps, type AvatarProps, type BaseProps, Bento, type BentoItem, type BentoProps, type BentoSpan, Bloom, type BloomPlacement, type BloomProps, Bubble, type BubbleProps, Button, type ButtonProps, type ButtonTone, CALENDAR_LABELS, CAROUSEL_LABELS, CHOICE_LABELS, CODE_LABELS, COMPACT_QUERY, COMPARE_LABELS, CONSENT_LABELS, CONTENTS_LABELS, CONTRAST_MIN, Calendar, type CalendarLabels, type CalendarProps, type CalendarValue, Card, type CardProps, Carousel, type CarouselLabels, type CarouselProps, Cell, type CellProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Choice, type ChoiceLabels, type ChoiceOption, type ChoiceProps, Code, type CodeLabels, type CodeProps, type ColorSchemeMode, ColorSchemeScript, type ColorSchemeScriptProps, type ColorSchemeState, type ColorValue, Compare, type CompareLabels, type CompareProps, type ComponentsConfig, Consent, type ConsentLabels, type ConsentProps, type ContentRef, Contents, type ContentsItem, type ContentsLabels, type ContentsProps, type ControlSize, type ControlledOptions, Count, type CountProps, type CrumbEnd, DATEFIELD_LABELS, DEFAULT_STORAGE_KEY, DIALOG_LABELS, DOCK_LABELS, DateField, type DateFieldLabels, type DateFieldProps, type DateRange, Dialog, type DialogLabels, type DialogProps, type DismissOptions, Dock, type DockActionProps, type DockBackProps, type DockCrumbProps, type DockCrumbsProps, type DockLabels, type DockProps, type DockSearchProps, ERRORSUMMARY_LABELS, Empty, type EmptyProps, ErrorSummary, type ErrorSummaryItem, type ErrorSummaryLabels, type ErrorSummaryProps, FILEDROP_LABELS, FILTERS_LABELS, FOCUSABLE, Fact, type FactProps, Field, type FieldProps, FileDrop, type FileDropLabels, type FileDropProps, Filters, type FiltersGroupProps, type FiltersLabels, type FiltersProps, type FindInPage, Flow, type FlowProps, Fold, type FoldProps, Footer, FooterBottom, FooterGroup, type FooterGroupProps, FooterLink, type FooterLinkProps, type FooterProps, Frame, type FrameProps, Ground, Hairline, type HairlineProps, Hint, type HintProps, Kbd, type KbdProps, LIGHTBOX_LABELS, type LabelsInput, Lightbox, type LightboxImage, type LightboxLabels, type LightboxProps, Link, type LinkProps, List, type ListProps, ListRow, type ListRowProps, MULTI_SUGGEST_LABELS, Mark, type MarkProps, type MaybeResponsive, Media, type MediaProps, Menu, MenuGroup, type MenuGroupProps, MenuItem, type MenuItemProps, type MenuProps, MenuSeparator, type MotionOptions, type MoveFocusOptions, MultiSuggest, type MultiSuggestLabels, type MultiSuggestProps, NOTICE_LABELS, NUMBERFIELD_LABELS, Notice, type NoticeLabels, type NoticeProps, NumberField, type NumberFieldLabels, type NumberFieldProps, PAGENAV_LABELS, PAGES_LABELS, type PageItem, PageNav, type PageNavLabels, type PageNavProps, type PageNavTarget, Pages, type PagesLabels, type PagesProps, PinField, type PinFieldProps, Placeholder, type PlaceholderProps, type PolymorphicProps, Portal, type PortalProps, Progress, type ProgressProps, Prose, type ProseProps, Quote, type QuoteProps, RATING_LABELS, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RadiusValue, Rail, RailGroup, type RailGroupProps, RailLink, type RailLinkProps, type RailProps, Range, type RangeProps, Rating, type RatingLabels, type RatingProps, type ResolvedColorScheme, type Responsive, ResultRow, type ResultRowProps, type RovingFocusOptions, SEARCH_LABELS, SECRETFIELD_LABELS, SETTINGS_LABELS, SKIPLINK_LABELS, STEPS_LABELS, SUGGEST_LABELS, Score, type ScoreProps, Search, type SearchLabels, type SearchProps, SecretField, type SecretFieldLabels, type SecretFieldProps, Segmented, type SegmentedOption, type SegmentedProps, Settings, type SettingsLabels, type SettingsLanguage, type SettingsProps, Sheet, type SheetOwnProps, type SheetProps, type SheetSide, Shelf, type ShelfProps, SkipLink, type SkipLinkLabels, type SkipLinkProps, type SlurpControls, type SlurpCss, type SlurpEnterOptions, type SlurpLabels, type SlurpNavigate, type SlurpNavigateOptions, SlurpProvider, type SlurpProviderProps, type SpaceValue, Stage, type StageProps, type StatusTone, type StepItem, Steps, type StepsLabels, type StepsProps, Suggest, type SuggestLabels, type SuggestOption, type SuggestProps, Surface, type SurfaceProps, Swatch, SwatchGroup, type SwatchGroupProps, type SwatchOption, type SwatchProps, Switch, type SwitchProps, TABLE_LABELS, TOAST_LABELS, type TabItem, Table, type TableColumn, type TableLabels, type TableProps, type TableSort, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, type TextTone, type Theme, type ThemeOptions, Tile, type TileProps, Timeline, type TimelineItem, type TimelineProps, type ToastLabels, type ToastOptions, ToastProvider, type ToastProviderProps, type TokenOverrides, Tree, type TreeItem, type TreeProps, VisuallyHidden, type VisuallyHiddenProps, alpha, bentoLayout, contrast, createTheme, crumbPath, focusFirst, focusHit, labelsEn, labelsIt, matchRanges, matchesAll, meetsContrast, moveFocus, normalizeText, onColor, pageItems, useAnimationTarget, useClipboard, useColorScheme, useControlled, useDismiss, useFindInPage, useForkRef, useMediaQuery, useRovingFocus, useScrollSpy, useSlurp, useSlurpEnter, useSlurpNavigate, useTheme, useToast, vivid };
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { CONTRAST_MIN, alpha, contrast, meetsContrast, onColor, vivid } from "./lib/color.js";
3
3
  import { DEFAULT_STORAGE_KEY, createTheme } from "./lib/theme.js";
4
4
  import { useColorScheme, useTheme } from "./internal/context.js";
5
+ import { labelsEn, labelsIt } from "./lib/labels.js";
5
6
  import { SlurpProvider } from "./SlurpProvider/SlurpProvider.js";
6
7
  import { ColorSchemeScript } from "./SlurpProvider/ColorSchemeScript.js";
7
8
  import { AnimationGroup } from "./motion/AnimationGroup.js";
@@ -43,7 +44,7 @@ import { CHOICE_LABELS, Choice } from "./Choice/Choice.js";
43
44
  import { Tabs } from "./Tabs/Tabs.js";
44
45
  import { Fold } from "./Fold/Fold.js";
45
46
  import { Hint } from "./Hint/Hint.js";
46
- import { Menu, MenuItem } from "./Menu/Menu.js";
47
+ import { Menu, MenuGroup, MenuItem, MenuSeparator } from "./Menu/Menu.js";
47
48
  import { DIALOG_LABELS, Dialog } from "./Dialog/Dialog.js";
48
49
  import { Sheet } from "./Sheet/Sheet.js";
49
50
  import { TOAST_LABELS, ToastProvider, useToast } from "./Toast/Toast.js";
@@ -60,6 +61,34 @@ import { ResultRow } from "./ResultRow/ResultRow.js";
60
61
  import { Mark } from "./Mark/Mark.js";
61
62
  import { Empty } from "./Empty/Empty.js";
62
63
  import { Link } from "./Link/Link.js";
64
+ import { LIGHTBOX_LABELS, Lightbox } from "./Lightbox/Lightbox.js";
65
+ import { COMPARE_LABELS, Compare } from "./Compare/Compare.js";
66
+ import { Tree } from "./Tree/Tree.js";
67
+ import { CONSENT_LABELS, Consent } from "./Consent/Consent.js";
68
+ import { Timeline } from "./Timeline/Timeline.js";
69
+ import { AVATAR_GROUP_LABELS, AvatarGroup } from "./AvatarGroup/AvatarGroup.js";
70
+ import { MULTI_SUGGEST_LABELS, MultiSuggest } from "./MultiSuggest/MultiSuggest.js";
71
+ import { CALENDAR_LABELS, Calendar } from "./Calendar/Calendar.js";
72
+ import { DATEFIELD_LABELS, DateField } from "./DateField/DateField.js";
73
+ import { FILEDROP_LABELS, FileDrop } from "./FileDrop/FileDrop.js";
74
+ import { ERRORSUMMARY_LABELS, ErrorSummary } from "./ErrorSummary/ErrorSummary.js";
75
+ import { PinField } from "./PinField/PinField.js";
76
+ import { NUMBERFIELD_LABELS, NumberField } from "./NumberField/NumberField.js";
77
+ import { SECRETFIELD_LABELS, SecretField } from "./SecretField/SecretField.js";
78
+ import { Footer, FooterBottom, FooterGroup, FooterLink } from "./Footer/Footer.js";
79
+ import { Media } from "./Media/Media.js";
80
+ import { Quote } from "./Quote/Quote.js";
81
+ import { Kbd } from "./Kbd/Kbd.js";
82
+ import { Tag } from "./Tag/Tag.js";
83
+ import { Hairline } from "./Hairline/Hairline.js";
84
+ import { SKIPLINK_LABELS, SkipLink } from "./SkipLink/SkipLink.js";
85
+ import { Prose } from "./Prose/Prose.js";
86
+ import { useClipboard } from "./utils/useClipboard.js";
87
+ import { CODE_LABELS, Code } from "./Code/Code.js";
88
+ import { useScrollSpy } from "./utils/useScrollSpy.js";
89
+ import { CONTENTS_LABELS, Contents } from "./Contents/Contents.js";
90
+ import { Rail, RailGroup, RailLink } from "./Rail/Rail.js";
91
+ import { PAGENAV_LABELS, PageNav } from "./PageNav/PageNav.js";
63
92
  import { crumbPath } from "./lib/crumb.js";
64
93
  import { COMPACT_QUERY, useMediaQuery } from "./utils/useMediaQuery.js";
65
94
  import { DOCK_LABELS, Dock } from "./Dock/Dock.js";
@@ -72,4 +101,4 @@ import { RATING_LABELS, Rating } from "./Rating/Rating.js";
72
101
  import { TABLE_LABELS, Table } from "./Table/Table.js";
73
102
  import { CAROUSEL_LABELS, Carousel } from "./Carousel/Carousel.js";
74
103
  import { focusHit, useFindInPage } from "./utils/useFindInPage.js";
75
- export { AccentScope, AnimationGroup, Avatar, Bento, Bloom, Bubble, Button, CAROUSEL_LABELS, CHOICE_LABELS, COMPACT_QUERY, CONTRAST_MIN, Card, Carousel, Cell, Checkbox, Chip, Choice, ColorSchemeScript, Count, DEFAULT_STORAGE_KEY, DIALOG_LABELS, DOCK_LABELS, Dialog, Dock, Empty, FILTERS_LABELS, FOCUSABLE, Fact, Field, Filters, Flow, Fold, Frame, Ground, Hint, Link, List, ListRow, Mark, Menu, MenuItem, NOTICE_LABELS, Notice, PAGES_LABELS, Pages, Placeholder, Portal, Progress, RATING_LABELS, Radio, RadioGroup, Range, Rating, ResultRow, SEARCH_LABELS, SETTINGS_LABELS, STEPS_LABELS, SUGGEST_LABELS, Score, Search, Segmented, Settings, Sheet, Shelf, SlurpProvider, Stage, Steps, Suggest, Surface, Swatch, SwatchGroup, Switch, TABLE_LABELS, TOAST_LABELS, Table, Tabs, Text, Tile, ToastProvider, VisuallyHidden, alpha, bentoLayout, contrast, createTheme, crumbPath, focusFirst, focusHit, matchRanges, matchesAll, meetsContrast, moveFocus, normalizeText, onColor, pageItems, useAnimationTarget, useColorScheme, useControlled, useDismiss, useFindInPage, useForkRef, useMediaQuery, useRovingFocus, useSlurp, useSlurpEnter, useSlurpNavigate, useTheme, useToast, vivid };
104
+ export { AVATAR_GROUP_LABELS, AccentScope, AnimationGroup, Avatar, AvatarGroup, Bento, Bloom, Bubble, Button, CALENDAR_LABELS, CAROUSEL_LABELS, CHOICE_LABELS, CODE_LABELS, COMPACT_QUERY, COMPARE_LABELS, CONSENT_LABELS, CONTENTS_LABELS, CONTRAST_MIN, Calendar, Card, Carousel, Cell, Checkbox, Chip, Choice, Code, ColorSchemeScript, Compare, Consent, Contents, Count, DATEFIELD_LABELS, DEFAULT_STORAGE_KEY, DIALOG_LABELS, DOCK_LABELS, DateField, Dialog, Dock, ERRORSUMMARY_LABELS, Empty, ErrorSummary, FILEDROP_LABELS, FILTERS_LABELS, FOCUSABLE, Fact, Field, FileDrop, Filters, Flow, Fold, Footer, FooterBottom, FooterGroup, FooterLink, Frame, Ground, Hairline, Hint, Kbd, LIGHTBOX_LABELS, Lightbox, Link, List, ListRow, MULTI_SUGGEST_LABELS, Mark, Media, Menu, MenuGroup, MenuItem, MenuSeparator, MultiSuggest, NOTICE_LABELS, NUMBERFIELD_LABELS, Notice, NumberField, PAGENAV_LABELS, PAGES_LABELS, PageNav, Pages, PinField, Placeholder, Portal, Progress, Prose, Quote, RATING_LABELS, Radio, RadioGroup, Rail, RailGroup, RailLink, Range, Rating, ResultRow, SEARCH_LABELS, SECRETFIELD_LABELS, SETTINGS_LABELS, SKIPLINK_LABELS, STEPS_LABELS, SUGGEST_LABELS, Score, Search, SecretField, Segmented, Settings, Sheet, Shelf, SkipLink, SlurpProvider, Stage, Steps, Suggest, Surface, Swatch, SwatchGroup, Switch, TABLE_LABELS, TOAST_LABELS, Table, Tabs, Tag, Text, Tile, Timeline, ToastProvider, Tree, VisuallyHidden, alpha, bentoLayout, contrast, createTheme, crumbPath, focusFirst, focusHit, labelsEn, labelsIt, matchRanges, matchesAll, meetsContrast, moveFocus, normalizeText, onColor, pageItems, useAnimationTarget, useClipboard, useColorScheme, useControlled, useDismiss, useFindInPage, useForkRef, useMediaQuery, useRovingFocus, useScrollSpy, useSlurp, useSlurpEnter, useSlurpNavigate, useTheme, useToast, vivid };
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { createContext, useContext } from "react";
3
+ // src/internal/labels.ts
4
+ /** Texts set by the nearest SlurpProvider with `labels` (none: the components' Italian defaults). */
5
+ const LabelsContext = createContext({});
6
+ /** This component's texts from the provider; spread between its defaults and its own `labels` prop. */
7
+ function useLabels(name) {
8
+ return useContext(LabelsContext)[name] ?? {};
9
+ }
10
+ export { LabelsContext, useLabels };
11
+
12
+ //# sourceMappingURL=labels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labels.js","names":[],"sources":["../../src/internal/labels.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nimport type { SlurpLabels } from '../lib/labels';\n\n/** Texts set by the nearest SlurpProvider with `labels` (none: the components' Italian defaults). */\nexport const LabelsContext = createContext<SlurpLabels>({});\n\n/** This component's texts from the provider; spread between its defaults and its own `labels` prop. */\nexport function useLabels<K extends keyof SlurpLabels>(name: K): NonNullable<SlurpLabels[K]> {\n return (useContext(LabelsContext)[name] ?? {}) as NonNullable<SlurpLabels[K]>;\n}\n"],"mappings":";;;;AAKA,MAAa,gBAAgB,cAA2B,CAAC,CAAC;;AAG1D,SAAgB,UAAuC,MAAsC;CAC3F,OAAQ,WAAW,aAAa,CAAC,CAAC,SAAS,CAAC;AAC9C"}
@@ -0,0 +1,210 @@
1
+
2
+ import { AvatarGroupLabels } from "../AvatarGroup/AvatarGroup.js";
3
+ import { CalendarLabels } from "../Calendar/Calendar.js";
4
+ import { CarouselLabels } from "../Carousel/Carousel.js";
5
+ import { ChoiceLabels } from "../Choice/Choice.js";
6
+ import { CodeLabels } from "../Code/Code.js";
7
+ import { CompareLabels } from "../Compare/Compare.js";
8
+ import { ConsentLabels } from "../Consent/Consent.js";
9
+ import { ContentsLabels } from "../Contents/Contents.js";
10
+ import { DateFieldLabels } from "../DateField/DateField.js";
11
+ import { DialogLabels } from "../Dialog/Dialog.js";
12
+ import { DockLabels } from "../Dock/Dock.js";
13
+ import { ErrorSummaryLabels } from "../ErrorSummary/ErrorSummary.js";
14
+ import { FileDropLabels } from "../FileDrop/FileDrop.js";
15
+ import { FiltersLabels } from "../Filters/Filters.js";
16
+ import { LightboxLabels } from "../Lightbox/Lightbox.js";
17
+ import { SuggestLabels } from "../Suggest/Suggest.js";
18
+ import { MultiSuggestLabels } from "../MultiSuggest/MultiSuggest.js";
19
+ import { NoticeLabels } from "../Notice/Notice.js";
20
+ import { NumberFieldLabels } from "../NumberField/NumberField.js";
21
+ import { PageNavLabels } from "../PageNav/PageNav.js";
22
+ import { PagesLabels } from "../Pages/Pages.js";
23
+ import { RatingLabels } from "../Rating/Rating.js";
24
+ import { SearchLabels } from "../Search/Search.js";
25
+ import { SecretFieldLabels } from "../SecretField/SecretField.js";
26
+ import { SettingsLabels } from "../Settings/Settings.js";
27
+ import { SkipLinkLabels } from "../SkipLink/SkipLink.js";
28
+ import { StepsLabels } from "../Steps/Steps.js";
29
+ import { TableLabels } from "../Table/Table.js";
30
+ import { ToastLabels } from "../Toast/Toast.js";
31
+ /** The texts of every component that has some, by component. Dialog's also apply to Sheet. */
32
+ export interface SlurpLabels {
33
+ SecretField?: Partial<SecretFieldLabels>;
34
+ NumberField?: Partial<NumberFieldLabels>;
35
+ FileDrop?: Partial<FileDropLabels>;
36
+ ErrorSummary?: Partial<ErrorSummaryLabels>;
37
+ DateField?: Partial<DateFieldLabels>;
38
+ Calendar?: Partial<CalendarLabels>;
39
+ Carousel?: Partial<CarouselLabels>;
40
+ Choice?: Partial<ChoiceLabels>;
41
+ Code?: Partial<CodeLabels>;
42
+ Contents?: Partial<ContentsLabels>;
43
+ Dialog?: Partial<DialogLabels>;
44
+ Dock?: Partial<DockLabels>;
45
+ Filters?: Partial<FiltersLabels>;
46
+ Notice?: Partial<NoticeLabels>;
47
+ PageNav?: Partial<PageNavLabels>;
48
+ Pages?: Partial<PagesLabels>;
49
+ Rating?: Partial<RatingLabels>;
50
+ Search?: Partial<SearchLabels>;
51
+ Settings?: Partial<SettingsLabels>;
52
+ SkipLink?: Partial<SkipLinkLabels>;
53
+ Steps?: Partial<StepsLabels>;
54
+ AvatarGroup?: Partial<AvatarGroupLabels>;
55
+ Compare?: Partial<CompareLabels>;
56
+ Consent?: Partial<ConsentLabels>;
57
+ Lightbox?: Partial<LightboxLabels>;
58
+ MultiSuggest?: Partial<MultiSuggestLabels>;
59
+ Suggest?: Partial<SuggestLabels>;
60
+ Table?: Partial<TableLabels>;
61
+ Toast?: Partial<ToastLabels>;
62
+ }
63
+ /** A built-in language (a plain string, so a server component can pass it) or your own texts. */
64
+ export type LabelsInput = 'it' | 'en' | SlurpLabels;
65
+ /** English texts for every component. Italian is the components' own default. */
66
+ export declare const labelsEn: {
67
+ Calendar: {
68
+ previous: string;
69
+ next: string;
70
+ };
71
+ DateField: {
72
+ placeholder: string;
73
+ };
74
+ ErrorSummary: {
75
+ title: (n: number) => string;
76
+ };
77
+ FileDrop: {
78
+ browse: string;
79
+ drop: string;
80
+ remove: (name: string) => string;
81
+ };
82
+ NumberField: {
83
+ decrement: string;
84
+ increment: string;
85
+ };
86
+ SecretField: {
87
+ show: string;
88
+ };
89
+ Carousel: {
90
+ previous: string;
91
+ next: string;
92
+ slide: (i: number, n: number) => string;
93
+ show: (i: number, n: number) => string;
94
+ picker: string;
95
+ };
96
+ Choice: {
97
+ placeholder: string;
98
+ };
99
+ Code: {
100
+ copy: string;
101
+ copied: string;
102
+ region: string;
103
+ };
104
+ Contents: {
105
+ title: string;
106
+ };
107
+ Dialog: {
108
+ close: string;
109
+ };
110
+ Dock: {
111
+ navigation: string;
112
+ crumbs: string;
113
+ back: string;
114
+ search: string;
115
+ searchPlaceholder: string;
116
+ noResults: string;
117
+ matches: (i: number, n: number) => string;
118
+ nextMatch: (i: number, n: number) => string;
119
+ resultsHint: string;
120
+ };
121
+ Filters: {
122
+ title: string;
123
+ reset: string;
124
+ };
125
+ Notice: {
126
+ neutral: string;
127
+ success: string;
128
+ warning: string;
129
+ danger: string;
130
+ dismiss: string;
131
+ };
132
+ PageNav: {
133
+ label: string;
134
+ previous: string;
135
+ next: string;
136
+ };
137
+ Pages: {
138
+ label: string;
139
+ previous: string;
140
+ next: string;
141
+ page: (n: number) => string;
142
+ status: (n: number, count: number) => string;
143
+ };
144
+ Rating: {
145
+ value: (v: string, max: number) => string;
146
+ star: (n: number) => string;
147
+ };
148
+ Search: {
149
+ label: string;
150
+ placeholder: string;
151
+ clear: string;
152
+ results: (n: number) => string;
153
+ };
154
+ Settings: {
155
+ open: string;
156
+ close: string;
157
+ title: string;
158
+ theme: string;
159
+ system: string;
160
+ light: string;
161
+ dark: string;
162
+ language: string;
163
+ };
164
+ SkipLink: {
165
+ label: string;
166
+ };
167
+ Steps: {
168
+ label: string;
169
+ done: string;
170
+ };
171
+ AvatarGroup: {
172
+ more: (n: number) => string;
173
+ };
174
+ Compare: {
175
+ handle: string;
176
+ };
177
+ Lightbox: {
178
+ previous: string;
179
+ next: string;
180
+ position: (i: number, n: number) => string;
181
+ };
182
+ Consent: {
183
+ region: string;
184
+ accept: string;
185
+ reject: string;
186
+ customize: string;
187
+ };
188
+ MultiSuggest: {
189
+ results: (n: number) => string;
190
+ empty: string;
191
+ remove: (label: string) => string;
192
+ chosen: string;
193
+ };
194
+ Suggest: {
195
+ results: (n: number) => string;
196
+ empty: string;
197
+ };
198
+ Table: {
199
+ empty: string;
200
+ selectAll: string;
201
+ selectRow: string;
202
+ };
203
+ Toast: {
204
+ region: string;
205
+ dismiss: string;
206
+ };
207
+ };
208
+ /** Italian, the components' own defaults: nothing to swap. */
209
+ export declare const labelsIt: SlurpLabels;
210
+ //# sourceMappingURL=labels.d.ts.map
@@ -0,0 +1,139 @@
1
+
2
+ // src/lib/labels.ts
3
+ /** English texts for every component. Italian is the components' own default. */
4
+ const labelsEn = {
5
+ Calendar: {
6
+ previous: "Previous month",
7
+ next: "Next month"
8
+ },
9
+ DateField: { placeholder: "Pick a date" },
10
+ ErrorSummary: { title: (n) => n === 1 ? "There is 1 error to fix" : `There are ${n} errors to fix` },
11
+ FileDrop: {
12
+ browse: "Choose files",
13
+ drop: "or drop them here",
14
+ remove: (name) => `Remove ${name}`
15
+ },
16
+ NumberField: {
17
+ decrement: "Decrease",
18
+ increment: "Increase"
19
+ },
20
+ SecretField: { show: "Show the password" },
21
+ Carousel: {
22
+ previous: "Previous",
23
+ next: "Next",
24
+ slide: (i, n) => `${i} of ${n}`,
25
+ show: (i, n) => `Show ${i} of ${n}`,
26
+ picker: "Choose what to show"
27
+ },
28
+ Choice: { placeholder: "Choose…" },
29
+ Code: {
30
+ copy: "Copy the code",
31
+ copied: "Copied",
32
+ region: "Code"
33
+ },
34
+ Contents: { title: "On this page" },
35
+ Dialog: { close: "Close" },
36
+ Dock: {
37
+ navigation: "Navigation",
38
+ crumbs: "Path",
39
+ back: "Back",
40
+ search: "Search",
41
+ searchPlaceholder: "Search…",
42
+ noResults: "No results",
43
+ matches: (i, n) => `${n === 1 ? "1 match" : `${n} matches`}, ${i} of ${n}`,
44
+ nextMatch: (i, n) => `Go to the next match: ${i} of ${n}`,
45
+ resultsHint: "Arrow down to browse the results, Escape to close them."
46
+ },
47
+ Filters: {
48
+ title: "Filters",
49
+ reset: "Reset filters"
50
+ },
51
+ Notice: {
52
+ neutral: "Note",
53
+ success: "Done",
54
+ warning: "Warning",
55
+ danger: "Error",
56
+ dismiss: "Dismiss notice"
57
+ },
58
+ PageNav: {
59
+ label: "Previous and next page",
60
+ previous: "Previous",
61
+ next: "Next"
62
+ },
63
+ Pages: {
64
+ label: "Pages",
65
+ previous: "Previous page",
66
+ next: "Next page",
67
+ page: (n) => `Page ${n}`,
68
+ status: (n, count) => `${n} of ${count}`
69
+ },
70
+ Rating: {
71
+ value: (v, max) => `${v} out of ${max}`,
72
+ star: (n) => n === 1 ? "1 star" : `${n} stars`
73
+ },
74
+ Search: {
75
+ label: "Search",
76
+ placeholder: "Search…",
77
+ clear: "Clear the search",
78
+ results: (n) => n === 0 ? "No results" : n === 1 ? "1 result" : `${n} results`
79
+ },
80
+ Settings: {
81
+ open: "Settings",
82
+ close: "Close settings",
83
+ title: "Settings",
84
+ theme: "Theme",
85
+ system: "Automatic",
86
+ light: "Light",
87
+ dark: "Dark",
88
+ language: "Language"
89
+ },
90
+ SkipLink: { label: "Skip to content" },
91
+ Steps: {
92
+ label: "Steps",
93
+ done: "completed"
94
+ },
95
+ AvatarGroup: { more: (n) => n === 1 ? "one more person" : `${n} more people` },
96
+ Compare: { handle: "Compare before and after" },
97
+ Lightbox: {
98
+ previous: "Previous image",
99
+ next: "Next image",
100
+ position: (i, n) => `${i} of ${n}`
101
+ },
102
+ Consent: {
103
+ region: "Cookie preferences",
104
+ accept: "Accept",
105
+ reject: "Reject",
106
+ customize: "Customise"
107
+ },
108
+ MultiSuggest: {
109
+ results: (n) => n === 1 ? "1 suggestion" : `${n} suggestions`,
110
+ empty: "No suggestions",
111
+ remove: (label) => `Remove ${label}`,
112
+ chosen: "Chosen"
113
+ },
114
+ Suggest: {
115
+ results: (n) => n === 1 ? "1 suggestion" : `${n} suggestions`,
116
+ empty: "No suggestions"
117
+ },
118
+ Table: {
119
+ empty: "No items",
120
+ selectAll: "Select all rows",
121
+ selectRow: "Select row"
122
+ },
123
+ Toast: {
124
+ region: "Notifications",
125
+ dismiss: "Dismiss notification"
126
+ }
127
+ };
128
+ /** Italian, the components' own defaults: nothing to swap. */
129
+ const labelsIt = {};
130
+ /** Resolves a provider's `labels` prop to texts by component. */
131
+ function resolveLabels(input) {
132
+ if (input === void 0) return void 0;
133
+ if (input === "en") return labelsEn;
134
+ if (input === "it") return labelsIt;
135
+ return input;
136
+ }
137
+ export { labelsEn, labelsIt, resolveLabels };
138
+
139
+ //# sourceMappingURL=labels.js.map