@jfrader/ui 0.0.0-stage → 0.1.1

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 (194) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +123 -2
  3. package/dist/accordion-Dl-kvgPQ.js +168 -0
  4. package/dist/accordion.js +1 -0
  5. package/dist/alert-BzntPa_5.js +129 -0
  6. package/dist/alert.js +1 -0
  7. package/dist/avatar-Dk2ES3ru.js +124 -0
  8. package/dist/avatar.js +1 -0
  9. package/dist/badge-DZefC7rm.js +102 -0
  10. package/dist/badge.js +1 -0
  11. package/dist/breadcrumbs-5MCZ_Jr3.js +125 -0
  12. package/dist/breadcrumbs.js +1 -0
  13. package/dist/button-qy-50NPd.js +187 -0
  14. package/dist/button.js +1 -0
  15. package/dist/calendar-DcCAiN3b.js +372 -0
  16. package/dist/calendar.js +1 -0
  17. package/dist/card-L-Z_1vZN.js +120 -0
  18. package/dist/card.js +1 -0
  19. package/dist/checkbox-B7em7B-6.js +134 -0
  20. package/dist/checkbox.js +1 -0
  21. package/dist/choice-control-DCyQ_hVw.js +35 -0
  22. package/dist/collection-registry-C2jnQa7X.js +97 -0
  23. package/dist/combobox-DQcXR94r.js +301 -0
  24. package/dist/combobox.js +1 -0
  25. package/dist/command-palette-BRJ8A5De.js +328 -0
  26. package/dist/command-palette.js +1 -0
  27. package/dist/container-COHiEjI8.js +34 -0
  28. package/dist/container.js +1 -0
  29. package/dist/css-CW_HG55W.js +1 -0
  30. package/dist/date-picker-D1GwiRB9.js +239 -0
  31. package/dist/date-picker.js +1 -0
  32. package/dist/dialog-CYf9fCZO.js +175 -0
  33. package/dist/dialog.js +1 -0
  34. package/dist/disclosure-caret-BC6P8AsM.js +13 -0
  35. package/dist/divider-bi7OgCI5.js +76 -0
  36. package/dist/divider.js +1 -0
  37. package/dist/field-anatomy-DKkB268x.js +104 -0
  38. package/dist/flex-CDFDDaiu.js +21 -0
  39. package/dist/flex.js +1 -0
  40. package/dist/focus-ring-qOS3rPlM.js +11 -0
  41. package/dist/icon-wrapper-BKo4FI-O.js +12 -0
  42. package/dist/index.js +37 -0
  43. package/dist/kbd-DpiJgDJ2.js +55 -0
  44. package/dist/kbd.js +1 -0
  45. package/dist/layout-style-B_6YHQ6Q.js +56 -0
  46. package/dist/loading-ring-CTpT-IrT.js +18 -0
  47. package/dist/media-8K3xDAxM.js +4 -0
  48. package/dist/menu-A9fZUaAG.js +186 -0
  49. package/dist/menu.js +1 -0
  50. package/dist/navigation-Cemnmc_J.js +174 -0
  51. package/dist/navigation.js +1 -0
  52. package/dist/pagination-orCjUsn_.js +148 -0
  53. package/dist/pagination.js +1 -0
  54. package/dist/part-id-Bg1LSlk7.js +4 -0
  55. package/dist/pill-Dg2JJHHW.js +49 -0
  56. package/dist/pill.js +1 -0
  57. package/dist/popover-D_YU34WS.js +97 -0
  58. package/dist/popover.js +1 -0
  59. package/dist/progress-XdvBG0Vv.js +83 -0
  60. package/dist/progress.js +1 -0
  61. package/dist/radio-group-CxMJ2Vq7.js +130 -0
  62. package/dist/radio-group.js +1 -0
  63. package/dist/renderable-DwPvt1I8.js +6 -0
  64. package/dist/roving-focus-DeEZ55-T.js +35 -0
  65. package/dist/select-mwFbmzsn.js +256 -0
  66. package/dist/select.js +1 -0
  67. package/dist/skeleton-qas9ZKK9.js +47 -0
  68. package/dist/skeleton.js +1 -0
  69. package/dist/spinner-ros2CfIf.js +49 -0
  70. package/dist/spinner.js +1 -0
  71. package/dist/stack-Hs8THnIL.js +20 -0
  72. package/dist/stack.js +1 -0
  73. package/dist/surface-Bo_aSQOb.js +18 -0
  74. package/dist/switch-E375Bz4X.js +135 -0
  75. package/dist/switch.js +1 -0
  76. package/dist/tabs-CBwRiuul.js +173 -0
  77. package/dist/tabs.js +1 -0
  78. package/dist/text-field-BlP8qGn_.js +73 -0
  79. package/dist/text-field.js +1 -0
  80. package/dist/textarea-CUG26CH2.js +83 -0
  81. package/dist/textarea.js +1 -0
  82. package/dist/theme-root-CrdzwfSo.js +20 -0
  83. package/dist/theme-root.js +1 -0
  84. package/dist/toast-D_dnqnn-.js +270 -0
  85. package/dist/toast.js +1 -0
  86. package/dist/toggle-group-B7gXCea8.js +150 -0
  87. package/dist/toggle-group.js +1 -0
  88. package/dist/tooltip-BJ2hLV1b.js +92 -0
  89. package/dist/tooltip.js +1 -0
  90. package/dist/trigger-style-f54idgjT.js +35 -0
  91. package/dist/types/components/accordion/accordion.d.ts +33 -0
  92. package/dist/types/components/accordion/index.d.ts +2 -0
  93. package/dist/types/components/alert/alert.d.ts +23 -0
  94. package/dist/types/components/alert/index.d.ts +2 -0
  95. package/dist/types/components/avatar/avatar.d.ts +23 -0
  96. package/dist/types/components/avatar/index.d.ts +2 -0
  97. package/dist/types/components/badge/badge.d.ts +36 -0
  98. package/dist/types/components/badge/index.d.ts +2 -0
  99. package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +15 -0
  100. package/dist/types/components/breadcrumbs/index.d.ts +2 -0
  101. package/dist/types/components/button/button.d.ts +34 -0
  102. package/dist/types/components/button/index.d.ts +2 -0
  103. package/dist/types/components/calendar/calendar.d.ts +28 -0
  104. package/dist/types/components/calendar/calendar.styles.d.ts +9 -0
  105. package/dist/types/components/calendar/calendar.utils.d.ts +37 -0
  106. package/dist/types/components/calendar/index.d.ts +2 -0
  107. package/dist/types/components/card/card.d.ts +34 -0
  108. package/dist/types/components/card/index.d.ts +2 -0
  109. package/dist/types/components/checkbox/checkbox.d.ts +21 -0
  110. package/dist/types/components/checkbox/index.d.ts +2 -0
  111. package/dist/types/components/combobox/combobox.d.ts +44 -0
  112. package/dist/types/components/combobox/index.d.ts +2 -0
  113. package/dist/types/components/command-palette/command-palette.d.ts +47 -0
  114. package/dist/types/components/command-palette/command-palette.styles.d.ts +8 -0
  115. package/dist/types/components/command-palette/index.d.ts +2 -0
  116. package/dist/types/components/container/container.d.ts +14 -0
  117. package/dist/types/components/container/index.d.ts +3 -0
  118. package/dist/types/components/date-picker/date-picker.d.ts +39 -0
  119. package/dist/types/components/date-picker/index.d.ts +2 -0
  120. package/dist/types/components/dialog/dialog.d.ts +61 -0
  121. package/dist/types/components/dialog/index.d.ts +2 -0
  122. package/dist/types/components/divider/divider.d.ts +14 -0
  123. package/dist/types/components/divider/index.d.ts +2 -0
  124. package/dist/types/components/field/field-anatomy.d.ts +49 -0
  125. package/dist/types/components/flex/flex.d.ts +4 -0
  126. package/dist/types/components/flex/index.d.ts +3 -0
  127. package/dist/types/components/kbd/index.d.ts +2 -0
  128. package/dist/types/components/kbd/kbd.d.ts +6 -0
  129. package/dist/types/components/menu/index.d.ts +2 -0
  130. package/dist/types/components/menu/menu.d.ts +29 -0
  131. package/dist/types/components/navigation/index.d.ts +2 -0
  132. package/dist/types/components/navigation/navigation.d.ts +24 -0
  133. package/dist/types/components/pagination/index.d.ts +2 -0
  134. package/dist/types/components/pagination/pagination.d.ts +14 -0
  135. package/dist/types/components/pill/index.d.ts +2 -0
  136. package/dist/types/components/pill/pill.d.ts +6 -0
  137. package/dist/types/components/popover/index.d.ts +2 -0
  138. package/dist/types/components/popover/popover.d.ts +19 -0
  139. package/dist/types/components/progress/index.d.ts +2 -0
  140. package/dist/types/components/progress/progress.d.ts +19 -0
  141. package/dist/types/components/radio-group/index.d.ts +2 -0
  142. package/dist/types/components/radio-group/radio-group.d.ts +29 -0
  143. package/dist/types/components/select/index.d.ts +2 -0
  144. package/dist/types/components/select/select.d.ts +38 -0
  145. package/dist/types/components/skeleton/index.d.ts +2 -0
  146. package/dist/types/components/skeleton/skeleton.d.ts +11 -0
  147. package/dist/types/components/spinner/index.d.ts +2 -0
  148. package/dist/types/components/spinner/spinner.d.ts +8 -0
  149. package/dist/types/components/stack/index.d.ts +3 -0
  150. package/dist/types/components/stack/stack.d.ts +7 -0
  151. package/dist/types/components/switch/index.d.ts +2 -0
  152. package/dist/types/components/switch/switch.d.ts +20 -0
  153. package/dist/types/components/tabs/index.d.ts +2 -0
  154. package/dist/types/components/tabs/tabs.d.ts +22 -0
  155. package/dist/types/components/text-field/index.d.ts +2 -0
  156. package/dist/types/components/text-field/text-field.d.ts +14 -0
  157. package/dist/types/components/textarea/index.d.ts +2 -0
  158. package/dist/types/components/textarea/textarea.d.ts +17 -0
  159. package/dist/types/components/theme-root/index.d.ts +2 -0
  160. package/dist/types/components/theme-root/theme-root.d.ts +7 -0
  161. package/dist/types/components/toast/index.d.ts +2 -0
  162. package/dist/types/components/toast/toast.d.ts +37 -0
  163. package/dist/types/components/toggle-group/index.d.ts +2 -0
  164. package/dist/types/components/toggle-group/toggle-group.d.ts +29 -0
  165. package/dist/types/components/tooltip/index.d.ts +2 -0
  166. package/dist/types/components/tooltip/tooltip.d.ts +23 -0
  167. package/dist/types/index.d.ts +36 -0
  168. package/dist/types/overlay/use-native-dialog.d.ts +39 -0
  169. package/dist/types/overlay/use-overlay-floating.d.ts +11 -0
  170. package/dist/types/overlay/use-scroll-lock.d.ts +5 -0
  171. package/dist/types/styling/choice-control.d.ts +8 -0
  172. package/dist/types/styling/css.d.ts +2 -0
  173. package/dist/types/styling/disclosure-caret.d.ts +9 -0
  174. package/dist/types/styling/focus-ring.d.ts +10 -0
  175. package/dist/types/styling/icon-wrapper.d.ts +1 -0
  176. package/dist/types/styling/input-control.d.ts +1 -0
  177. package/dist/types/styling/layout-style.d.ts +26 -0
  178. package/dist/types/styling/listbox-style.d.ts +12 -0
  179. package/dist/types/styling/loading-ring.d.ts +14 -0
  180. package/dist/types/styling/media.d.ts +2 -0
  181. package/dist/types/styling/surface.d.ts +19 -0
  182. package/dist/types/styling/trigger-style.d.ts +1 -0
  183. package/dist/types/styling/visually-hidden.d.ts +1 -0
  184. package/dist/types/utils/collection-registry.d.ts +41 -0
  185. package/dist/types/utils/part-id.d.ts +2 -0
  186. package/dist/types/utils/renderable.d.ts +3 -0
  187. package/dist/types/utils/roving-focus.d.ts +18 -0
  188. package/dist/types/utils/use-controlled-state.d.ts +7 -0
  189. package/dist/types/utils/use-latest-callback.d.ts +10 -0
  190. package/dist/use-controlled-state-DQXkiTQI.js +20 -0
  191. package/dist/use-native-dialog-BCp1chwO.js +83 -0
  192. package/dist/use-overlay-floating-CsZd3qxa.js +18 -0
  193. package/dist/visually-hidden-BXVyhj0y.js +16 -0
  194. package/package.json +198 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jfrader
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,124 @@
1
- # Temporary Holding Version
1
+ # @jfrader/ui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ React components styled with Emotion and themed through the CSS custom properties from `@jfrader/tokens`.
4
+
5
+ ## Components
6
+
7
+ | Subpath | Exports |
8
+ | --- | --- |
9
+ | `@jfrader/ui/accordion` | `Accordion` |
10
+ | `@jfrader/ui/alert` | `Alert` |
11
+ | `@jfrader/ui/avatar` | `Avatar` |
12
+ | `@jfrader/ui/badge` | `Badge` |
13
+ | `@jfrader/ui/breadcrumbs` | `Breadcrumbs` |
14
+ | `@jfrader/ui/button` | `Button` |
15
+ | `@jfrader/ui/calendar` | `Calendar` |
16
+ | `@jfrader/ui/card` | `Card` |
17
+ | `@jfrader/ui/checkbox` | `Checkbox` |
18
+ | `@jfrader/ui/combobox` | `Combobox` |
19
+ | `@jfrader/ui/command-palette` | `CommandPalette` |
20
+ | `@jfrader/ui/container` | `Container` |
21
+ | `@jfrader/ui/date-picker` | `DatePicker` |
22
+ | `@jfrader/ui/dialog` | `Dialog` |
23
+ | `@jfrader/ui/divider` | `Divider` |
24
+ | `@jfrader/ui/flex` | `Flex` |
25
+ | `@jfrader/ui/kbd` | `Kbd` |
26
+ | `@jfrader/ui/menu` | `Menu` |
27
+ | `@jfrader/ui/pagination` | `Pagination` |
28
+ | `@jfrader/ui/pill` | `Pill` |
29
+ | `@jfrader/ui/popover` | `Popover` |
30
+ | `@jfrader/ui/progress` | `Progress` |
31
+ | `@jfrader/ui/radio-group` | `RadioGroup` |
32
+ | `@jfrader/ui/select` | `Select` |
33
+ | `@jfrader/ui/skeleton` | `Skeleton` |
34
+ | `@jfrader/ui/spinner` | `Spinner` |
35
+ | `@jfrader/ui/stack` | `Stack` |
36
+ | `@jfrader/ui/switch` | `Switch` |
37
+ | `@jfrader/ui/tabs` | `Tabs` |
38
+ | `@jfrader/ui/text-field` | `TextField` |
39
+ | `@jfrader/ui/textarea` | `Textarea` |
40
+ | `@jfrader/ui/theme-root` | `ThemeRoot` |
41
+ | `@jfrader/ui/toast` | `Toast`, `useToast` |
42
+ | `@jfrader/ui/toggle-group` | `ToggleGroup` |
43
+ | `@jfrader/ui/tooltip` | `Tooltip` |
44
+
45
+ Each subpath also exports its prop types. The package root re-exports everything.
46
+
47
+ ## Usage
48
+
49
+ ```tsx
50
+ import { Button, Dialog, ThemeRoot } from '@jfrader/ui';
51
+ ```
52
+
53
+ Or import per path:
54
+
55
+ ```tsx
56
+ import { Button } from '@jfrader/ui/button';
57
+ import { Dialog } from '@jfrader/ui/dialog';
58
+ import { ThemeRoot } from '@jfrader/ui/theme-root';
59
+ ```
60
+
61
+ `react` and `react-dom` (`>=18.2`) are peer dependencies.
62
+
63
+ ## Theming
64
+
65
+ Components read CSS custom properties defined by `@jfrader/tokens`. Load the stylesheet once and wrap the app in `ThemeRoot`:
66
+
67
+ ```tsx
68
+ import '@jfrader/tokens/tokens.css';
69
+ import { ThemeRoot } from '@jfrader/ui/theme-root';
70
+
71
+ <ThemeRoot theme="light">{app}</ThemeRoot>;
72
+ ```
73
+
74
+ Token names and values live in `packages/tokens/src/tokens.ts`.
75
+
76
+ ## Build
77
+
78
+ ```sh
79
+ pnpm --filter @jfrader/tokens build && pnpm --filter @jfrader/ui build
80
+ ```
81
+
82
+ Writes ES modules to `dist/` (`dist/index.js` plus one `dist/<name>.js` per component) and declarations to `dist/types/`. `react`, `react-dom` and every package in `dependencies` stay external.
83
+
84
+ ## Publishing
85
+
86
+ `@jfrader/ui` and `@jfrader/tokens` publish together from `.github/workflows/publish.yml` to npmjs and GitHub Packages.
87
+
88
+ 1. Set the same `version` in `packages/ui/package.json` and `packages/tokens/package.json` and merge to `master`.
89
+ 2. Push an annotated tag on that commit: `git tag -a vX.Y.Z -m vX.Y.Z && git push origin vX.Y.Z`.
90
+ 3. CI checks the tag against both manifests, runs typecheck, tests and `verify:exports`, builds both packages, switches `exports` to `dist/` and packs each package once with `pnpm pack`. `workspace:*` becomes the published version.
91
+ 4. CI verifies or publishes the same tarballs to npmjs, then to GitHub Packages, tokens before UI. A matching artifact already at that version is accepted; a different one fails the release.
92
+
93
+ To re-run a release without re-tagging:
94
+
95
+ ```sh
96
+ gh workflow run publish.yml --repo jfrader/jfrader-ui --ref v0.1.1
97
+ ```
98
+
99
+ npmjs authenticates through the package's trusted publisher for `jfrader/jfrader-ui` → `.github/workflows/publish.yml`, configured on npmjs after the first version is published by hand. GitHub Packages uses the workflow's `GITHUB_TOKEN`. See the [root README](https://github.com/jfrader/jfrader-ui#publishing) for the full release setup.
100
+
101
+ In the repo, `exports` point at `src/` so the workspace consumes source. `node scripts/flip-exports.mjs dist` validates and switches both packages to the publish layout; `node scripts/flip-exports.mjs src` switches both back. The UI `prepack` builds UI and flips only its manifest with `--package ui`; `postpack` restores only UI. Each flip validates only the selected package's export targets.
102
+
103
+ Build tokens before packing UI: the published UI package depends on `@jfrader/tokens`, which stays external rather than being bundled. The UI hook does not build or validate tokens; prepare its published artifacts separately. Run from the repo root:
104
+
105
+ ```sh
106
+ pnpm --filter @jfrader/tokens build && pnpm --filter @jfrader/ui build
107
+ pnpm --filter @jfrader/ui exec npm pack --dry-run --json
108
+ pnpm --filter @jfrader/ui pack --pack-destination /tmp/opencode
109
+ ```
110
+
111
+ Root `pnpm build` builds Storybook, not the published packages. If packing fails after `prepack`, run `node scripts/flip-exports.mjs src` from the repo root to restore workspace exports.
112
+
113
+ It must contain only `dist/**`, `package.json`, `README.md` and `LICENSE`.
114
+
115
+ ### Registry choice / installing
116
+
117
+ npmjs needs no authentication; GitHub Packages requires authentication even for public packages. To install from GitHub Packages, add this to `.npmrc`:
118
+
119
+ ```ini
120
+ @jfrader:registry=https://npm.pkg.github.com
121
+ //npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
122
+ ```
123
+
124
+ See the [root README's registry section](https://github.com/jfrader/jfrader-ui#registry-choice) for details.
@@ -0,0 +1,168 @@
1
+ import { t as e } from "./css-CW_HG55W.js";
2
+ import { t } from "./disclosure-caret-BC6P8AsM.js";
3
+ import { t as n } from "./focus-ring-qOS3rPlM.js";
4
+ import { n as r } from "./media-8K3xDAxM.js";
5
+ import { n as i } from "./roving-focus-DeEZ55-T.js";
6
+ import { t as a } from "./use-controlled-state-DQXkiTQI.js";
7
+ import { createContext as o, forwardRef as s, useContext as c, useId as l, useMemo as u } from "react";
8
+ import { vars as d } from "@jfrader/tokens/vars";
9
+ import { jsx as f } from "@emotion/react/jsx-runtime";
10
+ //#region src/components/accordion/accordion.tsx
11
+ var p = o(null), m = o(null);
12
+ function h(e) {
13
+ let t = c(p);
14
+ if (!t) throw Error(`Accordion.${e} must be rendered inside <Accordion>.`);
15
+ return t;
16
+ }
17
+ function g(e) {
18
+ let t = c(m);
19
+ if (!t) throw Error(`Accordion.${e} must be rendered inside <Accordion.Item>.`);
20
+ return t;
21
+ }
22
+ var _ = "", v = {
23
+ itemSelector: "[data-ui=\"accordion-trigger\"]:not([disabled])",
24
+ ownerSelector: "[data-ui=\"accordion\"]"
25
+ }, y = (e, t) => {
26
+ if (t === "multiple" && Array.isArray(e)) return e;
27
+ let n = Array.isArray(e) ? e[0] : e;
28
+ return n === void 0 || n === _ ? [] : [n];
29
+ }, b = e({
30
+ borderBlockEnd: `1px solid ${d.color.border}`,
31
+ "&:first-of-type": { borderBlockStart: `1px solid ${d.color.border}` }
32
+ }), x = e({
33
+ margin: 0,
34
+ font: "inherit"
35
+ }), S = e({
36
+ appearance: "none",
37
+ display: "flex",
38
+ alignItems: "center",
39
+ justifyContent: "space-between",
40
+ gap: d.space[3],
41
+ inlineSize: "100%",
42
+ border: 0,
43
+ background: "transparent",
44
+ cursor: "pointer",
45
+ paddingBlock: d.space[3],
46
+ paddingInline: d.space[4],
47
+ font: "inherit",
48
+ fontSize: d.textSize.sm,
49
+ fontWeight: d.fontWeight.medium,
50
+ color: d.color.text,
51
+ textAlign: "start",
52
+ transitionProperty: "background-color",
53
+ transitionDuration: d.motion.duration.fast,
54
+ transitionTimingFunction: d.motion.easeStandard,
55
+ "&::after": { ...t },
56
+ "&[aria-expanded=\"true\"]::after": { transform: "rotate(90deg)" },
57
+ "&[aria-expanded=\"true\"]:dir(rtl)::after": { transform: "rotate(-90deg)" },
58
+ "&:hover:not(:disabled):not([aria-disabled=\"true\"])": { backgroundColor: d.color.surfaceHover },
59
+ "&[aria-disabled=\"true\"]": { cursor: "default" },
60
+ "&:disabled": {
61
+ opacity: .55,
62
+ cursor: "not-allowed"
63
+ },
64
+ "&:focus-visible": { ...n },
65
+ [r]: {
66
+ transitionDuration: "0s",
67
+ "&::after": { transitionDuration: "0s" }
68
+ }
69
+ }), C = e({
70
+ paddingBlock: d.space[3],
71
+ paddingInline: d.space[4],
72
+ color: d.color.textMuted,
73
+ lineHeight: d.lineHeight.relaxed,
74
+ "&[hidden]": { display: "none" }
75
+ }), w = s(function({ value: e, defaultValue: t, onValueChange: n, type: r = "single", collapsible: o = !0, onKeyDown: s, ...c }, l) {
76
+ let [d, m] = a(e, t, n), h = u(() => {
77
+ let e = y(d, r), t = o || e.length > 1;
78
+ return {
79
+ openValues: e,
80
+ toggle: (n) => {
81
+ let i = e.includes(n);
82
+ (!i || t) && m(r === "multiple" ? i ? e.filter((e) => e !== n) : [...e, n] : i ? _ : n);
83
+ },
84
+ canCollapse: t
85
+ };
86
+ }, [
87
+ d,
88
+ m,
89
+ r,
90
+ o
91
+ ]), g = (e) => {
92
+ s?.(e), !e.defaultPrevented && i(e, e.currentTarget, "vertical", v);
93
+ };
94
+ return /* @__PURE__ */ f(p.Provider, {
95
+ value: h,
96
+ children: /* @__PURE__ */ f("div", {
97
+ ...c,
98
+ ref: l,
99
+ "data-ui": "accordion",
100
+ onKeyDown: g
101
+ })
102
+ });
103
+ }), T = s(function({ value: e, disabled: t = !1, ...n }, r) {
104
+ let { openValues: i } = h("Item"), a = l(), o = i.includes(e), s = u(() => ({
105
+ value: e,
106
+ disabled: t,
107
+ expanded: o,
108
+ triggerId: `${a}-trigger`,
109
+ panelId: `${a}-panel`
110
+ }), [
111
+ e,
112
+ t,
113
+ o,
114
+ a
115
+ ]);
116
+ return /* @__PURE__ */ f(m.Provider, {
117
+ value: s,
118
+ children: /* @__PURE__ */ f("div", {
119
+ ...n,
120
+ ref: r,
121
+ "data-ui": "accordion-item",
122
+ "data-state": o ? "open" : "closed",
123
+ "data-disabled": t ? "" : void 0,
124
+ css: b
125
+ })
126
+ });
127
+ }), E = s(function({ onClick: e, disabled: t, ...n }, r) {
128
+ let { toggle: i, canCollapse: a } = h("Trigger"), { value: o, disabled: s, expanded: c, triggerId: l, panelId: u } = g("Trigger"), d = c && !a, p = (t) => {
129
+ e?.(t), !t.defaultPrevented && i(o);
130
+ };
131
+ return /* @__PURE__ */ f("h3", {
132
+ "data-ui": "accordion-heading",
133
+ css: x,
134
+ children: /* @__PURE__ */ f("button", {
135
+ ...n,
136
+ ref: r,
137
+ type: "button",
138
+ id: l,
139
+ "data-ui": "accordion-trigger",
140
+ "data-state": c ? "open" : "closed",
141
+ "aria-expanded": c,
142
+ "aria-controls": u,
143
+ "aria-disabled": d || void 0,
144
+ disabled: s || t,
145
+ onClick: p,
146
+ css: S
147
+ })
148
+ });
149
+ }), D = s(function({ "aria-labelledby": e, ...t }, n) {
150
+ let { expanded: r, triggerId: i, panelId: a } = g("Panel"), o = [e, i].filter(Boolean).join(" ");
151
+ return /* @__PURE__ */ f("div", {
152
+ ...t,
153
+ ref: n,
154
+ role: "region",
155
+ id: a,
156
+ "aria-labelledby": o,
157
+ hidden: !r,
158
+ "data-ui": "accordion-panel",
159
+ "data-state": r ? "open" : "closed",
160
+ css: C
161
+ });
162
+ }), O = Object.assign(w, {
163
+ Item: T,
164
+ Trigger: E,
165
+ Panel: D
166
+ });
167
+ //#endregion
168
+ export { O as t };
@@ -0,0 +1 @@
1
+ export { t as Accordion } from "./accordion-Dl-kvgPQ.js";
@@ -0,0 +1,129 @@
1
+ import { t as e } from "./css-CW_HG55W.js";
2
+ import { n as t } from "./focus-ring-qOS3rPlM.js";
3
+ import { n } from "./media-8K3xDAxM.js";
4
+ import { t as r } from "./visually-hidden-BXVyhj0y.js";
5
+ import { t as i } from "./renderable-DwPvt1I8.js";
6
+ import { forwardRef as a } from "react";
7
+ import { vars as o } from "@jfrader/tokens/vars";
8
+ import { jsx as s, jsxs as c } from "@emotion/react/jsx-runtime";
9
+ //#region src/components/alert/alert.tsx
10
+ var l = {
11
+ info: "Information",
12
+ success: "Success",
13
+ warning: "Warning",
14
+ danger: "Error"
15
+ }, u = e({
16
+ display: "grid",
17
+ gap: o.space[1],
18
+ boxSizing: "border-box",
19
+ backgroundColor: o.color.surfaceRaised,
20
+ border: `1px solid ${o.color.border}`,
21
+ borderInlineStartWidth: "3px",
22
+ borderInlineStartStyle: "solid",
23
+ borderRadius: o.radius.md,
24
+ paddingBlock: o.space[3],
25
+ paddingInline: o.space[4],
26
+ fontFamily: o.font.sans,
27
+ lineHeight: o.lineHeight.base
28
+ }), d = e({
29
+ gridTemplateColumns: "minmax(0, 1fr) auto",
30
+ columnGap: o.space[3]
31
+ }), f = e({
32
+ display: "grid",
33
+ gap: o.space[1],
34
+ minInlineSize: 0,
35
+ gridColumn: 1,
36
+ gridRow: 1
37
+ }), p = {
38
+ info: e({ borderInlineStartColor: o.color.info }),
39
+ success: e({ borderInlineStartColor: o.color.success }),
40
+ warning: e({ borderInlineStartColor: o.color.warning }),
41
+ danger: e({ borderInlineStartColor: o.color.dangerText })
42
+ }, m = e({
43
+ gridColumn: 1,
44
+ fontSize: o.textSize.sm,
45
+ fontWeight: o.fontWeight.semibold,
46
+ color: o.color.text
47
+ }), h = e({
48
+ gridColumn: 1,
49
+ fontSize: o.textSize.sm,
50
+ color: o.color.textMuted
51
+ }), g = e({
52
+ gridColumn: 2,
53
+ gridRow: 1,
54
+ alignSelf: "start",
55
+ appearance: "none",
56
+ display: "inline-flex",
57
+ alignItems: "center",
58
+ justifyContent: "center",
59
+ minInlineSize: "24px",
60
+ minBlockSize: "24px",
61
+ margin: 0,
62
+ padding: 0,
63
+ border: "1px solid transparent",
64
+ borderRadius: o.radius.sm,
65
+ backgroundColor: "transparent",
66
+ fontFamily: "inherit",
67
+ fontSize: o.textSize.md,
68
+ lineHeight: 1,
69
+ color: o.color.textMuted,
70
+ cursor: "pointer",
71
+ transitionProperty: "background-color, color",
72
+ transitionDuration: o.motion.duration.fast,
73
+ transitionTimingFunction: o.motion.easeStandard,
74
+ "&:hover": {
75
+ backgroundColor: o.color.surfaceHover,
76
+ color: o.color.text
77
+ },
78
+ "&:focus-visible": { ...t },
79
+ [n]: { transitionDuration: "0s" }
80
+ }), _ = a(function({ tone: e = "info", toneLabel: t = l[e], title: n, children: a, onDismiss: o, dismissLabel: _ = "Dismiss", slotProps: v, className: y, ...b }, x) {
81
+ let S = o !== void 0;
82
+ return /* @__PURE__ */ c("div", {
83
+ ...b,
84
+ ref: x,
85
+ "data-ui": "alert",
86
+ "data-tone": e,
87
+ className: [y, v?.root?.className].filter(Boolean).join(" ") || void 0,
88
+ css: [
89
+ u,
90
+ p[e],
91
+ S && d,
92
+ v?.root?.css
93
+ ],
94
+ children: [/* @__PURE__ */ c("div", {
95
+ role: e === "danger" ? "alert" : "status",
96
+ "aria-atomic": "true",
97
+ css: f,
98
+ children: [
99
+ /* @__PURE__ */ s("span", {
100
+ css: r,
101
+ children: t
102
+ }),
103
+ i(n) && /* @__PURE__ */ s("div", {
104
+ className: v?.title?.className,
105
+ css: [m, v?.title?.css],
106
+ children: n
107
+ }),
108
+ i(a) && /* @__PURE__ */ s("div", {
109
+ className: v?.body?.className,
110
+ css: [h, v?.body?.css],
111
+ children: a
112
+ })
113
+ ]
114
+ }), S && /* @__PURE__ */ s("button", {
115
+ type: "button",
116
+ "data-ui": "alert-dismiss",
117
+ "aria-label": _,
118
+ onClick: () => o?.(),
119
+ className: v?.dismiss?.className,
120
+ css: [g, v?.dismiss?.css],
121
+ children: /* @__PURE__ */ s("span", {
122
+ "aria-hidden": !0,
123
+ children: "×"
124
+ })
125
+ })]
126
+ });
127
+ });
128
+ //#endregion
129
+ export { _ as t };
package/dist/alert.js ADDED
@@ -0,0 +1 @@
1
+ export { t as Alert } from "./alert-BzntPa_5.js";
@@ -0,0 +1,124 @@
1
+ import { t as e } from "./css-CW_HG55W.js";
2
+ import { forwardRef as t, useState as n } from "react";
3
+ import { vars as r } from "@jfrader/tokens/vars";
4
+ import { jsx as i, jsxs as a } from "@emotion/react/jsx-runtime";
5
+ //#region src/components/avatar/avatar.tsx
6
+ var o = 2, s = new Intl.Segmenter(void 0, { granularity: "grapheme" });
7
+ function c(e) {
8
+ let t = Array.from(s.segment(e), ({ segment: e }) => e), n = t[0] ?? "";
9
+ if (!/\p{Extended_Pictographic}/u.test(n)) return n;
10
+ let r = "";
11
+ for (let e of t) {
12
+ if (!/\p{Extended_Pictographic}/u.test(e)) break;
13
+ r += e;
14
+ }
15
+ return r;
16
+ }
17
+ function l(e) {
18
+ return e.trim().split(/\s+/).filter(Boolean).slice(0, o).map(c).join("").toLocaleUpperCase();
19
+ }
20
+ var u = e({
21
+ position: "relative",
22
+ display: "inline-flex",
23
+ alignItems: "center",
24
+ justifyContent: "center",
25
+ flexShrink: 0,
26
+ boxSizing: "border-box",
27
+ borderRadius: r.radius.full,
28
+ backgroundColor: r.color.surfaceHover,
29
+ color: r.color.text,
30
+ fontWeight: r.fontWeight.medium,
31
+ lineHeight: 1,
32
+ userSelect: "none",
33
+ verticalAlign: "middle"
34
+ }), d = {
35
+ sm: e({
36
+ inlineSize: r.space[6],
37
+ blockSize: r.space[6],
38
+ fontSize: r.textSize.xs
39
+ }),
40
+ md: e({
41
+ inlineSize: r.space[8],
42
+ blockSize: r.space[8],
43
+ fontSize: r.textSize.sm
44
+ }),
45
+ lg: e({
46
+ inlineSize: r.space[10],
47
+ blockSize: r.space[10],
48
+ fontSize: r.textSize.md
49
+ })
50
+ }, f = e({
51
+ display: "block",
52
+ inlineSize: "100%",
53
+ blockSize: "100%",
54
+ borderRadius: r.radius.full,
55
+ objectFit: "cover"
56
+ }), p = e({
57
+ position: "absolute",
58
+ insetBlockEnd: 0,
59
+ insetInlineEnd: 0,
60
+ inlineSize: "25%",
61
+ blockSize: "25%",
62
+ "&::before": {
63
+ content: "\"\"",
64
+ position: "absolute",
65
+ insetBlockStart: 0,
66
+ insetInlineStart: 0,
67
+ inlineSize: "100%",
68
+ blockSize: "100%",
69
+ boxSizing: "border-box",
70
+ borderRadius: r.radius.full,
71
+ boxShadow: `0 0 0 2px ${r.color.bg}`
72
+ }
73
+ }), m = {
74
+ online: e({ "&::before": { backgroundColor: r.color.success } }),
75
+ away: e({ "&::before": {
76
+ border: `2px solid ${r.color.warning}`,
77
+ backgroundColor: "transparent"
78
+ } }),
79
+ busy: e({ "&::before": {
80
+ backgroundColor: r.color.danger,
81
+ blockSize: "30%",
82
+ insetBlockStart: "35%"
83
+ } }),
84
+ offline: e({ "&::before": {
85
+ backgroundColor: r.color.textSubtle,
86
+ inlineSize: "60%",
87
+ blockSize: "60%",
88
+ insetBlockStart: "20%",
89
+ insetInlineStart: "20%"
90
+ } })
91
+ }, h = t(function({ name: e, src: t, size: r = "md", status: o, statusLabel: s, slotProps: c, ...h }, g) {
92
+ let [_, v] = n(), y = t !== void 0 && t !== "" && t !== _, b = o === void 0 ? e : `${e}, ${s ?? o}`;
93
+ return /* @__PURE__ */ a("span", {
94
+ ...h,
95
+ ref: g,
96
+ "data-ui": "avatar",
97
+ role: "img",
98
+ "aria-label": b,
99
+ css: [u, d[r]],
100
+ children: [y ? /* @__PURE__ */ i("img", {
101
+ src: t,
102
+ alt: "",
103
+ onError: () => v(t),
104
+ className: c?.image?.className,
105
+ css: [f, c?.image?.css]
106
+ }) : /* @__PURE__ */ i("span", {
107
+ "aria-hidden": "true",
108
+ className: c?.fallback?.className,
109
+ css: c?.fallback?.css,
110
+ children: l(e)
111
+ }), o !== void 0 && /* @__PURE__ */ i("span", {
112
+ "aria-hidden": "true",
113
+ "data-status": o,
114
+ className: c?.status?.className,
115
+ css: [
116
+ p,
117
+ m[o],
118
+ c?.status?.css
119
+ ]
120
+ })]
121
+ });
122
+ });
123
+ //#endregion
124
+ export { h as t };
package/dist/avatar.js ADDED
@@ -0,0 +1 @@
1
+ export { t as Avatar } from "./avatar-Dk2ES3ru.js";
@@ -0,0 +1,102 @@
1
+ import { t as e } from "./css-CW_HG55W.js";
2
+ import { forwardRef as t } from "react";
3
+ import { vars as n } from "@jfrader/tokens/vars";
4
+ import { jsx as r, jsxs as i } from "@emotion/react/jsx-runtime";
5
+ //#region src/components/badge/badge.tsx
6
+ var a = 99, o = e({
7
+ position: "relative",
8
+ display: "inline-flex",
9
+ flexShrink: 0,
10
+ verticalAlign: "middle"
11
+ }), s = e({
12
+ position: "absolute",
13
+ display: "flex",
14
+ alignItems: "center",
15
+ justifyContent: "center",
16
+ boxSizing: "border-box",
17
+ boxShadow: `0 0 0 2px ${n.color.bg}`,
18
+ fontWeight: n.fontWeight.medium,
19
+ lineHeight: 1,
20
+ whiteSpace: "nowrap",
21
+ pointerEvents: "none"
22
+ }), c = {
23
+ standard: e({
24
+ blockSize: n.space[5],
25
+ minInlineSize: n.space[5],
26
+ paddingInline: n.space[1],
27
+ fontSize: n.textSize.xs
28
+ }),
29
+ dot: e({
30
+ blockSize: n.space[2],
31
+ inlineSize: n.space[2],
32
+ borderRadius: n.radius.full
33
+ })
34
+ }, l = {
35
+ rectangular: e({ borderRadius: n.radius.sm }),
36
+ circular: e({ borderRadius: n.radius.full })
37
+ }, u = {
38
+ "top-start": e({
39
+ insetBlockStart: 0,
40
+ insetInlineStart: 0,
41
+ transform: "translate(-50%, -50%)",
42
+ "&:dir(rtl)": { transform: "translate(50%, -50%)" }
43
+ }),
44
+ "top-end": e({
45
+ insetBlockStart: 0,
46
+ insetInlineEnd: 0,
47
+ transform: "translate(50%, -50%)",
48
+ "&:dir(rtl)": { transform: "translate(-50%, -50%)" }
49
+ }),
50
+ "bottom-start": e({
51
+ insetBlockEnd: 0,
52
+ insetInlineStart: 0,
53
+ transform: "translate(-50%, 50%)",
54
+ "&:dir(rtl)": { transform: "translate(50%, 50%)" }
55
+ }),
56
+ "bottom-end": e({
57
+ insetBlockEnd: 0,
58
+ insetInlineEnd: 0,
59
+ transform: "translate(50%, 50%)",
60
+ "&:dir(rtl)": { transform: "translate(-50%, 50%)" }
61
+ })
62
+ }, d = {
63
+ accent: e({
64
+ backgroundColor: n.color.accent,
65
+ color: n.color.accentContrast
66
+ }),
67
+ danger: e({
68
+ backgroundColor: n.color.danger,
69
+ color: n.color.dangerContrast
70
+ }),
71
+ neutral: e({
72
+ backgroundColor: n.color.textMuted,
73
+ color: n.color.bg
74
+ })
75
+ }, f = t(function({ children: e, badgeContent: t, max: n = a, showZero: f = !1, invisible: p = !1, variant: m = "standard", tone: h = "accent", anchor: g, overlap: _ = "rectangular", slotProps: v, className: y, ...b }, x) {
76
+ let S = m === "dot", C = p || m !== "dot" && (t == null || t === !1 || t === 0 && !f), w = typeof t == "number" && t > n ? `${n}+` : t, T = `${g?.vertical ?? "top"}-${g?.horizontal ?? "end"}`, E = [y, v?.root?.className].filter(Boolean).join(" ") || void 0;
77
+ return /* @__PURE__ */ i("span", {
78
+ ...b,
79
+ ref: x,
80
+ "data-ui": "badge",
81
+ className: E,
82
+ css: [o, v?.root?.css],
83
+ children: [e, !C && /* @__PURE__ */ r("span", {
84
+ "data-ui": "badge-marker",
85
+ "data-variant": m,
86
+ "data-tone": h,
87
+ "aria-hidden": S ? "true" : void 0,
88
+ className: v?.badge?.className,
89
+ css: [
90
+ s,
91
+ c[m],
92
+ !S && l[_],
93
+ u[T],
94
+ d[h],
95
+ v?.badge?.css
96
+ ],
97
+ children: S ? null : w
98
+ })]
99
+ });
100
+ });
101
+ //#endregion
102
+ export { f as t };
package/dist/badge.js ADDED
@@ -0,0 +1 @@
1
+ export { t as Badge } from "./badge-DZefC7rm.js";