@openwarelabs/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 (144) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +100 -2
  3. package/dist/components/Accordion/Accordion.d.cts +54 -0
  4. package/dist/components/Accordion/Accordion.d.ts +54 -0
  5. package/dist/components/Alert/Alert.d.cts +18 -0
  6. package/dist/components/Alert/Alert.d.ts +18 -0
  7. package/dist/components/Avatar/Avatar.d.cts +14 -0
  8. package/dist/components/Avatar/Avatar.d.ts +14 -0
  9. package/dist/components/Avatar/AvatarGroup.d.cts +28 -0
  10. package/dist/components/Avatar/AvatarGroup.d.ts +28 -0
  11. package/dist/components/Badge/Badge.d.cts +13 -0
  12. package/dist/components/Badge/Badge.d.ts +13 -0
  13. package/dist/components/Breadcrumbs/Breadcrumbs.d.cts +33 -0
  14. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +33 -0
  15. package/dist/components/Button/Button.d.cts +42 -0
  16. package/dist/components/Button/Button.d.ts +42 -0
  17. package/dist/components/Button/ButtonGroup.d.cts +33 -0
  18. package/dist/components/Button/ButtonGroup.d.ts +33 -0
  19. package/dist/components/Calendar/Calendar.d.cts +31 -0
  20. package/dist/components/Calendar/Calendar.d.ts +31 -0
  21. package/dist/components/Calendar/DatePicker.d.cts +21 -0
  22. package/dist/components/Calendar/DatePicker.d.ts +21 -0
  23. package/dist/components/Calendar/dates.d.cts +15 -0
  24. package/dist/components/Calendar/dates.d.ts +15 -0
  25. package/dist/components/Card/Card.d.cts +18 -0
  26. package/dist/components/Card/Card.d.ts +18 -0
  27. package/dist/components/Checkbox/Checkbox.d.cts +59 -0
  28. package/dist/components/Checkbox/Checkbox.d.ts +59 -0
  29. package/dist/components/ChoiceCard/ChoiceCard.d.cts +14 -0
  30. package/dist/components/ChoiceCard/ChoiceCard.d.ts +14 -0
  31. package/dist/components/CodeBlock/CodeBlock.d.cts +50 -0
  32. package/dist/components/CodeBlock/CodeBlock.d.ts +50 -0
  33. package/dist/components/ColorPicker/ColorPicker.d.cts +62 -0
  34. package/dist/components/ColorPicker/ColorPicker.d.ts +62 -0
  35. package/dist/components/Combobox/Combobox.d.cts +42 -0
  36. package/dist/components/Combobox/Combobox.d.ts +42 -0
  37. package/dist/components/CommandPalette/CommandPalette.d.cts +27 -0
  38. package/dist/components/CommandPalette/CommandPalette.d.ts +27 -0
  39. package/dist/components/CommandPalette/filterCommands.d.cts +3 -0
  40. package/dist/components/CommandPalette/filterCommands.d.ts +3 -0
  41. package/dist/components/Dialog/Dialog.d.cts +42 -0
  42. package/dist/components/Dialog/Dialog.d.ts +42 -0
  43. package/dist/components/Drawer/Drawer.d.cts +23 -0
  44. package/dist/components/Drawer/Drawer.d.ts +23 -0
  45. package/dist/components/EmptyState/EmptyState.d.cts +18 -0
  46. package/dist/components/EmptyState/EmptyState.d.ts +18 -0
  47. package/dist/components/Field/Field.d.cts +18 -0
  48. package/dist/components/Field/Field.d.ts +18 -0
  49. package/dist/components/FileDropZone/FileDropZone.d.cts +29 -0
  50. package/dist/components/FileDropZone/FileDropZone.d.ts +29 -0
  51. package/dist/components/FileTree/FileTree.d.cts +29 -0
  52. package/dist/components/FileTree/FileTree.d.ts +29 -0
  53. package/dist/components/Input/Input.d.cts +18 -0
  54. package/dist/components/Input/Input.d.ts +18 -0
  55. package/dist/components/InputOTP/InputOTP.d.cts +31 -0
  56. package/dist/components/InputOTP/InputOTP.d.ts +31 -0
  57. package/dist/components/Kbd/Kbd.d.cts +5 -0
  58. package/dist/components/Kbd/Kbd.d.ts +5 -0
  59. package/dist/components/Layout/Layout.d.cts +50 -0
  60. package/dist/components/Layout/Layout.d.ts +50 -0
  61. package/dist/components/Marketing/Marketing.d.cts +39 -0
  62. package/dist/components/Marketing/Marketing.d.ts +39 -0
  63. package/dist/components/Menu/Menu.d.cts +43 -0
  64. package/dist/components/Menu/Menu.d.ts +43 -0
  65. package/dist/components/NavList/NavList.d.cts +27 -0
  66. package/dist/components/NavList/NavList.d.ts +27 -0
  67. package/dist/components/NumberField/NumberField.d.cts +23 -0
  68. package/dist/components/NumberField/NumberField.d.ts +23 -0
  69. package/dist/components/Pagination/Pagination.d.cts +24 -0
  70. package/dist/components/Pagination/Pagination.d.ts +24 -0
  71. package/dist/components/Popover/Popover.d.cts +30 -0
  72. package/dist/components/Popover/Popover.d.ts +30 -0
  73. package/dist/components/Progress/Progress.d.cts +41 -0
  74. package/dist/components/Progress/Progress.d.ts +41 -0
  75. package/dist/components/RadioGroup/RadioGroup.d.cts +36 -0
  76. package/dist/components/RadioGroup/RadioGroup.d.ts +36 -0
  77. package/dist/components/SearchField/SearchField.d.cts +17 -0
  78. package/dist/components/SearchField/SearchField.d.ts +17 -0
  79. package/dist/components/SegmentedControl/SegmentedControl.d.cts +32 -0
  80. package/dist/components/SegmentedControl/SegmentedControl.d.ts +32 -0
  81. package/dist/components/Select/Select.d.cts +40 -0
  82. package/dist/components/Select/Select.d.ts +40 -0
  83. package/dist/components/Skeleton/Skeleton.d.cts +26 -0
  84. package/dist/components/Skeleton/Skeleton.d.ts +26 -0
  85. package/dist/components/Slider/Slider.d.cts +33 -0
  86. package/dist/components/Slider/Slider.d.ts +33 -0
  87. package/dist/components/Spinner/Spinner.d.cts +14 -0
  88. package/dist/components/Spinner/Spinner.d.ts +14 -0
  89. package/dist/components/Stat/Stat.d.cts +20 -0
  90. package/dist/components/Stat/Stat.d.ts +20 -0
  91. package/dist/components/Steps/Steps.d.cts +27 -0
  92. package/dist/components/Steps/Steps.d.ts +27 -0
  93. package/dist/components/Switch/Switch.d.cts +9 -0
  94. package/dist/components/Switch/Switch.d.ts +9 -0
  95. package/dist/components/Table/Table.d.cts +55 -0
  96. package/dist/components/Table/Table.d.ts +55 -0
  97. package/dist/components/Tabs/Tabs.d.cts +35 -0
  98. package/dist/components/Tabs/Tabs.d.ts +35 -0
  99. package/dist/components/Tag/Tag.d.cts +40 -0
  100. package/dist/components/Tag/Tag.d.ts +40 -0
  101. package/dist/components/Textarea/Textarea.d.cts +12 -0
  102. package/dist/components/Textarea/Textarea.d.ts +12 -0
  103. package/dist/components/Toast/Toast.d.cts +41 -0
  104. package/dist/components/Toast/Toast.d.ts +41 -0
  105. package/dist/components/Tooltip/Tooltip.d.cts +19 -0
  106. package/dist/components/Tooltip/Tooltip.d.ts +19 -0
  107. package/dist/components.css +5236 -0
  108. package/dist/fonts.css +3 -0
  109. package/dist/hooks/useControllableState.d.cts +5 -0
  110. package/dist/hooks/useControllableState.d.ts +5 -0
  111. package/dist/hooks/useFloating.d.cts +26 -0
  112. package/dist/hooks/useFloating.d.ts +26 -0
  113. package/dist/hooks/useIndicator.d.cts +8 -0
  114. package/dist/hooks/useIndicator.d.ts +8 -0
  115. package/dist/hooks/useMenuKeyboard.d.cts +12 -0
  116. package/dist/hooks/useMenuKeyboard.d.ts +12 -0
  117. package/dist/hooks/useModalDialog.d.cts +9 -0
  118. package/dist/hooks/useModalDialog.d.ts +9 -0
  119. package/dist/hooks/usePresence.d.cts +13 -0
  120. package/dist/hooks/usePresence.d.ts +13 -0
  121. package/dist/icons.d.cts +33 -0
  122. package/dist/icons.d.ts +33 -0
  123. package/dist/index.cjs +4622 -0
  124. package/dist/index.cjs.map +7 -0
  125. package/dist/index.d.cts +114 -0
  126. package/dist/index.d.ts +114 -0
  127. package/dist/index.js +4650 -0
  128. package/dist/index.js.map +7 -0
  129. package/dist/openware-ui.iife.js +8 -0
  130. package/dist/styles.css +5664 -0
  131. package/dist/tailwind.css +145 -0
  132. package/dist/tokens.css +427 -0
  133. package/dist/tokens.json +1163 -0
  134. package/dist/utils/brand.d.cts +30 -0
  135. package/dist/utils/brand.d.ts +30 -0
  136. package/dist/utils/copyText.d.cts +2 -0
  137. package/dist/utils/copyText.d.ts +2 -0
  138. package/dist/utils/cx.d.cts +4 -0
  139. package/dist/utils/cx.d.ts +4 -0
  140. package/dist/utils/resizeTextArea.d.cts +2 -0
  141. package/dist/utils/resizeTextArea.d.ts +2 -0
  142. package/dist/utils/text.d.cts +4 -0
  143. package/dist/utils/text.d.ts +4 -0
  144. package/package.json +83 -4
@@ -0,0 +1,12 @@
1
+ import { type TextareaHTMLAttributes } from "react";
2
+ export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
3
+ /** Grows with its text, up to `autoGrowMaxHeight`, then scrolls. */
4
+ autoGrow?: boolean;
5
+ /** The tallest an auto-growing box gets. A number is pixels. Default 180. */
6
+ autoGrowMaxHeight?: number | string;
7
+ /** Borderless and transparent, for use inside your own field container (a chat composer). */
8
+ bare?: boolean;
9
+ isInvalid?: boolean;
10
+ }
11
+ /** A multi-line text field, 72px tall at least; it can grow with its text. */
12
+ export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -0,0 +1,41 @@
1
+ import { toast, type ExternalToast, type ToasterProps as SonnerToasterProps } from "sonner";
2
+ /**
3
+ * Shows a toast; needs one <Toaster /> on the page. This is sonner's `toast`:
4
+ * `toast("Copied")`, `toast.success("Saved", { description })`, `toast.error(…)`, `toast.warning(…)`, `toast.info(…)`,
5
+ * `toast.loading("Deploying…")`, `toast.promise(save(), { loading, success, error })`, `toast.dismiss(id)`.
6
+ * Pass `action: { label: "Undo", onClick }` for a button, and reuse an `id` to replace a toast.
7
+ */
8
+ export { toast };
9
+ /** Everything a toast takes besides its message: description, action, cancel, id, duration, icon, onDismiss… */
10
+ export type ToastOptions = ExternalToast;
11
+ export interface ToasterProps {
12
+ /** @default "bottom-center" */
13
+ position?: SonnerToasterProps["position"];
14
+ /** Shows every toast in full, instead of a stack that fans out on hover.
15
+ * @default false */
16
+ expand?: boolean;
17
+ /** How many show at once; the rest wait their turn.
18
+ * @default 3 */
19
+ visibleToasts?: number;
20
+ /** Milliseconds before a toast goes. A toast's own `duration` wins; Infinity keeps it until closed.
21
+ * @default 6000 */
22
+ duration?: number;
23
+ /** A ✕ on each toast.
24
+ * @default true */
25
+ closeButton?: boolean;
26
+ /** Distance from the edge of the window, in pixels.
27
+ * @default 16 */
28
+ offset?: number;
29
+ /** Gap between toasts when the stack is open, in pixels.
30
+ * @default 10 */
31
+ gap?: number;
32
+ /** For a second toaster that only shows toasts sent with the same `toasterId`. */
33
+ id?: string;
34
+ className?: string;
35
+ }
36
+ /**
37
+ * Where toasts appear: sonner's toaster in Openware's look. New toasts stack on top of each other; hovering
38
+ * fans the stack out, a swipe dismisses one, and they pause while hovered or focused. Render one near the
39
+ * root of the app. It keeps itself above modal dialogs, so a toast fired from a dialog shows over it.
40
+ */
41
+ export declare function Toaster({ position, expand, visibleToasts, duration, closeButton, offset, gap, id, className, }: ToasterProps): import("react").JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { toast, type ExternalToast, type ToasterProps as SonnerToasterProps } from "sonner";
2
+ /**
3
+ * Shows a toast; needs one <Toaster /> on the page. This is sonner's `toast`:
4
+ * `toast("Copied")`, `toast.success("Saved", { description })`, `toast.error(…)`, `toast.warning(…)`, `toast.info(…)`,
5
+ * `toast.loading("Deploying…")`, `toast.promise(save(), { loading, success, error })`, `toast.dismiss(id)`.
6
+ * Pass `action: { label: "Undo", onClick }` for a button, and reuse an `id` to replace a toast.
7
+ */
8
+ export { toast };
9
+ /** Everything a toast takes besides its message: description, action, cancel, id, duration, icon, onDismiss… */
10
+ export type ToastOptions = ExternalToast;
11
+ export interface ToasterProps {
12
+ /** @default "bottom-center" */
13
+ position?: SonnerToasterProps["position"];
14
+ /** Shows every toast in full, instead of a stack that fans out on hover.
15
+ * @default false */
16
+ expand?: boolean;
17
+ /** How many show at once; the rest wait their turn.
18
+ * @default 3 */
19
+ visibleToasts?: number;
20
+ /** Milliseconds before a toast goes. A toast's own `duration` wins; Infinity keeps it until closed.
21
+ * @default 6000 */
22
+ duration?: number;
23
+ /** A ✕ on each toast.
24
+ * @default true */
25
+ closeButton?: boolean;
26
+ /** Distance from the edge of the window, in pixels.
27
+ * @default 16 */
28
+ offset?: number;
29
+ /** Gap between toasts when the stack is open, in pixels.
30
+ * @default 10 */
31
+ gap?: number;
32
+ /** For a second toaster that only shows toasts sent with the same `toasterId`. */
33
+ id?: string;
34
+ className?: string;
35
+ }
36
+ /**
37
+ * Where toasts appear: sonner's toaster in Openware's look. New toasts stack on top of each other; hovering
38
+ * fans the stack out, a swipe dismisses one, and they pause while hovered or focused. Render one near the
39
+ * root of the app. It keeps itself above modal dialogs, so a toast fired from a dialog shows over it.
40
+ */
41
+ export declare function Toaster({ position, expand, visibleToasts, duration, closeButton, offset, gap, id, className, }: ToasterProps): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { type ReactNode } from "react";
2
+ export interface TooltipProps {
3
+ /** A few words. */
4
+ label: ReactNode;
5
+ /** The thing it explains: usually an icon-only Button with the same words as its aria-label. */
6
+ children: ReactNode;
7
+ /** Which side it prefers; it flips when there's no room.
8
+ * @default "top" */
9
+ placement?: "top" | "bottom";
10
+ /** Milliseconds of hovering before it shows. Moving to a neighbour while one is showing skips the wait.
11
+ * @default 400 */
12
+ delay?: number;
13
+ }
14
+ /**
15
+ * A small dark label above its child on hover or keyboard focus. It's for sighted users only: the child
16
+ * carries the same words for screen readers (an aria-label, or visually hidden text), so they aren't read twice.
17
+ * It sits in the top layer, so scroll areas and dialogs can't clip it.
18
+ */
19
+ export declare function Tooltip({ children, label, placement, delay }: TooltipProps): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { type ReactNode } from "react";
2
+ export interface TooltipProps {
3
+ /** A few words. */
4
+ label: ReactNode;
5
+ /** The thing it explains: usually an icon-only Button with the same words as its aria-label. */
6
+ children: ReactNode;
7
+ /** Which side it prefers; it flips when there's no room.
8
+ * @default "top" */
9
+ placement?: "top" | "bottom";
10
+ /** Milliseconds of hovering before it shows. Moving to a neighbour while one is showing skips the wait.
11
+ * @default 400 */
12
+ delay?: number;
13
+ }
14
+ /**
15
+ * A small dark label above its child on hover or keyboard focus. It's for sighted users only: the child
16
+ * carries the same words for screen readers (an aria-label, or visually hidden text), so they aren't read twice.
17
+ * It sits in the top layer, so scroll areas and dialogs can't clip it.
18
+ */
19
+ export declare function Tooltip({ children, label, placement, delay }: TooltipProps): import("react").JSX.Element;