@humanonlyweb/ui 0.0.0-stage → 0.2.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 (168) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -2
  3. package/dist/components/accordion/Accordion.js +60 -0
  4. package/dist/components/accordion/Accordion.vue.d.ts +28 -0
  5. package/dist/components/accordion/AccordionItem.js +102 -0
  6. package/dist/components/accordion/AccordionItem.vue.d.ts +33 -0
  7. package/dist/components/avatar/Avatar.js +52 -0
  8. package/dist/components/avatar/Avatar.vue.d.ts +26 -0
  9. package/dist/components/avatar/AvatarGroup.js +48 -0
  10. package/dist/components/avatar/AvatarGroup.vue.d.ts +16 -0
  11. package/dist/components/breadcrumbs/Breadcrumbs.js +59 -0
  12. package/dist/components/breadcrumbs/Breadcrumbs.vue.d.ts +14 -0
  13. package/dist/components/button/Button.js +95 -0
  14. package/dist/components/button/Button.vue.d.ts +74 -0
  15. package/dist/components/button/IconButton.js +47 -0
  16. package/dist/components/button/IconButton.vue.d.ts +115 -0
  17. package/dist/components/checkbox/Checkbox.js +93 -0
  18. package/dist/components/checkbox/Checkbox.vue.d.ts +43 -0
  19. package/dist/components/checkbox-group/CheckboxGroup.js +89 -0
  20. package/dist/components/checkbox-group/CheckboxGroup.vue.d.ts +43 -0
  21. package/dist/components/combobox/Combobox.js +294 -0
  22. package/dist/components/combobox/Combobox.vue.d.ts +80 -0
  23. package/dist/components/context-menu/ContextMenu.js +170 -0
  24. package/dist/components/context-menu/ContextMenu.vue.d.ts +38 -0
  25. package/dist/components/dialog/ConfirmDialog.js +103 -0
  26. package/dist/components/dialog/ConfirmDialog.vue.d.ts +46 -0
  27. package/dist/components/dialog/Dialog.js +160 -0
  28. package/dist/components/dialog/Dialog.vue.d.ts +54 -0
  29. package/dist/components/field/FieldMessage.js +31 -0
  30. package/dist/components/fieldset/Fieldset.js +59 -0
  31. package/dist/components/fieldset/Fieldset.vue.d.ts +29 -0
  32. package/dist/components/input/Input.js +111 -0
  33. package/dist/components/input/Input.vue.d.ts +50 -0
  34. package/dist/components/kbd/Kbd.js +48 -0
  35. package/dist/components/kbd/Kbd.vue.d.ts +24 -0
  36. package/dist/components/menu/Menu.js +124 -0
  37. package/dist/components/menu/Menu.vue.d.ts +41 -0
  38. package/dist/components/otp-input/OtpInput.js +179 -0
  39. package/dist/components/otp-input/OtpInput.vue.d.ts +48 -0
  40. package/dist/components/pagination/Pagination.js +128 -0
  41. package/dist/components/pagination/Pagination.vue.d.ts +24 -0
  42. package/dist/components/password-input/PasswordInput.js +151 -0
  43. package/dist/components/password-input/PasswordInput.vue.d.ts +32 -0
  44. package/dist/components/popover/Popover.js +83 -0
  45. package/dist/components/popover/Popover.vue.d.ts +37 -0
  46. package/dist/components/progress/Progress.js +52 -0
  47. package/dist/components/progress/Progress.vue.d.ts +17 -0
  48. package/dist/components/radio-group/RadioGroup.js +125 -0
  49. package/dist/components/radio-group/RadioGroup.vue.d.ts +45 -0
  50. package/dist/components/segmented/Segmented.js +110 -0
  51. package/dist/components/segmented/Segmented.vue.d.ts +41 -0
  52. package/dist/components/select/Select.js +231 -0
  53. package/dist/components/select/Select.vue.d.ts +59 -0
  54. package/dist/components/slider/Slider.js +196 -0
  55. package/dist/components/slider/Slider.vue.d.ts +49 -0
  56. package/dist/components/spin-button/SpinButton.js +231 -0
  57. package/dist/components/spin-button/SpinButton.vue.d.ts +48 -0
  58. package/dist/components/split-button/SplitButton.js +69 -0
  59. package/dist/components/split-button/SplitButton.vue.d.ts +38 -0
  60. package/dist/components/switch/Switch.js +95 -0
  61. package/dist/components/switch/Switch.vue.d.ts +42 -0
  62. package/dist/components/table/Table.js +173 -0
  63. package/dist/components/table/Table.vue.d.ts +45 -0
  64. package/dist/components/tabs/Tabs.js +103 -0
  65. package/dist/components/tabs/Tabs.vue.d.ts +39 -0
  66. package/dist/components/tag-input/TagInput.js +186 -0
  67. package/dist/components/tag-input/TagInput.vue.d.ts +36 -0
  68. package/dist/components/textarea/Textarea.js +118 -0
  69. package/dist/components/textarea/Textarea.vue.d.ts +34 -0
  70. package/dist/components/toast/ToastItem.js +91 -0
  71. package/dist/components/toast/ToastItem.vue.d.ts +29 -0
  72. package/dist/components/toast/ToastViewport.js +56 -0
  73. package/dist/components/toast/ToastViewport.vue.d.ts +25 -0
  74. package/dist/components/toolbar/Toolbar.js +91 -0
  75. package/dist/components/toolbar/Toolbar.vue.d.ts +21 -0
  76. package/dist/components/tooltip/Tooltip.js +85 -0
  77. package/dist/components/tooltip/Tooltip.vue.d.ts +25 -0
  78. package/dist/components/visually-hidden/VisuallyHidden.js +16 -0
  79. package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +19 -0
  80. package/dist/composables/internal/env.js +5 -0
  81. package/dist/composables/internal/is-equal.js +14 -0
  82. package/dist/composables/internal/on-click-outside.js +18 -0
  83. package/dist/composables/internal/standard-schema.d.ts +38 -0
  84. package/dist/composables/internal/use-document-visibility.js +16 -0
  85. package/dist/composables/internal/use-event-listener.js +24 -0
  86. package/dist/composables/internal/use-interval-fn.js +21 -0
  87. package/dist/composables/internal/use-resize-observer.js +21 -0
  88. package/dist/composables/internal/use-timeout-fn.js +25 -0
  89. package/dist/composables/use-accordion.d.ts +9 -0
  90. package/dist/composables/use-accordion.js +10 -0
  91. package/dist/composables/use-combobox.d.ts +44 -0
  92. package/dist/composables/use-combobox.js +185 -0
  93. package/dist/composables/use-field.d.ts +17 -0
  94. package/dist/composables/use-field.js +27 -0
  95. package/dist/composables/use-form.d.ts +44 -0
  96. package/dist/composables/use-form.js +146 -0
  97. package/dist/composables/use-menu.d.ts +26 -0
  98. package/dist/composables/use-menu.js +117 -0
  99. package/dist/composables/use-platform.d.ts +17 -0
  100. package/dist/composables/use-platform.js +126 -0
  101. package/dist/composables/use-popover.d.ts +35 -0
  102. package/dist/composables/use-popover.js +49 -0
  103. package/dist/composables/use-roving-selection.d.ts +22 -0
  104. package/dist/composables/use-roving-selection.js +65 -0
  105. package/dist/composables/use-select.d.ts +31 -0
  106. package/dist/composables/use-select.js +169 -0
  107. package/dist/composables/use-slide-indicator.d.ts +24 -0
  108. package/dist/composables/use-slide-indicator.js +52 -0
  109. package/dist/composables/use-toast.d.ts +23 -0
  110. package/dist/composables/use-toast.js +51 -0
  111. package/dist/config.d.ts +40 -0
  112. package/dist/config.js +35 -0
  113. package/dist/docs/README.md +52 -0
  114. package/dist/docs/changelog.md +21 -0
  115. package/dist/docs/components/accordion.md +100 -0
  116. package/dist/docs/components/avatar-group.md +58 -0
  117. package/dist/docs/components/avatar.md +40 -0
  118. package/dist/docs/components/breadcrumbs.md +81 -0
  119. package/dist/docs/components/button.md +109 -0
  120. package/dist/docs/components/checkbox-group.md +118 -0
  121. package/dist/docs/components/checkbox.md +123 -0
  122. package/dist/docs/components/combobox.md +207 -0
  123. package/dist/docs/components/confirm-dialog.md +107 -0
  124. package/dist/docs/components/context-menu.md +98 -0
  125. package/dist/docs/components/dialog.md +127 -0
  126. package/dist/docs/components/fieldset.md +65 -0
  127. package/dist/docs/components/icon-button.md +47 -0
  128. package/dist/docs/components/input.md +89 -0
  129. package/dist/docs/components/kbd.md +41 -0
  130. package/dist/docs/components/menu.md +112 -0
  131. package/dist/docs/components/otp-input.md +92 -0
  132. package/dist/docs/components/pagination.md +62 -0
  133. package/dist/docs/components/password-input.md +55 -0
  134. package/dist/docs/components/popover.md +72 -0
  135. package/dist/docs/components/progress.md +56 -0
  136. package/dist/docs/components/radio-group.md +114 -0
  137. package/dist/docs/components/segmented.md +96 -0
  138. package/dist/docs/components/select.md +129 -0
  139. package/dist/docs/components/slider.md +105 -0
  140. package/dist/docs/components/spin-button.md +73 -0
  141. package/dist/docs/components/split-button.md +64 -0
  142. package/dist/docs/components/switch.md +71 -0
  143. package/dist/docs/components/table.md +241 -0
  144. package/dist/docs/components/tabs.md +106 -0
  145. package/dist/docs/components/tag-input.md +88 -0
  146. package/dist/docs/components/textarea.md +46 -0
  147. package/dist/docs/components/toast.md +135 -0
  148. package/dist/docs/components/toolbar.md +71 -0
  149. package/dist/docs/components/tooltip.md +57 -0
  150. package/dist/docs/components/visually-hidden.md +53 -0
  151. package/dist/docs/forms.md +182 -0
  152. package/dist/docs/index.md +11 -0
  153. package/dist/docs/installation.md +71 -0
  154. package/dist/docs/localisation.md +42 -0
  155. package/dist/docs/ssr.md +24 -0
  156. package/dist/docs/styling.md +82 -0
  157. package/dist/index.d.ts +60 -0
  158. package/dist/index.js +56 -0
  159. package/dist/nuxt/module.d.ts +15 -0
  160. package/dist/nuxt/module.js +80 -0
  161. package/dist/nuxt/runtime/plugin.d.ts +4 -0
  162. package/dist/nuxt/runtime/plugin.js +24 -0
  163. package/dist/package.js +4 -0
  164. package/dist/styles/core.css +310 -0
  165. package/dist/translations.d.ts +85 -0
  166. package/dist/translations.js +62 -0
  167. package/dist/types.d.ts +69 -0
  168. package/package.json +93 -4
@@ -0,0 +1,82 @@
1
+ # Styling
2
+
3
+ > Style the data-part hooks with your own CSS.
4
+
5
+ Style the components with your own CSS. Every element has a `data-part` attribute and states are attributes too; each component page lists them.
6
+
7
+ ```css
8
+ [data-part="select-trigger"] {
9
+ border: 1px solid var(--border);
10
+ border-radius: 8px;
11
+
12
+ &[data-select-open] {
13
+ border-color: var(--accent);
14
+ }
15
+ }
16
+
17
+ [data-part="select-option"][data-select-active] {
18
+ background: var(--surface-3);
19
+ }
20
+ ```
21
+
22
+ ## Fields
23
+
24
+ On Input, Textarea, Select and Combobox, `class`, `style` and other attributes go to the control itself, not the field around it. To size the whole field, label included, wrap it:
25
+
26
+ ```vue-html
27
+ <div class="w-80">
28
+ <UiInput v-model="email" label="Email" />
29
+ </div>
30
+ ```
31
+
32
+ ## core.css
33
+
34
+ It's required, and only handles positioning and visibility. It sits in the `humanonlyweb-ui` cascade layer, so your unlayered CSS always wins over it. If you use layers, list it first:
35
+
36
+ ```css
37
+ @layer reset, humanonlyweb-ui, base, components;
38
+ ```
39
+
40
+ ## Motion
41
+
42
+ Overlays are native popovers, so animate them in with `@starting-style`:
43
+
44
+ ```css
45
+ [data-part="menu-list"] {
46
+ opacity: 0;
47
+ transition:
48
+ opacity 120ms,
49
+ display 120ms allow-discrete,
50
+ overlay 120ms allow-discrete;
51
+
52
+ &:popover-open {
53
+ opacity: 1;
54
+ }
55
+ }
56
+
57
+ @starting-style {
58
+ [data-part="menu-list"]:popover-open {
59
+ opacity: 0;
60
+ }
61
+ }
62
+ ```
63
+
64
+ - **Accordion:** transition `grid-template-rows` on `accordion-panel`.
65
+ - **Tabs, Segmented:** transition the indicator under `[data-tabs-animate]` / `[data-segmented-animate]`.
66
+ - **Toasts:** `ui-toast-enter-from`, `ui-toast-leave-to` and `ui-toast-move`.
67
+
68
+ ### Accordion panels
69
+
70
+ A closed panel is `hidden="until-found"`. Supporting browsers keep the element rendered (`content-visibility: hidden`), so the `grid-template-rows` transition runs from `0fr` when it opens; no `@starting-style` is needed.
71
+
72
+ Browsers without support for that attribute value hide the panel with `display: none`, where a first open can't transition. If you support those (Safari before 26.2, for example), add a starting value:
73
+
74
+ ```css
75
+ [data-part="accordion-panel"][data-accordion-open] {
76
+ @starting-style {
77
+ grid-template-rows: 0fr;
78
+ }
79
+ }
80
+ ```
81
+
82
+ That also animates an initially open panel in on load, so only add it for those browsers.
@@ -0,0 +1,60 @@
1
+ import _default from "./components/accordion/Accordion.vue.js";
2
+ import _default$1 from "./components/accordion/AccordionItem.vue.js";
3
+ import { AvatarItem, AvatarSize, BreadcrumbItem, ButtonSize, ButtonType, ButtonVariant, LinkTarget, LinkTo, MenuEntry, MenuItem, MenuSeparator, Platform, SelectOption, SelectValue, TableColumn, TableSort, Toast, ToastAction, ToastTone } from "./types.js";
4
+ import _default$2 from "./components/avatar/Avatar.vue.js";
5
+ import _default$3 from "./components/avatar/AvatarGroup.vue.js";
6
+ import _default$4 from "./components/breadcrumbs/Breadcrumbs.vue.js";
7
+ import _default$5 from "./components/button/Button.vue.js";
8
+ import _default$13 from "./components/button/IconButton.vue.js";
9
+ import _default$6 from "./components/checkbox/Checkbox.vue.js";
10
+ import _default$7 from "./components/checkbox-group/CheckboxGroup.vue.js";
11
+ import { ComboboxFilter, useCombobox } from "./composables/use-combobox.js";
12
+ import _default$8 from "./components/combobox/Combobox.vue.js";
13
+ import _default$9 from "./components/dialog/ConfirmDialog.vue.js";
14
+ import _default$10 from "./components/context-menu/ContextMenu.vue.js";
15
+ import _default$11 from "./components/dialog/Dialog.vue.js";
16
+ import _default$12 from "./components/fieldset/Fieldset.vue.js";
17
+ import _default$14 from "./components/input/Input.vue.js";
18
+ import _default$15 from "./components/kbd/Kbd.vue.js";
19
+ import _default$16 from "./components/menu/Menu.vue.js";
20
+ import _default$17 from "./components/otp-input/OtpInput.vue.js";
21
+ import _default$18 from "./components/pagination/Pagination.vue.js";
22
+ import _default$19 from "./components/password-input/PasswordInput.vue.js";
23
+ import _default$20 from "./components/popover/Popover.vue.js";
24
+ import _default$21 from "./components/progress/Progress.vue.js";
25
+ import _default$22 from "./components/radio-group/RadioGroup.vue.js";
26
+ import _default$23 from "./components/segmented/Segmented.vue.js";
27
+ import _default$24 from "./components/select/Select.vue.js";
28
+ import _default$25 from "./components/slider/Slider.vue.js";
29
+ import _default$26 from "./components/spin-button/SpinButton.vue.js";
30
+ import _default$27 from "./components/split-button/SplitButton.vue.js";
31
+ import _default$28 from "./components/switch/Switch.vue.js";
32
+ import _default$29 from "./components/table/Table.vue.js";
33
+ import _default$30 from "./components/tabs/Tabs.vue.js";
34
+ import _default$31 from "./components/tag-input/TagInput.vue.js";
35
+ import _default$32 from "./components/textarea/Textarea.vue.js";
36
+ import _default$33 from "./components/toast/ToastItem.vue.js";
37
+ import _default$34 from "./components/toast/ToastViewport.vue.js";
38
+ import _default$35 from "./components/toolbar/Toolbar.vue.js";
39
+ import _default$36 from "./components/tooltip/Tooltip.vue.js";
40
+ import _default$37 from "./components/visually-hidden/VisuallyHidden.vue.js";
41
+ import { UiTranslations, UiTranslationsInput, defaultTranslations } from "./translations.js";
42
+ import { UI_CONFIG_KEY, UiConfig, UiOptions, createUi, useTranslations, useUiConfig } from "./config.js";
43
+ import { ACCORDION_KEY, AccordionContext, useAccordionItem } from "./composables/use-accordion.js";
44
+ import { FieldSource, useField } from "./composables/use-field.js";
45
+ import { StandardSchemaV1 } from "./composables/internal/standard-schema.js";
46
+ import { FormErrors, FormValues, UseFormOptions, useForm } from "./composables/use-form.js";
47
+ import { isMenuSeparator, useMenu } from "./composables/use-menu.js";
48
+ import { KeyCap, parseChord, platformFrom, usePlatform } from "./composables/use-platform.js";
49
+ import { firstFocusable, useAnchor, usePopoverState } from "./composables/use-popover.js";
50
+ import { useRovingSelection } from "./composables/use-roving-selection.js";
51
+ import { useSelect } from "./composables/use-select.js";
52
+ import { useSlideIndicator } from "./composables/use-slide-indicator.js";
53
+ import { TOASTER_KEY, ToastOptions, Toaster, createToaster, useToast } from "./composables/use-toast.js";
54
+ //#region src/index.d.ts
55
+ declare module "vue" {
56
+ /** Installs the props `v-model` and `v-show` contribute during server rendering. */
57
+ function initDirectivesForSSR(): void;
58
+ }
59
+ //#endregion
60
+ export { ACCORDION_KEY, _default as Accordion, type AccordionContext, _default$1 as AccordionItem, _default$2 as Avatar, _default$3 as AvatarGroup, type AvatarItem, type AvatarSize, type BreadcrumbItem, _default$4 as Breadcrumbs, _default$5 as Button, type ButtonSize, type ButtonType, type ButtonVariant, _default$6 as Checkbox, _default$7 as CheckboxGroup, _default$8 as Combobox, type ComboboxFilter, _default$9 as ConfirmDialog, _default$10 as ContextMenu, _default$11 as Dialog, type FieldSource, _default$12 as Fieldset, type FormErrors, type FormValues, _default$13 as IconButton, _default$14 as Input, _default$15 as Kbd, type KeyCap, type LinkTarget, type LinkTo, _default$16 as Menu, type MenuEntry, type MenuItem, type MenuSeparator, _default$17 as OtpInput, _default$18 as Pagination, _default$19 as PasswordInput, type Platform, _default$20 as Popover, _default$21 as Progress, _default$22 as RadioGroup, _default$23 as Segmented, _default$24 as Select, type SelectOption, type SelectValue, _default$25 as Slider, _default$26 as SpinButton, _default$27 as SplitButton, type StandardSchemaV1, _default$28 as Switch, TOASTER_KEY, _default$29 as Table, type TableColumn, type TableSort, _default$30 as Tabs, _default$31 as TagInput, _default$32 as Textarea, type Toast, type ToastAction, _default$33 as ToastItem, type ToastOptions, type ToastTone, _default$34 as ToastViewport, type Toaster, _default$35 as Toolbar, _default$36 as Tooltip, UI_CONFIG_KEY, type UiConfig, type UiOptions, type UiTranslations, type UiTranslationsInput, type UseFormOptions, _default$37 as VisuallyHidden, createToaster, createUi, defaultTranslations, firstFocusable, isMenuSeparator, parseChord, platformFrom, useAccordionItem, useAnchor, useCombobox, useField, useForm, useMenu, usePlatform, usePopoverState, useRovingSelection, useSelect, useSlideIndicator, useToast, useTranslations, useUiConfig };
package/dist/index.js ADDED
@@ -0,0 +1,56 @@
1
+ import { ACCORDION_KEY, useAccordionItem } from "./composables/use-accordion.js";
2
+ import _sfc_main from "./components/accordion/Accordion.js";
3
+ import _sfc_main$1 from "./components/accordion/AccordionItem.js";
4
+ import _sfc_main$2 from "./components/avatar/Avatar.js";
5
+ import { TOASTER_KEY, createToaster, useToast } from "./composables/use-toast.js";
6
+ import { defaultTranslations } from "./translations.js";
7
+ import { UI_CONFIG_KEY, createUi, useTranslations, useUiConfig } from "./config.js";
8
+ import _sfc_main$3 from "./components/avatar/AvatarGroup.js";
9
+ import _sfc_main$4 from "./components/breadcrumbs/Breadcrumbs.js";
10
+ import _sfc_main$5 from "./components/button/Button.js";
11
+ import _sfc_main$13 from "./components/button/IconButton.js";
12
+ import { useField } from "./composables/use-field.js";
13
+ import _sfc_main$6 from "./components/checkbox/Checkbox.js";
14
+ import _sfc_main$12 from "./components/fieldset/Fieldset.js";
15
+ import _sfc_main$7 from "./components/checkbox-group/CheckboxGroup.js";
16
+ import { useCombobox } from "./composables/use-combobox.js";
17
+ import { firstFocusable, useAnchor, usePopoverState } from "./composables/use-popover.js";
18
+ import _sfc_main$8 from "./components/combobox/Combobox.js";
19
+ import _sfc_main$11 from "./components/dialog/Dialog.js";
20
+ import _sfc_main$9 from "./components/dialog/ConfirmDialog.js";
21
+ import { isMenuSeparator, useMenu } from "./composables/use-menu.js";
22
+ import _sfc_main$10 from "./components/context-menu/ContextMenu.js";
23
+ import _sfc_main$14 from "./components/input/Input.js";
24
+ import { parseChord, platformFrom, usePlatform } from "./composables/use-platform.js";
25
+ import _sfc_main$15 from "./components/kbd/Kbd.js";
26
+ import _sfc_main$16 from "./components/menu/Menu.js";
27
+ import _sfc_main$17 from "./components/otp-input/OtpInput.js";
28
+ import _sfc_main$18 from "./components/pagination/Pagination.js";
29
+ import _sfc_main$19 from "./components/password-input/PasswordInput.js";
30
+ import _sfc_main$20 from "./components/popover/Popover.js";
31
+ import _sfc_main$21 from "./components/progress/Progress.js";
32
+ import { useRovingSelection } from "./composables/use-roving-selection.js";
33
+ import _sfc_main$22 from "./components/radio-group/RadioGroup.js";
34
+ import { useSlideIndicator } from "./composables/use-slide-indicator.js";
35
+ import _sfc_main$23 from "./components/segmented/Segmented.js";
36
+ import { useSelect } from "./composables/use-select.js";
37
+ import _sfc_main$24 from "./components/select/Select.js";
38
+ import _sfc_main$25 from "./components/slider/Slider.js";
39
+ import _sfc_main$26 from "./components/spin-button/SpinButton.js";
40
+ import _sfc_main$27 from "./components/split-button/SplitButton.js";
41
+ import _sfc_main$28 from "./components/switch/Switch.js";
42
+ import _sfc_main$29 from "./components/table/Table.js";
43
+ import _sfc_main$30 from "./components/tabs/Tabs.js";
44
+ import _sfc_main$31 from "./components/tag-input/TagInput.js";
45
+ import _sfc_main$32 from "./components/textarea/Textarea.js";
46
+ import _sfc_main$33 from "./components/toast/ToastItem.js";
47
+ import _sfc_main$34 from "./components/toast/ToastViewport.js";
48
+ import _sfc_main$35 from "./components/toolbar/Toolbar.js";
49
+ import _sfc_main$36 from "./components/tooltip/Tooltip.js";
50
+ import _sfc_main$37 from "./components/visually-hidden/VisuallyHidden.js";
51
+ import { useForm } from "./composables/use-form.js";
52
+ import { initDirectivesForSSR } from "vue";
53
+ //#region src/index.ts
54
+ initDirectivesForSSR();
55
+ //#endregion
56
+ export { ACCORDION_KEY, _sfc_main as Accordion, _sfc_main$1 as AccordionItem, _sfc_main$2 as Avatar, _sfc_main$3 as AvatarGroup, _sfc_main$4 as Breadcrumbs, _sfc_main$5 as Button, _sfc_main$6 as Checkbox, _sfc_main$7 as CheckboxGroup, _sfc_main$8 as Combobox, _sfc_main$9 as ConfirmDialog, _sfc_main$10 as ContextMenu, _sfc_main$11 as Dialog, _sfc_main$12 as Fieldset, _sfc_main$13 as IconButton, _sfc_main$14 as Input, _sfc_main$15 as Kbd, _sfc_main$16 as Menu, _sfc_main$17 as OtpInput, _sfc_main$18 as Pagination, _sfc_main$19 as PasswordInput, _sfc_main$20 as Popover, _sfc_main$21 as Progress, _sfc_main$22 as RadioGroup, _sfc_main$23 as Segmented, _sfc_main$24 as Select, _sfc_main$25 as Slider, _sfc_main$26 as SpinButton, _sfc_main$27 as SplitButton, _sfc_main$28 as Switch, TOASTER_KEY, _sfc_main$29 as Table, _sfc_main$30 as Tabs, _sfc_main$31 as TagInput, _sfc_main$32 as Textarea, _sfc_main$33 as ToastItem, _sfc_main$34 as ToastViewport, _sfc_main$35 as Toolbar, _sfc_main$36 as Tooltip, UI_CONFIG_KEY, _sfc_main$37 as VisuallyHidden, createToaster, createUi, defaultTranslations, firstFocusable, isMenuSeparator, parseChord, platformFrom, useAccordionItem, useAnchor, useCombobox, useField, useForm, useMenu, usePlatform, usePopoverState, useRovingSelection, useSelect, useSlideIndicator, useToast, useTranslations, useUiConfig };
@@ -0,0 +1,15 @@
1
+ //#region src/nuxt/module.d.ts
2
+ /** Auto-registered as `<{prefix}{name}>`. A test keeps it in step with `src/index.ts`. */
3
+ export declare const COMPONENTS: readonly ["Accordion", "AccordionItem", "Avatar", "AvatarGroup", "Breadcrumbs", "Button", "Checkbox", "CheckboxGroup", "Combobox", "ConfirmDialog", "ContextMenu", "Dialog", "Fieldset", "IconButton", "Input", "Kbd", "Menu", "OtpInput", "Pagination", "PasswordInput", "Popover", "Progress", "RadioGroup", "Segmented", "Select", "Slider", "SpinButton", "SplitButton", "Switch", "Table", "Tabs", "TagInput", "Textarea", "ToastItem", "ToastViewport", "Toolbar", "Tooltip", "VisuallyHidden"];
4
+ export declare const COMPOSABLES: readonly ["useField", "useForm", "useToast"];
5
+ export interface ModuleOptions {
6
+ /** Auto-imported component prefix: `Ui` gives `<UiButton>`. */
7
+ prefix: string;
8
+ /** Inject the core stylesheet. Turn off only to import it yourself, e.g. into a layer order. */
9
+ css: boolean;
10
+ /** Auto-import `useField`, `useForm` and `useToast`. */
11
+ composables: boolean;
12
+ }
13
+ declare const _default: import("@nuxt/schema").NuxtModule<ModuleOptions, ModuleOptions, false>;
14
+ //#endregion
15
+ export { _default as default };
@@ -0,0 +1,80 @@
1
+ import { version } from "../package.js";
2
+ import { addComponent, addImports, addPlugin, createResolver, defineNuxtModule } from "@nuxt/kit";
3
+ //#region src/nuxt/module.ts
4
+ const PACKAGE = "@humanonlyweb/ui";
5
+ /** Auto-registered as `<{prefix}{name}>`. A test keeps it in step with `src/index.ts`. */
6
+ const COMPONENTS = [
7
+ "Accordion",
8
+ "AccordionItem",
9
+ "Avatar",
10
+ "AvatarGroup",
11
+ "Breadcrumbs",
12
+ "Button",
13
+ "Checkbox",
14
+ "CheckboxGroup",
15
+ "Combobox",
16
+ "ConfirmDialog",
17
+ "ContextMenu",
18
+ "Dialog",
19
+ "Fieldset",
20
+ "IconButton",
21
+ "Input",
22
+ "Kbd",
23
+ "Menu",
24
+ "OtpInput",
25
+ "Pagination",
26
+ "PasswordInput",
27
+ "Popover",
28
+ "Progress",
29
+ "RadioGroup",
30
+ "Segmented",
31
+ "Select",
32
+ "Slider",
33
+ "SpinButton",
34
+ "SplitButton",
35
+ "Switch",
36
+ "Table",
37
+ "Tabs",
38
+ "TagInput",
39
+ "Textarea",
40
+ "ToastItem",
41
+ "ToastViewport",
42
+ "Toolbar",
43
+ "Tooltip",
44
+ "VisuallyHidden"
45
+ ];
46
+ const COMPOSABLES = [
47
+ "useField",
48
+ "useForm",
49
+ "useToast"
50
+ ];
51
+ var module_default = defineNuxtModule({
52
+ meta: {
53
+ name: PACKAGE,
54
+ version,
55
+ configKey: "ui",
56
+ compatibility: { nuxt: ">=4.0.0" }
57
+ },
58
+ defaults: {
59
+ prefix: "Ui",
60
+ css: true,
61
+ composables: true
62
+ },
63
+ setup(options, nuxt) {
64
+ const resolver = createResolver(import.meta.url);
65
+ const entry = resolver.resolve("../index");
66
+ for (const name of COMPONENTS) addComponent({
67
+ name: `${options.prefix}${name}`,
68
+ export: name,
69
+ filePath: entry
70
+ });
71
+ if (options.composables) addImports(COMPOSABLES.map((name) => ({
72
+ name,
73
+ from: entry
74
+ })));
75
+ if (options.css) nuxt.options.css.push(resolver.resolve("../styles/core.css"));
76
+ addPlugin(resolver.resolve("./runtime/plugin"));
77
+ }
78
+ });
79
+ //#endregion
80
+ export { COMPONENTS, COMPOSABLES, module_default as default };
@@ -0,0 +1,4 @@
1
+ //#region src/nuxt/runtime/plugin.d.ts
2
+ declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
3
+ //#endregion
4
+ export { _default as default };
@@ -0,0 +1,24 @@
1
+ import { createUi } from "../../config.js";
2
+ import { platformFrom } from "../../composables/use-platform.js";
3
+ import { computed } from "vue";
4
+ import { defineNuxtPlugin, useRequestHeaders, useState } from "nuxt/app";
5
+ import { NuxtLink } from "#components";
6
+ //#region src/nuxt/runtime/plugin.ts
7
+ var plugin_default = defineNuxtPlugin({
8
+ name: "humanonlyweb-ui",
9
+ setup(nuxtApp) {
10
+ const platform = useState("humanonlyweb-ui:platform", () => {
11
+ if (import.meta.client) return platformFrom(navigator.userAgent);
12
+ if (import.meta.prerender) return null;
13
+ const headers = useRequestHeaders(["sec-ch-ua-platform", "user-agent"]);
14
+ const source = headers["sec-ch-ua-platform"] ?? headers["user-agent"];
15
+ return source ? platformFrom(source) : null;
16
+ });
17
+ nuxtApp.vueApp.use(createUi({
18
+ link: NuxtLink,
19
+ platform: computed(() => platform.value ?? void 0)
20
+ }));
21
+ }
22
+ });
23
+ //#endregion
24
+ export { plugin_default as default };
@@ -0,0 +1,4 @@
1
+ //#region package.json
2
+ var version = "0.2.0";
3
+ //#endregion
4
+ export { version };
@@ -0,0 +1,310 @@
1
+ /* @humanonlyweb/ui core styles: behaviour only, in a layer your CSS overrides. */
2
+ @layer humanonlyweb-ui {
3
+ /* Dialog: no page scroll behind a modal. */
4
+ :root:has([data-part="dialog"]:modal) {
5
+ overflow: hidden;
6
+ scrollbar-gutter: stable;
7
+ }
8
+
9
+ /* Popover, Menu, Select, Combobox: anchored to the trigger, flipping at edges. */
10
+ [data-part="popover"],
11
+ [data-part="menu-list"],
12
+ [data-part="select-listbox"],
13
+ [data-part="combobox-popup"] {
14
+ inset: auto;
15
+ margin: 0;
16
+ overflow-y: auto;
17
+ position-area: block-end span-inline-end;
18
+ position-try-fallbacks:
19
+ flip-block,
20
+ flip-inline,
21
+ flip-block flip-inline;
22
+ position-visibility: anchors-visible;
23
+ }
24
+
25
+ [data-part="popover"][data-popover-align="end"],
26
+ [data-part="menu-list"][data-menu-align="end"] {
27
+ position-area: block-end span-inline-start;
28
+ }
29
+
30
+ [data-part="menu-list"],
31
+ [data-part="select-listbox"],
32
+ [data-part="combobox-popup"] {
33
+ min-inline-size: anchor-size(inline);
34
+ }
35
+
36
+ /* An inline anchor would measure its line box, not its button. */
37
+ [data-part="popover-anchor"],
38
+ [data-part="menu"],
39
+ [data-part="toolbar"] {
40
+ display: inline-flex;
41
+ }
42
+
43
+ [data-part="toolbar"][data-orientation="vertical"] {
44
+ flex-direction: column;
45
+ }
46
+
47
+ /* Context menu: anchored to a zero-size point at the pointer. */
48
+ [data-part="context-menu"] {
49
+ -webkit-touch-callout: none;
50
+ }
51
+
52
+ [data-part="context-menu-anchor"] {
53
+ position: fixed;
54
+ width: 0;
55
+ height: 0;
56
+ pointer-events: none;
57
+ }
58
+
59
+ [data-part="context-menu-anchor"] + [data-part="menu-list"] {
60
+ position-area: block-end span-inline-end;
61
+ min-inline-size: auto;
62
+ }
63
+
64
+ /* Accordion: pad accordion-content, not the clip, or it won't collapse. */
65
+ [data-part="accordion-panel"] {
66
+ display: grid;
67
+ grid-template-rows: 0fr;
68
+ }
69
+
70
+ [data-part="accordion-panel"][data-accordion-open] {
71
+ grid-template-rows: 1fr;
72
+ }
73
+
74
+ [data-part="accordion-clip"] {
75
+ min-height: 0;
76
+ overflow: hidden;
77
+ }
78
+
79
+ [data-part="accordion-panel"][data-accordion-open] > [data-part="accordion-clip"] {
80
+ overflow: visible;
81
+ }
82
+
83
+ /* Tooltip: above the trigger; flips and shifts at edges. */
84
+ [data-part="tooltip-root"] {
85
+ display: inline-flex;
86
+ }
87
+
88
+ [data-part="tooltip"] {
89
+ inset: auto;
90
+ margin: 0;
91
+ width: max-content;
92
+ max-width: min(320px, calc(100vw - 16px));
93
+ overflow: visible;
94
+ position-area: block-start;
95
+ position-try-fallbacks:
96
+ flip-block,
97
+ block-start span-inline-end,
98
+ block-start span-inline-start,
99
+ block-end span-inline-end,
100
+ block-end span-inline-start;
101
+ }
102
+
103
+ /* Tabs, Segmented: indicator placed from the measured --ui-indicator-* vars. */
104
+ [data-part="tablist"],
105
+ [data-part="segmented"] {
106
+ position: relative;
107
+ }
108
+
109
+ /* Physical left, not inline-start: --ui-indicator-x is measured from the left edge,
110
+ in right-to-left layouts too. */
111
+ [data-part="tab-indicator"],
112
+ [data-part="segmented-indicator"] {
113
+ position: absolute;
114
+ left: 0;
115
+ width: var(--ui-indicator-width);
116
+ transform: translateX(var(--ui-indicator-x));
117
+ pointer-events: none;
118
+ }
119
+
120
+ [data-part="tab-indicator"] {
121
+ inset-block-end: 0;
122
+ }
123
+
124
+ [data-part="segmented-indicator"] {
125
+ top: var(--ui-indicator-top);
126
+ height: var(--ui-indicator-height);
127
+ }
128
+
129
+ /* Paints above the indicator. */
130
+ [data-part="segment"] {
131
+ position: relative;
132
+ }
133
+
134
+ /* Slider: placed from the --ui-slider-* percentages. */
135
+ [data-part="slider-control"] {
136
+ position: relative;
137
+ display: flex;
138
+ align-items: center;
139
+ touch-action: none;
140
+ user-select: none;
141
+ }
142
+
143
+ [data-part="slider-track"] {
144
+ position: relative;
145
+ flex: 1;
146
+ }
147
+
148
+ [data-part="slider-range"] {
149
+ position: absolute;
150
+ inset-block: 0;
151
+ inset-inline-start: var(--ui-slider-start);
152
+ inset-inline-end: calc(100% - var(--ui-slider-end));
153
+ }
154
+
155
+ [data-part="slider-thumb"] {
156
+ position: absolute;
157
+ inset-block-start: 50%;
158
+ inset-inline-start: var(--ui-slider-value);
159
+ translate: -50% -50%;
160
+ }
161
+
162
+ /* :dir(), unlike [dir="rtl"] on an ancestor, respects nested dir and dir="auto". */
163
+ [data-part="slider-thumb"]:dir(rtl) {
164
+ translate: 50% -50%;
165
+ }
166
+
167
+ [data-part="slider"][data-orientation="vertical"] {
168
+ & [data-part="slider-control"] {
169
+ flex-direction: column;
170
+ justify-content: center;
171
+ }
172
+
173
+ & [data-part="slider-range"] {
174
+ inset-inline: 0;
175
+ inset-block-start: calc(100% - var(--ui-slider-end));
176
+ inset-block-end: var(--ui-slider-start);
177
+ }
178
+
179
+ & [data-part="slider-thumb"] {
180
+ inset-block-start: auto;
181
+ inset-block-end: var(--ui-slider-value);
182
+ inset-inline-start: 50%;
183
+ translate: -50% 50%;
184
+ }
185
+ }
186
+
187
+ /* Switch */
188
+ [data-part="switch-track"] {
189
+ display: inline-flex;
190
+ align-items: center;
191
+ }
192
+
193
+ [data-part="switch"][data-switch-checked] [data-part="switch-track"] {
194
+ justify-content: flex-end;
195
+ }
196
+
197
+ /* Checkbox: the native input stays, visually hidden. */
198
+ [data-part="checkbox"] {
199
+ position: relative;
200
+ }
201
+
202
+ [data-part="checkbox-input"] {
203
+ position: absolute;
204
+ width: 1px;
205
+ height: 1px;
206
+ margin: 0;
207
+ opacity: 0;
208
+ }
209
+
210
+ /* Toasts */
211
+ /* A manual popover in the top layer: undo the browser's centred-box defaults. */
212
+ [data-part="toast-viewport"] {
213
+ position: fixed;
214
+ inset: auto;
215
+ inset-block-end: 0;
216
+ inset-inline-end: 0;
217
+ margin: 0;
218
+ padding: 0;
219
+ border: 0;
220
+ background: none;
221
+ color: inherit;
222
+ overflow: visible;
223
+ display: flex;
224
+ flex-direction: column;
225
+ pointer-events: none;
226
+ }
227
+
228
+ [data-part="toast-viewport"] > * {
229
+ pointer-events: auto;
230
+ }
231
+
232
+ /* Avatar: the image covers the initials, which show until it has loaded. */
233
+ [data-part="avatar"] {
234
+ position: relative;
235
+ display: inline-flex;
236
+ align-items: center;
237
+ justify-content: center;
238
+ overflow: hidden;
239
+ }
240
+
241
+ [data-part="avatar-image"] {
242
+ position: absolute;
243
+ inset: 0;
244
+ width: 100%;
245
+ height: 100%;
246
+ object-fit: cover;
247
+ }
248
+
249
+ /* Table */
250
+ [data-part="table-scroll"] {
251
+ overflow-x: auto;
252
+ }
253
+
254
+ /* OTP input: one real input laid over the slots, which only display its value.
255
+ Autofill, paste and screen readers see a single field. */
256
+ [data-part="otp"] {
257
+ position: relative;
258
+ display: inline-flex;
259
+ align-items: center;
260
+ }
261
+
262
+ [data-part="otp-input"] {
263
+ position: absolute;
264
+ inset: 0;
265
+ width: 100%;
266
+ height: 100%;
267
+ margin: 0;
268
+ padding: 0;
269
+ /* Under 16px, iOS zooms in on focus. */
270
+ font-size: max(16px, 1em);
271
+ /* Important, so an app's input reset can't show it over the slots: a layered
272
+ !important beats unlayered rules, important or not. */
273
+ border: 0 !important;
274
+ outline: 0 !important;
275
+ background: transparent !important;
276
+ box-shadow: none !important;
277
+ color: transparent !important;
278
+ caret-color: transparent !important;
279
+ }
280
+
281
+ [data-part="otp-input"]::selection {
282
+ background: transparent;
283
+ }
284
+
285
+ /* Fieldset: reset the browser's frame, so the legend styles like a label. */
286
+ [data-part="fieldset"] {
287
+ min-inline-size: 0;
288
+ margin: 0;
289
+ padding: 0;
290
+ border: 0;
291
+ }
292
+
293
+ [data-part="fieldset-legend"] {
294
+ padding: 0;
295
+ }
296
+
297
+ /* Visually hidden: in the accessibility tree, out of the layout. Not `display: none`,
298
+ so screen readers still read it. */
299
+ [data-part="visually-hidden"] {
300
+ position: absolute;
301
+ width: 1px;
302
+ height: 1px;
303
+ margin: -1px;
304
+ padding: 0;
305
+ overflow: hidden;
306
+ clip-path: inset(50%);
307
+ white-space: nowrap;
308
+ border: 0;
309
+ }
310
+ }