@misoto22/design 0.3.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 (191) hide show
  1. package/LICENSE +21 -0
  2. package/dist/components/Accordion/Accordion.d.ts +34 -0
  3. package/dist/components/Accordion/Accordion.js +37 -0
  4. package/dist/components/Accordion/Accordion.js.map +1 -0
  5. package/dist/components/Alert/Alert.d.ts +32 -0
  6. package/dist/components/Alert/Alert.js +49 -0
  7. package/dist/components/Alert/Alert.js.map +1 -0
  8. package/dist/components/AppShell/AppShell.d.ts +38 -0
  9. package/dist/components/AppShell/AppShell.js +92 -0
  10. package/dist/components/AppShell/AppShell.js.map +1 -0
  11. package/dist/components/Avatar/Avatar.d.ts +29 -0
  12. package/dist/components/Avatar/Avatar.js +39 -0
  13. package/dist/components/Avatar/Avatar.js.map +1 -0
  14. package/dist/components/Badge/Badge.d.ts +30 -0
  15. package/dist/components/Badge/Badge.js +29 -0
  16. package/dist/components/Badge/Badge.js.map +1 -0
  17. package/dist/components/Breadcrumb/Breadcrumb.d.ts +31 -0
  18. package/dist/components/Breadcrumb/Breadcrumb.js +31 -0
  19. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
  20. package/dist/components/Button/Button.d.ts +70 -0
  21. package/dist/components/Button/Button.js +81 -0
  22. package/dist/components/Button/Button.js.map +1 -0
  23. package/dist/components/Calendar/Calendar.d.ts +28 -0
  24. package/dist/components/Calendar/Calendar.js +87 -0
  25. package/dist/components/Calendar/Calendar.js.map +1 -0
  26. package/dist/components/Card/Card.d.ts +49 -0
  27. package/dist/components/Card/Card.js +64 -0
  28. package/dist/components/Card/Card.js.map +1 -0
  29. package/dist/components/Checkbox/Checkbox.d.ts +23 -0
  30. package/dist/components/Checkbox/Checkbox.js +24 -0
  31. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  32. package/dist/components/Collapsible/Collapsible.d.ts +31 -0
  33. package/dist/components/Collapsible/Collapsible.js +35 -0
  34. package/dist/components/Collapsible/Collapsible.js.map +1 -0
  35. package/dist/components/Combobox/Combobox.d.ts +63 -0
  36. package/dist/components/Combobox/Combobox.js +151 -0
  37. package/dist/components/Combobox/Combobox.js.map +1 -0
  38. package/dist/components/Command/Command.d.ts +98 -0
  39. package/dist/components/Command/Command.js +166 -0
  40. package/dist/components/Command/Command.js.map +1 -0
  41. package/dist/components/ContextMenu/ContextMenu.d.ts +38 -0
  42. package/dist/components/ContextMenu/ContextMenu.js +79 -0
  43. package/dist/components/ContextMenu/ContextMenu.js.map +1 -0
  44. package/dist/components/DatePicker/DatePicker.d.ts +98 -0
  45. package/dist/components/DatePicker/DatePicker.js +214 -0
  46. package/dist/components/DatePicker/DatePicker.js.map +1 -0
  47. package/dist/components/Dialog/Dialog.d.ts +48 -0
  48. package/dist/components/Dialog/Dialog.js +72 -0
  49. package/dist/components/Dialog/Dialog.js.map +1 -0
  50. package/dist/components/DropdownMenu/DropdownMenu.d.ts +49 -0
  51. package/dist/components/DropdownMenu/DropdownMenu.js +89 -0
  52. package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -0
  53. package/dist/components/EmptyState/EmptyState.d.ts +31 -0
  54. package/dist/components/EmptyState/EmptyState.js +30 -0
  55. package/dist/components/EmptyState/EmptyState.js.map +1 -0
  56. package/dist/components/ErrorState/ErrorState.d.ts +34 -0
  57. package/dist/components/ErrorState/ErrorState.js +32 -0
  58. package/dist/components/ErrorState/ErrorState.js.map +1 -0
  59. package/dist/components/Field/Field.d.ts +44 -0
  60. package/dist/components/Field/Field.js +54 -0
  61. package/dist/components/Field/Field.js.map +1 -0
  62. package/dist/components/FigureBand/FigureBand.d.ts +51 -0
  63. package/dist/components/FigureBand/FigureBand.js +52 -0
  64. package/dist/components/FigureBand/FigureBand.js.map +1 -0
  65. package/dist/components/FloatingIconButton/FloatingIconButton.d.ts +29 -0
  66. package/dist/components/FloatingIconButton/FloatingIconButton.js +32 -0
  67. package/dist/components/FloatingIconButton/FloatingIconButton.js.map +1 -0
  68. package/dist/components/Input/Input.d.ts +22 -0
  69. package/dist/components/Input/Input.js +21 -0
  70. package/dist/components/Input/Input.js.map +1 -0
  71. package/dist/components/Kbd/Kbd.d.ts +20 -0
  72. package/dist/components/Kbd/Kbd.js +21 -0
  73. package/dist/components/Kbd/Kbd.js.map +1 -0
  74. package/dist/components/LinkArrow/LinkArrow.d.ts +24 -0
  75. package/dist/components/LinkArrow/LinkArrow.js +24 -0
  76. package/dist/components/LinkArrow/LinkArrow.js.map +1 -0
  77. package/dist/components/NativeSelect/NativeSelect.d.ts +27 -0
  78. package/dist/components/NativeSelect/NativeSelect.js +46 -0
  79. package/dist/components/NativeSelect/NativeSelect.js.map +1 -0
  80. package/dist/components/NavItem/NavItem.d.ts +39 -0
  81. package/dist/components/NavItem/NavItem.js +31 -0
  82. package/dist/components/NavItem/NavItem.js.map +1 -0
  83. package/dist/components/Pagination/Pagination.d.ts +44 -0
  84. package/dist/components/Pagination/Pagination.js +109 -0
  85. package/dist/components/Pagination/Pagination.js.map +1 -0
  86. package/dist/components/Popover/Popover.d.ts +39 -0
  87. package/dist/components/Popover/Popover.js +57 -0
  88. package/dist/components/Popover/Popover.js.map +1 -0
  89. package/dist/components/Progress/Progress.d.ts +31 -0
  90. package/dist/components/Progress/Progress.js +45 -0
  91. package/dist/components/Progress/Progress.js.map +1 -0
  92. package/dist/components/RadioGroup/RadioGroup.d.ts +43 -0
  93. package/dist/components/RadioGroup/RadioGroup.js +43 -0
  94. package/dist/components/RadioGroup/RadioGroup.js.map +1 -0
  95. package/dist/components/ScrollArea/ScrollArea.d.ts +31 -0
  96. package/dist/components/ScrollArea/ScrollArea.js +54 -0
  97. package/dist/components/ScrollArea/ScrollArea.js.map +1 -0
  98. package/dist/components/SearchableMenu/SearchableMenu.d.ts +59 -0
  99. package/dist/components/SearchableMenu/SearchableMenu.js +79 -0
  100. package/dist/components/SearchableMenu/SearchableMenu.js.map +1 -0
  101. package/dist/components/Select/Select.d.ts +71 -0
  102. package/dist/components/Select/Select.js +114 -0
  103. package/dist/components/Select/Select.js.map +1 -0
  104. package/dist/components/Separator/Separator.d.ts +30 -0
  105. package/dist/components/Separator/Separator.js +35 -0
  106. package/dist/components/Separator/Separator.js.map +1 -0
  107. package/dist/components/Sheet/Sheet.d.ts +38 -0
  108. package/dist/components/Sheet/Sheet.js +68 -0
  109. package/dist/components/Sheet/Sheet.js.map +1 -0
  110. package/dist/components/Skeleton/Skeleton.d.ts +63 -0
  111. package/dist/components/Skeleton/Skeleton.js +44 -0
  112. package/dist/components/Skeleton/Skeleton.js.map +1 -0
  113. package/dist/components/Slider/Slider.d.ts +35 -0
  114. package/dist/components/Slider/Slider.js +52 -0
  115. package/dist/components/Slider/Slider.js.map +1 -0
  116. package/dist/components/Spinner/Spinner.d.ts +50 -0
  117. package/dist/components/Spinner/Spinner.js +48 -0
  118. package/dist/components/Spinner/Spinner.js.map +1 -0
  119. package/dist/components/StatusDot/StatusDot.d.ts +29 -0
  120. package/dist/components/StatusDot/StatusDot.js +44 -0
  121. package/dist/components/StatusDot/StatusDot.js.map +1 -0
  122. package/dist/components/StatusPill/StatusPill.d.ts +25 -0
  123. package/dist/components/StatusPill/StatusPill.js +31 -0
  124. package/dist/components/StatusPill/StatusPill.js.map +1 -0
  125. package/dist/components/Switch/Switch.d.ts +23 -0
  126. package/dist/components/Switch/Switch.js +23 -0
  127. package/dist/components/Switch/Switch.js.map +1 -0
  128. package/dist/components/Table/Table.d.ts +96 -0
  129. package/dist/components/Table/Table.js +136 -0
  130. package/dist/components/Table/Table.js.map +1 -0
  131. package/dist/components/Tabs/Tabs.d.ts +35 -0
  132. package/dist/components/Tabs/Tabs.js +48 -0
  133. package/dist/components/Tabs/Tabs.js.map +1 -0
  134. package/dist/components/Tag/Tag.d.ts +28 -0
  135. package/dist/components/Tag/Tag.js +22 -0
  136. package/dist/components/Tag/Tag.js.map +1 -0
  137. package/dist/components/Textarea/Textarea.d.ts +20 -0
  138. package/dist/components/Textarea/Textarea.js +32 -0
  139. package/dist/components/Textarea/Textarea.js.map +1 -0
  140. package/dist/components/Toast/Toast.d.ts +24 -0
  141. package/dist/components/Toast/Toast.js +41 -0
  142. package/dist/components/Toast/Toast.js.map +1 -0
  143. package/dist/components/ToggleGroup/ToggleGroup.d.ts +41 -0
  144. package/dist/components/ToggleGroup/ToggleGroup.js +78 -0
  145. package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -0
  146. package/dist/components/Tooltip/Tooltip.d.ts +43 -0
  147. package/dist/components/Tooltip/Tooltip.js +40 -0
  148. package/dist/components/Tooltip/Tooltip.js.map +1 -0
  149. package/dist/fonts/hanken-grotesk-300.woff2 +0 -0
  150. package/dist/fonts/hanken-grotesk-400.woff2 +0 -0
  151. package/dist/fonts/hanken-grotesk-500.woff2 +0 -0
  152. package/dist/fonts/hanken-grotesk-600.woff2 +0 -0
  153. package/dist/fonts/hanken-grotesk-700.woff2 +0 -0
  154. package/dist/fonts/ibm-plex-mono-400.woff2 +0 -0
  155. package/dist/fonts/ibm-plex-mono-500.woff2 +0 -0
  156. package/dist/fonts/ibm-plex-mono-600.woff2 +0 -0
  157. package/dist/fonts/newsreader-300.woff2 +0 -0
  158. package/dist/fonts/newsreader-400.woff2 +0 -0
  159. package/dist/fonts/newsreader-500.woff2 +0 -0
  160. package/dist/fonts/newsreader-600.woff2 +0 -0
  161. package/dist/fonts.css +96 -0
  162. package/dist/index.d.ts +77 -0
  163. package/dist/index.js +63 -0
  164. package/dist/index.js.map +1 -0
  165. package/dist/keyframes.css +212 -0
  166. package/dist/lib/cn.d.ts +21 -0
  167. package/dist/lib/cn.js +9 -0
  168. package/dist/lib/cn.js.map +1 -0
  169. package/dist/lib/control.d.ts +31 -0
  170. package/dist/lib/control.js +14 -0
  171. package/dist/lib/control.js.map +1 -0
  172. package/dist/lib/index.d.ts +4 -0
  173. package/dist/lib/index.js +11 -0
  174. package/dist/lib/index.js.map +1 -0
  175. package/dist/lib/overlay-container.d.ts +38 -0
  176. package/dist/lib/overlay-container.js +15 -0
  177. package/dist/lib/overlay-container.js.map +1 -0
  178. package/dist/lib/useSelectionIndicator.d.ts +29 -0
  179. package/dist/lib/useSelectionIndicator.js +45 -0
  180. package/dist/lib/useSelectionIndicator.js.map +1 -0
  181. package/dist/semantic.css +127 -0
  182. package/dist/styles.css +98 -0
  183. package/dist/themes.css +115 -0
  184. package/dist/tokens/brand.d.ts +47 -0
  185. package/dist/tokens/brand.js +38 -0
  186. package/dist/tokens/brand.js.map +1 -0
  187. package/dist/tokens.css +323 -0
  188. package/dist/tokens.d.ts +153 -0
  189. package/dist/tokens.js +766 -0
  190. package/dist/tokens.json +765 -0
  191. package/package.json +130 -0
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
4
+ import { cn } from "../../lib/cn.js";
5
+ import { useOverlayContainer } from "../../lib/overlay-container.js";
6
+ const TooltipProvider = TooltipPrimitive.Provider;
7
+ function Tooltip({
8
+ children,
9
+ content,
10
+ side = "top",
11
+ sideOffset = 6,
12
+ ...root
13
+ }) {
14
+ const container = useOverlayContainer();
15
+ return /* @__PURE__ */ jsxs(TooltipPrimitive.Root, { ...root, children: [
16
+ /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { asChild: true, children }),
17
+ /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { container: container ?? void 0, children: /* @__PURE__ */ jsx(
18
+ TooltipPrimitive.Content,
19
+ {
20
+ collisionBoundary: container ?? void 0,
21
+ collisionPadding: 8,
22
+ side,
23
+ sideOffset,
24
+ "data-m22-animated": true,
25
+ className: cn(
26
+ "z-(--z-toast) max-w-64 rounded-(--radius-sm) bg-(--feature-surface) px-2.5 py-1.5 font-mono text-[11px] leading-snug text-(--on-feature)",
27
+ "data-[state=delayed-open]:animate-[m22-fade-in_var(--duration-fast)_var(--ease)]"
28
+ ),
29
+ children: content
30
+ }
31
+ ) })
32
+ ] });
33
+ }
34
+ var Tooltip_default = Tooltip;
35
+ export {
36
+ Tooltip,
37
+ TooltipProvider,
38
+ Tooltip_default as default
39
+ };
40
+ //# sourceMappingURL=Tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["'use client'\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\nimport type { ComponentProps, ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\nimport { useOverlayContainer } from '../../lib/overlay-container'\n\n/**\n * Wrap the app — or the smallest subtree that has tooltips — once. Radix needs\n * it to share the open/close timing between neighbouring triggers, which is\n * what stops a row of icon buttons flashing a tooltip per hover.\n */\nexport const TooltipProvider = TooltipPrimitive.Provider\n\nexport interface TooltipProps\n extends Pick<ComponentProps<typeof TooltipPrimitive.Root>, 'open' | 'defaultOpen' | 'onOpenChange' | 'delayDuration'> {\n /** The element the tooltip describes. Must be focusable. */\n children: ReactNode\n /**\n * The tip. Keep it to a phrase — a tooltip is unreachable on touch and\n * invisible to a reader who is scanning, so anything a user NEEDS belongs on\n * the page instead.\n */\n content: ReactNode\n side?: ComponentProps<typeof TooltipPrimitive.Content>['side']\n sideOffset?: number\n}\n\n/**\n * A short label on hover and on focus.\n *\n * `asChild` on the trigger by design: the tooltip must not add a wrapper that\n * swallows the trigger's own focus ring or breaks a flex row. It also means the\n * child has to be focusable — a `<div>` trigger gets no keyboard tooltip, which\n * is the failure this API shape makes obvious rather than silent.\n *\n * Not a replacement for an accessible name. An icon-only button still needs its\n * own `aria-label`; the tooltip repeats that name for sighted pointer users.\n *\n * @example\n * <TooltipProvider>\n * <Tooltip content=\"Copy to clipboard\">\n * <Button iconOnly aria-label=\"Copy\"><Copy size={16} /></Button>\n * </Tooltip>\n * </TooltipProvider>\n */\nexport function Tooltip({\n children,\n content,\n side = 'top',\n sideOffset = 6,\n ...root\n}: TooltipProps) {\n const container = useOverlayContainer()\n\n return (\n <TooltipPrimitive.Root {...root}>\n <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={container ?? undefined}>\n <TooltipPrimitive.Content\n collisionBoundary={container ?? undefined}\n collisionPadding={8}\n side={side}\n sideOffset={sideOffset}\n data-m22-animated\n className={cn(\n 'z-(--z-toast) max-w-64 rounded-(--radius-sm) bg-(--feature-surface) px-2.5 py-1.5 font-mono text-[11px] leading-snug text-(--on-feature)',\n 'data-[state=delayed-open]:animate-[m22-fade-in_var(--duration-fast)_var(--ease)]',\n )}\n >\n {content}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n )\n}\n\nexport default Tooltip\n"],"mappings":";AAwDI,SACE,KADF;AAtDJ,YAAY,sBAAsB;AAElC,SAAS,UAAU;AACnB,SAAS,2BAA2B;AAO7B,MAAM,kBAAkB,iBAAiB;AAkCzC,SAAS,QAAQ;AAAA,EACtB;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,aAAa;AAAA,EACb,GAAG;AACL,GAAiB;AACf,QAAM,YAAY,oBAAoB;AAEtC,SACE,qBAAC,iBAAiB,MAAjB,EAAuB,GAAG,MACzB;AAAA,wBAAC,iBAAiB,SAAjB,EAAyB,SAAO,MAAE,UAAS;AAAA,IAC5C,oBAAC,iBAAiB,QAAjB,EAAwB,WAAW,aAAa,QAC/C;AAAA,MAAC,iBAAiB;AAAA,MAAjB;AAAA,QACD,mBAAmB,aAAa;AAAA,QAChC,kBAAkB;AAAA,QAChB;AAAA,QACA;AAAA,QACA,qBAAiB;AAAA,QACjB,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QAEC;AAAA;AAAA,IACH,GACF;AAAA,KACF;AAEJ;AAEA,IAAO,kBAAQ;","names":[]}
Binary file
Binary file
Binary file
Binary file
package/dist/fonts.css ADDED
@@ -0,0 +1,96 @@
1
+ /* GENERATED by scripts/vendor-fonts.mjs — do not edit by hand.
2
+ Vendored Latin webfaces for @misoto22/design, declared under the literal
3
+ family names the token layer falls back to. A host that loads these itself
4
+ (next/font, a CDN) sets --font-* and never reaches these rules.
5
+ Re-run: pnpm --filter @misoto22/design build:fonts */
6
+
7
+
8
+ /* ─── Hanken Grotesk — 5 weights ─── */
9
+ @font-face {
10
+ font-family: 'Hanken Grotesk';
11
+ font-style: normal;
12
+ font-weight: 300;
13
+ font-display: swap;
14
+ src: url('./fonts/hanken-grotesk-300.woff2') format('woff2');
15
+ }
16
+ @font-face {
17
+ font-family: 'Hanken Grotesk';
18
+ font-style: normal;
19
+ font-weight: 400;
20
+ font-display: swap;
21
+ src: url('./fonts/hanken-grotesk-400.woff2') format('woff2');
22
+ }
23
+ @font-face {
24
+ font-family: 'Hanken Grotesk';
25
+ font-style: normal;
26
+ font-weight: 500;
27
+ font-display: swap;
28
+ src: url('./fonts/hanken-grotesk-500.woff2') format('woff2');
29
+ }
30
+ @font-face {
31
+ font-family: 'Hanken Grotesk';
32
+ font-style: normal;
33
+ font-weight: 600;
34
+ font-display: swap;
35
+ src: url('./fonts/hanken-grotesk-600.woff2') format('woff2');
36
+ }
37
+ @font-face {
38
+ font-family: 'Hanken Grotesk';
39
+ font-style: normal;
40
+ font-weight: 700;
41
+ font-display: swap;
42
+ src: url('./fonts/hanken-grotesk-700.woff2') format('woff2');
43
+ }
44
+
45
+ /* ─── Newsreader — 4 weights ─── */
46
+ @font-face {
47
+ font-family: 'Newsreader';
48
+ font-style: normal;
49
+ font-weight: 300;
50
+ font-display: swap;
51
+ src: url('./fonts/newsreader-300.woff2') format('woff2');
52
+ }
53
+ @font-face {
54
+ font-family: 'Newsreader';
55
+ font-style: normal;
56
+ font-weight: 400;
57
+ font-display: swap;
58
+ src: url('./fonts/newsreader-400.woff2') format('woff2');
59
+ }
60
+ @font-face {
61
+ font-family: 'Newsreader';
62
+ font-style: normal;
63
+ font-weight: 500;
64
+ font-display: swap;
65
+ src: url('./fonts/newsreader-500.woff2') format('woff2');
66
+ }
67
+ @font-face {
68
+ font-family: 'Newsreader';
69
+ font-style: normal;
70
+ font-weight: 600;
71
+ font-display: swap;
72
+ src: url('./fonts/newsreader-600.woff2') format('woff2');
73
+ }
74
+
75
+ /* ─── IBM Plex Mono — 3 weights ─── */
76
+ @font-face {
77
+ font-family: 'IBM Plex Mono';
78
+ font-style: normal;
79
+ font-weight: 400;
80
+ font-display: swap;
81
+ src: url('./fonts/ibm-plex-mono-400.woff2') format('woff2');
82
+ }
83
+ @font-face {
84
+ font-family: 'IBM Plex Mono';
85
+ font-style: normal;
86
+ font-weight: 500;
87
+ font-display: swap;
88
+ src: url('./fonts/ibm-plex-mono-500.woff2') format('woff2');
89
+ }
90
+ @font-face {
91
+ font-family: 'IBM Plex Mono';
92
+ font-style: normal;
93
+ font-weight: 600;
94
+ font-display: swap;
95
+ src: url('./fonts/ibm-plex-mono-600.woff2') format('woff2');
96
+ }
@@ -0,0 +1,77 @@
1
+ export { OverlayContainer, OverlayContainerProps, useOverlayContainer } from './lib/overlay-container.js';
2
+ export { BRAND, BrandColor } from './tokens/brand.js';
3
+ export { cn } from './lib/cn.js';
4
+ export { CONTROL_BASE, CONTROL_BORDER, isInvalid } from './lib/control.js';
5
+ export { IndicatorStyle, useSelectionIndicator } from './lib/useSelectionIndicator.js';
6
+ export { Button, ButtonProps, ButtonSize, ButtonVariant } from './components/Button/Button.js';
7
+ export { FloatingIconButton, FloatingIconButtonProps } from './components/FloatingIconButton/FloatingIconButton.js';
8
+ export { Badge, BadgeProps, BadgeTone } from './components/Badge/Badge.js';
9
+ export { Tag, TagProps } from './components/Tag/Tag.js';
10
+ export { Kbd, KbdProps } from './components/Kbd/Kbd.js';
11
+ export { Avatar, AvatarProps } from './components/Avatar/Avatar.js';
12
+ export { StatusDot, StatusDotProps, StatusTone } from './components/StatusDot/StatusDot.js';
13
+ export { StatusPill, StatusPillProps } from './components/StatusPill/StatusPill.js';
14
+ export { EXTERNAL_LINK_ARROW, LinkArrow, LinkArrowProps } from './components/LinkArrow/LinkArrow.js';
15
+ export { Separator, SeparatorProps } from './components/Separator/Separator.js';
16
+ export { Figure, FigureBand, FigureBandProps } from './components/FigureBand/FigureBand.js';
17
+ export { Spinner, SpinnerProps } from './components/Spinner/Spinner.js';
18
+ export { Skeleton, SkeletonBlock, SkeletonCircle, SkeletonLine, SkeletonPage, SkeletonPageProps, SkeletonProps, SkeletonText, SkeletonTextProps } from './components/Skeleton/Skeleton.js';
19
+ export { Progress, ProgressProps } from './components/Progress/Progress.js';
20
+ export { Alert, AlertProps, AlertTone } from './components/Alert/Alert.js';
21
+ export { EmptyState, EmptyStateProps } from './components/EmptyState/EmptyState.js';
22
+ export { ERROR_ACTION_CLASS, ErrorState, ErrorStateProps } from './components/ErrorState/ErrorState.js';
23
+ export { Toaster } from './components/Toast/Toast.js';
24
+ export { Field, FieldProps } from './components/Field/Field.js';
25
+ export { Combobox, ComboboxOption, ComboboxProps } from './components/Combobox/Combobox.js';
26
+ export { DATE_PRESETS, DatePicker, DatePickerProps, DatePreset, DateRangePicker, DateRangePickerProps, RANGE_PRESETS } from './components/DatePicker/DatePicker.js';
27
+ export { Slider, SliderProps } from './components/Slider/Slider.js';
28
+ export { ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps } from './components/ToggleGroup/ToggleGroup.js';
29
+ export { Input, InputProps } from './components/Input/Input.js';
30
+ export { Textarea, TextareaProps } from './components/Textarea/Textarea.js';
31
+ export { Select, SelectGroup, SelectItem, SelectItemProps, SelectLabel, SelectProps, SelectRoot, SelectSeparator } from './components/Select/Select.js';
32
+ export { NativeSelect, NativeSelectProps } from './components/NativeSelect/NativeSelect.js';
33
+ export { Checkbox, CheckboxProps } from './components/Checkbox/Checkbox.js';
34
+ export { RadioGroup, RadioGroupItem, RadioGroupItemProps, RadioGroupProps } from './components/RadioGroup/RadioGroup.js';
35
+ export { Switch, SwitchProps } from './components/Switch/Switch.js';
36
+ export { Dialog, DialogClose, DialogContent, DialogContentProps, DialogTrigger } from './components/Dialog/Dialog.js';
37
+ export { DropdownMenu, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from './components/DropdownMenu/DropdownMenu.js';
38
+ export { Tooltip, TooltipProps, TooltipProvider } from './components/Tooltip/Tooltip.js';
39
+ export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverContentProps, PopoverTrigger } from './components/Popover/Popover.js';
40
+ export { Sheet, SheetClose, SheetContent, SheetContentProps, SheetSide, SheetTrigger } from './components/Sheet/Sheet.js';
41
+ export { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuItemProps, ContextMenuLabel, ContextMenuSeparator, ContextMenuTrigger } from './components/ContextMenu/ContextMenu.js';
42
+ export { Command, CommandDialog, CommandDialogProps, CommandEmpty, CommandFooter, CommandGroup, CommandHint, CommandHintProps, CommandInput, CommandItem, CommandItemProps, CommandList, CommandSeparator } from './components/Command/Command.js';
43
+ export { MenuAction, SearchableMenu, SearchableMenuProps } from './components/SearchableMenu/SearchableMenu.js';
44
+ export { Tabs, TabsContent, TabsList, TabsTrigger } from './components/Tabs/Tabs.js';
45
+ export { Accordion, AccordionItem, AccordionItemProps } from './components/Accordion/Accordion.js';
46
+ export { Collapsible, CollapsibleSection, CollapsibleSectionProps } from './components/Collapsible/Collapsible.js';
47
+ export { Breadcrumb, BreadcrumbProps, Crumb } from './components/Breadcrumb/Breadcrumb.js';
48
+ export { Pagination, PaginationProps, paginationRange } from './components/Pagination/Pagination.js';
49
+ export { NavItem, NavItemProps } from './components/NavItem/NavItem.js';
50
+ export { Card, CardBody, CardFooter, CardHeader, CardProps, CardTitle } from './components/Card/Card.js';
51
+ export { SortDirection, TBody, TD, TDProps, TH, THProps, THead, TR, Table, TableAlign, TableBorders, TableProps } from './components/Table/Table.js';
52
+ export { Calendar, CalendarProps } from './components/Calendar/Calendar.js';
53
+ export { ScrollArea, ScrollAreaProps } from './components/ScrollArea/ScrollArea.js';
54
+ export { AppShell, AppShellProps } from './components/AppShell/AppShell.js';
55
+ export { DateRange } from 'react-day-picker';
56
+ export { toast } from 'sonner';
57
+ import 'react';
58
+ import 'clsx';
59
+ import '@radix-ui/react-avatar';
60
+ import '@radix-ui/react-progress';
61
+ import 'lucide-react';
62
+ import '@radix-ui/react-slider';
63
+ import '@radix-ui/react-toggle-group';
64
+ import '@radix-ui/react-select';
65
+ import '@radix-ui/react-checkbox';
66
+ import '@radix-ui/react-radio-group';
67
+ import '@radix-ui/react-switch';
68
+ import '@radix-ui/react-dialog';
69
+ import '@radix-ui/react-dropdown-menu';
70
+ import '@radix-ui/react-tooltip';
71
+ import '@radix-ui/react-popover';
72
+ import '@radix-ui/react-context-menu';
73
+ import 'cmdk';
74
+ import '@radix-ui/react-tabs';
75
+ import '@radix-ui/react-accordion';
76
+ import '@radix-ui/react-collapsible';
77
+ import '@radix-ui/react-scroll-area';
package/dist/index.js ADDED
@@ -0,0 +1,63 @@
1
+ export * from "./lib/overlay-container.js";
2
+ import { BRAND } from "./tokens/brand.js";
3
+ import { cn } from "./lib/cn.js";
4
+ import { CONTROL_BASE, CONTROL_BORDER, isInvalid } from "./lib/control.js";
5
+ import { useSelectionIndicator } from "./lib/useSelectionIndicator.js";
6
+ export * from "./components/Button/Button.js";
7
+ export * from "./components/FloatingIconButton/FloatingIconButton.js";
8
+ export * from "./components/Badge/Badge.js";
9
+ export * from "./components/Tag/Tag.js";
10
+ export * from "./components/Kbd/Kbd.js";
11
+ export * from "./components/Avatar/Avatar.js";
12
+ export * from "./components/StatusDot/StatusDot.js";
13
+ export * from "./components/StatusPill/StatusPill.js";
14
+ export * from "./components/LinkArrow/LinkArrow.js";
15
+ export * from "./components/Separator/Separator.js";
16
+ export * from "./components/FigureBand/FigureBand.js";
17
+ export * from "./components/Spinner/Spinner.js";
18
+ export * from "./components/Skeleton/Skeleton.js";
19
+ export * from "./components/Progress/Progress.js";
20
+ export * from "./components/Alert/Alert.js";
21
+ export * from "./components/EmptyState/EmptyState.js";
22
+ export * from "./components/ErrorState/ErrorState.js";
23
+ export * from "./components/Toast/Toast.js";
24
+ export * from "./components/Field/Field.js";
25
+ export * from "./components/Combobox/Combobox.js";
26
+ export * from "./components/DatePicker/DatePicker.js";
27
+ export * from "./components/Slider/Slider.js";
28
+ export * from "./components/ToggleGroup/ToggleGroup.js";
29
+ export * from "./components/Input/Input.js";
30
+ export * from "./components/Textarea/Textarea.js";
31
+ export * from "./components/Select/Select.js";
32
+ export * from "./components/NativeSelect/NativeSelect.js";
33
+ export * from "./components/Checkbox/Checkbox.js";
34
+ export * from "./components/RadioGroup/RadioGroup.js";
35
+ export * from "./components/Switch/Switch.js";
36
+ export * from "./components/Dialog/Dialog.js";
37
+ export * from "./components/DropdownMenu/DropdownMenu.js";
38
+ export * from "./components/Tooltip/Tooltip.js";
39
+ export * from "./components/Popover/Popover.js";
40
+ export * from "./components/Sheet/Sheet.js";
41
+ export * from "./components/ContextMenu/ContextMenu.js";
42
+ export * from "./components/Command/Command.js";
43
+ export * from "./components/SearchableMenu/SearchableMenu.js";
44
+ export * from "./components/Tabs/Tabs.js";
45
+ export * from "./components/Accordion/Accordion.js";
46
+ export * from "./components/Collapsible/Collapsible.js";
47
+ export * from "./components/Breadcrumb/Breadcrumb.js";
48
+ export * from "./components/Pagination/Pagination.js";
49
+ export * from "./components/NavItem/NavItem.js";
50
+ export * from "./components/Card/Card.js";
51
+ export * from "./components/Table/Table.js";
52
+ export * from "./components/Calendar/Calendar.js";
53
+ export * from "./components/ScrollArea/ScrollArea.js";
54
+ export * from "./components/AppShell/AppShell.js";
55
+ export {
56
+ BRAND,
57
+ CONTROL_BASE,
58
+ CONTROL_BORDER,
59
+ cn,
60
+ isInvalid,
61
+ useSelectionIndicator
62
+ };
63
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @misoto22/design — public entry.\n *\n * Components export from here; the look ships separately as CSS:\n *\n * import '@misoto22/design/styles.css' // compiled Tailwind + tokens + fonts\n *\n * or, for an app that already compiles Tailwind itself, the portable layers on\n * their own:\n *\n * import '@misoto22/design/tokens.css' // primitives\n * import '@misoto22/design/semantic.css' // roles\n * import '@misoto22/design/keyframes.css' // motion\n *\n * Everything below is a consumer contract. Adding an export is cheap; changing\n * or removing one is a breaking change (DESIGN-API-001).\n */\n\n// ─── Utilities ───\nexport * from './lib/overlay-container'\n\n// ─── Tokens ───\nexport { BRAND } from './tokens/brand'\nexport type { BrandColor } from './tokens/brand'\n\n// ─── Utilities ───\nexport { cn } from './lib/cn'\nexport { CONTROL_BASE, CONTROL_BORDER, isInvalid } from './lib/control'\nexport { useSelectionIndicator } from './lib/useSelectionIndicator'\nexport type { IndicatorStyle } from './lib/useSelectionIndicator'\n\n// ─── Actions ───\nexport * from './components/Button/Button'\nexport * from './components/FloatingIconButton/FloatingIconButton'\n\n// ─── Display ───\nexport * from './components/Badge/Badge'\nexport * from './components/Tag/Tag'\nexport * from './components/Kbd/Kbd'\nexport * from './components/Avatar/Avatar'\nexport * from './components/StatusDot/StatusDot'\nexport * from './components/StatusPill/StatusPill'\nexport * from './components/LinkArrow/LinkArrow'\nexport * from './components/Separator/Separator'\nexport * from './components/FigureBand/FigureBand'\n\n// ─── Feedback ───\nexport * from './components/Spinner/Spinner'\nexport * from './components/Skeleton/Skeleton'\nexport * from './components/Progress/Progress'\nexport * from './components/Alert/Alert'\nexport * from './components/EmptyState/EmptyState'\nexport * from './components/ErrorState/ErrorState'\nexport * from './components/Toast/Toast'\n\n// ─── Forms ───\nexport * from './components/Field/Field'\nexport * from './components/Combobox/Combobox'\nexport * from './components/DatePicker/DatePicker'\nexport * from './components/Slider/Slider'\nexport * from './components/ToggleGroup/ToggleGroup'\nexport * from './components/Input/Input'\nexport * from './components/Textarea/Textarea'\nexport * from './components/Select/Select'\nexport * from './components/NativeSelect/NativeSelect'\nexport * from './components/Checkbox/Checkbox'\nexport * from './components/RadioGroup/RadioGroup'\nexport * from './components/Switch/Switch'\n\n// ─── Overlays ───\nexport * from './components/Dialog/Dialog'\nexport * from './components/DropdownMenu/DropdownMenu'\nexport * from './components/Tooltip/Tooltip'\nexport * from './components/Popover/Popover'\nexport * from './components/Sheet/Sheet'\nexport * from './components/ContextMenu/ContextMenu'\nexport * from './components/Command/Command'\nexport * from './components/SearchableMenu/SearchableMenu'\n\n// ─── Navigation ───\nexport * from './components/Tabs/Tabs'\nexport * from './components/Accordion/Accordion'\nexport * from './components/Collapsible/Collapsible'\nexport * from './components/Breadcrumb/Breadcrumb'\nexport * from './components/Pagination/Pagination'\nexport * from './components/NavItem/NavItem'\n\n// ─── Surfaces / layout ───\nexport * from './components/Card/Card'\nexport * from './components/Table/Table'\nexport * from './components/Calendar/Calendar'\nexport * from './components/ScrollArea/ScrollArea'\nexport * from './components/AppShell/AppShell'\n"],"mappings":"AAmBA,cAAc;AAGd,SAAS,aAAa;AAItB,SAAS,UAAU;AACnB,SAAS,cAAc,gBAAgB,iBAAiB;AACxD,SAAS,6BAA6B;AAItC,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -0,0 +1,212 @@
1
+ /* ==========================================================================
2
+ MOTION — the system's named animations
3
+ --------------------------------------------------------------------------
4
+ Portable, like tokens.css: plain CSS, no Tailwind. Every component that
5
+ animates reaches for one of these rather than declaring its own, so the
6
+ whole system arrives and leaves on the same curve.
7
+
8
+ Durations are NOT baked in here — a keyframe says what moves, a call site
9
+ says how fast, using --fast / --mid / --slow. Reduced motion is honoured in
10
+ one place, at the bottom.
11
+ ========================================================================== */
12
+
13
+ /* A surface arriving in place — a panel, a menu, a tab's contents. Short and
14
+ small: the page did not change, only part of it. */
15
+ @keyframes m22-panel-in {
16
+ from {
17
+ opacity: 0;
18
+ transform: translateY(4px);
19
+ }
20
+ to {
21
+ opacity: 1;
22
+ transform: none;
23
+ }
24
+ }
25
+
26
+ /* An ANCHORED panel arriving, growing from wherever its trigger is.
27
+ Radix puts that point on the wrapper as --radix-popper-transform-origin; the
28
+ call site passes it down. Origin is what makes this read as an animation
29
+ rather than as a flicker: four pixels of travel over 130ms is technically
30
+ motion and perceptually nothing, which is what "the menu has no animation"
31
+ turned out to mean. */
32
+ @keyframes m22-pop-in {
33
+ from {
34
+ opacity: 0;
35
+ transform: scale(0.96) translateY(-2px);
36
+ }
37
+ to {
38
+ opacity: 1;
39
+ transform: none;
40
+ }
41
+ }
42
+
43
+ /* And leaving. A panel that vanishes on the frame the pointer lands elsewhere
44
+ reads as a bug in the page rather than as a thing that closed. */
45
+ @keyframes m22-pop-out {
46
+ from {
47
+ opacity: 1;
48
+ transform: none;
49
+ }
50
+ to {
51
+ opacity: 0;
52
+ transform: scale(0.97) translateY(-2px);
53
+ }
54
+ }
55
+
56
+ /* A page arriving. Longer travel than a panel, because more of the view is
57
+ being replaced. */
58
+ @keyframes m22-route-in {
59
+ from {
60
+ opacity: 0;
61
+ transform: translateY(12px);
62
+ }
63
+ to {
64
+ opacity: 1;
65
+ transform: none;
66
+ }
67
+ }
68
+
69
+ /* An overlay's ground. No travel — a scrim does not slide, it appears. */
70
+ @keyframes m22-fade-in {
71
+ from {
72
+ opacity: 0;
73
+ }
74
+ to {
75
+ opacity: 1;
76
+ }
77
+ }
78
+
79
+ @keyframes m22-fade-out {
80
+ from {
81
+ opacity: 1;
82
+ }
83
+ to {
84
+ opacity: 0;
85
+ }
86
+ }
87
+
88
+ /* A toast entering from the edge it is docked to. */
89
+ @keyframes m22-slide-in-right {
90
+ from {
91
+ opacity: 0;
92
+ transform: translateX(12px);
93
+ }
94
+ to {
95
+ opacity: 1;
96
+ transform: none;
97
+ }
98
+ }
99
+
100
+ /* The system's "working" pulse — a dimming, not a shimmer. A skeleton that
101
+ shimmers implies a light source the White Reset does not have. */
102
+ @keyframes m22-pulse {
103
+ 0% {
104
+ opacity: 0.6;
105
+ }
106
+ 50% {
107
+ opacity: 1;
108
+ }
109
+ 100% {
110
+ opacity: 0.6;
111
+ }
112
+ }
113
+
114
+ /* The determinate/indeterminate bar's sweep. Travels 1.6× its own width so the
115
+ bar clears the track completely at each end. */
116
+ @keyframes m22-sweep {
117
+ 0% {
118
+ transform: translateX(-100%);
119
+ }
120
+ 100% {
121
+ transform: translateX(400%);
122
+ }
123
+ }
124
+
125
+ /* The spinner. A rotation, and only a rotation — the arc that makes it read as
126
+ a spinner is drawn by the component's own conic gradient, not animated. */
127
+ @keyframes m22-spin {
128
+ to {
129
+ transform: rotate(360deg);
130
+ }
131
+ }
132
+
133
+ /* The three-dot "thinking" run, staggered by delay at the call site. */
134
+ @keyframes m22-bounce-dot {
135
+ 0%,
136
+ 80%,
137
+ 100% {
138
+ opacity: 0.25;
139
+ transform: translateY(0);
140
+ }
141
+ 40% {
142
+ opacity: 1;
143
+ transform: translateY(-3px);
144
+ }
145
+ }
146
+
147
+ /* A live indicator's halo. Grows and dissolves; never loops a hard edge. */
148
+ @keyframes m22-halo {
149
+ 0% {
150
+ transform: scale(1);
151
+ opacity: 0.55;
152
+ }
153
+ 70% {
154
+ transform: scale(2.6);
155
+ opacity: 0;
156
+ }
157
+ 100% {
158
+ opacity: 0;
159
+ }
160
+ }
161
+
162
+ /* A disclosure panel opening and closing. Radix measures the panel and
163
+ publishes its height as --radix-accordion-content-height, so the panel
164
+ animates to its REAL height rather than to a guessed max-height — which is
165
+ what makes a long answer open at the same speed as a short one instead of
166
+ sitting still for half the duration. */
167
+ @keyframes m22-accordion-down {
168
+ from {
169
+ height: 0;
170
+ }
171
+ to {
172
+ height: var(--radix-accordion-content-height);
173
+ }
174
+ }
175
+
176
+ @keyframes m22-accordion-up {
177
+ from {
178
+ height: var(--radix-accordion-content-height);
179
+ }
180
+ to {
181
+ height: 0;
182
+ }
183
+ }
184
+
185
+ /* The same idea for a lone disclosure. Radix publishes the measured height as
186
+ --radix-collapsible-content-height. */
187
+ @keyframes m22-collapsible-down {
188
+ from {
189
+ height: 0;
190
+ }
191
+ to {
192
+ height: var(--radix-collapsible-content-height);
193
+ }
194
+ }
195
+
196
+ @keyframes m22-collapsible-up {
197
+ from {
198
+ height: var(--radix-collapsible-content-height);
199
+ }
200
+ to {
201
+ height: 0;
202
+ }
203
+ }
204
+
205
+ /* One place, not per-component. A user who has asked for less motion gets the
206
+ end state immediately rather than a faster version of the same move. */
207
+ @media (prefers-reduced-motion: reduce) {
208
+ [class*='m22-anim'],
209
+ [data-m22-animated] {
210
+ animation: none !important;
211
+ }
212
+ }
@@ -0,0 +1,21 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ /**
4
+ * Join class names, and let the LAST one win.
5
+ *
6
+ * Every component in this package ends its class list with the caller's
7
+ * `className`, which is the only way an override is expressible. With plain
8
+ * `clsx` that override does not actually override: `clsx('px-6', 'px-2')` emits
9
+ * both, and which one applies is decided by the order Tailwind happened to emit
10
+ * the two utilities into the stylesheet — not by the call site. A caller
11
+ * tightening a button's padding therefore worked or did not depending on a
12
+ * detail neither side can see.
13
+ *
14
+ * `twMerge` resolves conflicts by utility GROUP, so `px-2` replaces `px-6`,
15
+ * `text-(--ink-2)` replaces `text-(--ink)`, and unrelated classes are left
16
+ * alone. Use this everywhere a caller's `className` is merged; `clsx` alone is
17
+ * still right for building a conditional list that no caller extends.
18
+ */
19
+ declare function cn(...inputs: ClassValue[]): string;
20
+
21
+ export { cn };
package/dist/lib/cn.js ADDED
@@ -0,0 +1,9 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
6
+ export {
7
+ cn
8
+ };
9
+ //# sourceMappingURL=cn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/cn.ts"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\n/**\n * Join class names, and let the LAST one win.\n *\n * Every component in this package ends its class list with the caller's\n * `className`, which is the only way an override is expressible. With plain\n * `clsx` that override does not actually override: `clsx('px-6', 'px-2')` emits\n * both, and which one applies is decided by the order Tailwind happened to emit\n * the two utilities into the stylesheet — not by the call site. A caller\n * tightening a button's padding therefore worked or did not depending on a\n * detail neither side can see.\n *\n * `twMerge` resolves conflicts by utility GROUP, so `px-2` replaces `px-6`,\n * `text-(--ink-2)` replaces `text-(--ink)`, and unrelated classes are left\n * alone. Use this everywhere a caller's `className` is merged; `clsx` alone is\n * still right for building a conditional list that no caller extends.\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs))\n}\n"],"mappings":"AAAA,SAAS,YAA6B;AACtC,SAAS,eAAe;AAkBjB,SAAS,MAAM,QAA8B;AAClD,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;","names":[]}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The one text-control look, shared by Input, Textarea and Select.
3
+ *
4
+ * These three had each carried their own copy of the class string. Three copies
5
+ * drift: the padding stayed in step, but the focus treatment and the disabled
6
+ * opacity did not, and a form ended up with a select that dimmed differently
7
+ * from the input beside it. One export, three consumers.
8
+ *
9
+ * The padding comes from the density tokens, so a subtree marked
10
+ * `data-density="compact"` tightens its fields along with its buttons.
11
+ *
12
+ * The border COLOUR is deliberately not in here. It is toggled per control so
13
+ * the invalid state reliably wins over the resting border rather than relying
14
+ * on which utility Tailwind happened to emit last.
15
+ */
16
+ declare const CONTROL_BASE = "w-full rounded-(--radius) border bg-(--paper) px-(--field-px) py-(--field-py) text-sm text-(--ink) transition-colors duration-(--duration-fast) placeholder:text-(--ink-3-aa) hover:border-(--rule-hard) focus:border-(--ink) disabled:opacity-(--disabled-opacity) disabled:pointer-events-none";
17
+ /** Resting vs invalid border, named so a call site never writes the colour. */
18
+ declare const CONTROL_BORDER: {
19
+ readonly resting: "border-(--rule-2)";
20
+ readonly invalid: "border-(--danger)";
21
+ };
22
+ /**
23
+ * Reads the invalid state from either spelling.
24
+ *
25
+ * `invalid` is the ergonomic prop; `aria-invalid` is what a form library sets.
26
+ * A control that honours only one of them silently loses the error styling for
27
+ * whichever half of the ecosystem it did not anticipate.
28
+ */
29
+ declare function isInvalid(invalid?: boolean, ariaInvalid?: boolean | 'true' | 'false' | string): boolean;
30
+
31
+ export { CONTROL_BASE, CONTROL_BORDER, isInvalid };
@@ -0,0 +1,14 @@
1
+ const CONTROL_BASE = "w-full rounded-(--radius) border bg-(--paper) px-(--field-px) py-(--field-py) text-sm text-(--ink) transition-colors duration-(--duration-fast) placeholder:text-(--ink-3-aa) hover:border-(--rule-hard) focus:border-(--ink) disabled:opacity-(--disabled-opacity) disabled:pointer-events-none";
2
+ const CONTROL_BORDER = {
3
+ resting: "border-(--rule-2)",
4
+ invalid: "border-(--danger)"
5
+ };
6
+ function isInvalid(invalid, ariaInvalid) {
7
+ return invalid === true || ariaInvalid === true || ariaInvalid === "true";
8
+ }
9
+ export {
10
+ CONTROL_BASE,
11
+ CONTROL_BORDER,
12
+ isInvalid
13
+ };
14
+ //# sourceMappingURL=control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/control.ts"],"sourcesContent":["/**\n * The one text-control look, shared by Input, Textarea and Select.\n *\n * These three had each carried their own copy of the class string. Three copies\n * drift: the padding stayed in step, but the focus treatment and the disabled\n * opacity did not, and a form ended up with a select that dimmed differently\n * from the input beside it. One export, three consumers.\n *\n * The padding comes from the density tokens, so a subtree marked\n * `data-density=\"compact\"` tightens its fields along with its buttons.\n *\n * The border COLOUR is deliberately not in here. It is toggled per control so\n * the invalid state reliably wins over the resting border rather than relying\n * on which utility Tailwind happened to emit last.\n */\nexport const CONTROL_BASE =\n 'w-full rounded-(--radius) border bg-(--paper) px-(--field-px) py-(--field-py) text-sm text-(--ink) transition-colors duration-(--duration-fast) placeholder:text-(--ink-3-aa) hover:border-(--rule-hard) focus:border-(--ink) disabled:opacity-(--disabled-opacity) disabled:pointer-events-none'\n\n/** Resting vs invalid border, named so a call site never writes the colour. */\nexport const CONTROL_BORDER = {\n resting: 'border-(--rule-2)',\n invalid: 'border-(--danger)',\n} as const\n\n/**\n * Reads the invalid state from either spelling.\n *\n * `invalid` is the ergonomic prop; `aria-invalid` is what a form library sets.\n * A control that honours only one of them silently loses the error styling for\n * whichever half of the ecosystem it did not anticipate.\n */\nexport function isInvalid(invalid?: boolean, ariaInvalid?: boolean | 'true' | 'false' | string): boolean {\n return invalid === true || ariaInvalid === true || ariaInvalid === 'true'\n}\n"],"mappings":"AAeO,MAAM,eACX;AAGK,MAAM,iBAAiB;AAAA,EAC5B,SAAS;AAAA,EACT,SAAS;AACX;AASO,SAAS,UAAU,SAAmB,aAA4D;AACvG,SAAO,YAAY,QAAQ,gBAAgB,QAAQ,gBAAgB;AACrE;","names":[]}
@@ -0,0 +1,4 @@
1
+ export { cn } from './cn.js';
2
+ export { CONTROL_BASE, CONTROL_BORDER, isInvalid } from './control.js';
3
+ export { IndicatorStyle, useSelectionIndicator } from './useSelectionIndicator.js';
4
+ import 'clsx';
@@ -0,0 +1,11 @@
1
+ import { cn } from "./cn.js";
2
+ import { CONTROL_BASE, CONTROL_BORDER, isInvalid } from "./control.js";
3
+ import { useSelectionIndicator } from "./useSelectionIndicator.js";
4
+ export {
5
+ CONTROL_BASE,
6
+ CONTROL_BORDER,
7
+ cn,
8
+ isInvalid,
9
+ useSelectionIndicator
10
+ };
11
+ //# sourceMappingURL=index.js.map