@glyphui/ui 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/chart.d.ts +202 -0
  2. package/dist/chart.js +457 -0
  3. package/dist/data-table.js +3 -2
  4. package/dist/{field-CCecIzdq.js → field-CWZ_FdkD.js} +2 -1
  5. package/dist/{field-context-B6WOcK5m.js → field-context-anGPYXbW.js} +2 -56
  6. package/dist/form.js +3 -2
  7. package/dist/index.d.ts +2285 -241
  8. package/dist/index.js +2819 -266
  9. package/dist/{states-Rp8wZ_jH.js → states-DR-OoDT-.js} +2 -1
  10. package/dist/tv-DBAGlgXJ.js +58 -0
  11. package/package.json +17 -2
  12. package/src/components/accordion/accordion.styles.ts +4 -4
  13. package/src/components/calendar/calendar.styles.ts +50 -0
  14. package/src/components/calendar/calendar.tsx +84 -0
  15. package/src/components/calendar/index.ts +3 -0
  16. package/src/components/carousel/carousel.styles.ts +43 -0
  17. package/src/components/carousel/carousel.tsx +278 -0
  18. package/src/components/carousel/index.ts +13 -0
  19. package/src/components/collapsible/collapsible.tsx +66 -0
  20. package/src/components/collapsible/index.ts +6 -0
  21. package/src/components/context-menu/context-menu.styles.ts +19 -0
  22. package/src/components/context-menu/context-menu.tsx +226 -0
  23. package/src/components/context-menu/index.ts +19 -0
  24. package/src/components/copy-button/copy-button.tsx +117 -0
  25. package/src/components/copy-button/index.ts +1 -0
  26. package/src/components/date-picker/date-picker.styles.ts +42 -0
  27. package/src/components/date-picker/date-picker.tsx +322 -0
  28. package/src/components/date-picker/index.ts +8 -0
  29. package/src/components/file-upload/file-upload.styles.ts +43 -0
  30. package/src/components/file-upload/file-upload.tsx +343 -0
  31. package/src/components/file-upload/index.ts +10 -0
  32. package/src/components/hover-card/hover-card.tsx +41 -0
  33. package/src/components/hover-card/index.ts +1 -0
  34. package/src/components/input-otp/index.ts +10 -0
  35. package/src/components/input-otp/input-otp.styles.ts +38 -0
  36. package/src/components/input-otp/input-otp.tsx +116 -0
  37. package/src/components/modal/index.ts +2 -0
  38. package/src/components/modal/modal.styles.ts +18 -0
  39. package/src/components/modal/modal.tsx +86 -0
  40. package/src/components/navigation-menu/index.ts +14 -0
  41. package/src/components/navigation-menu/navigation-menu.styles.ts +48 -0
  42. package/src/components/navigation-menu/navigation-menu.tsx +198 -0
  43. package/src/components/number-input/index.ts +2 -0
  44. package/src/components/number-input/number-input.styles.ts +41 -0
  45. package/src/components/number-input/number-input.tsx +211 -0
  46. package/src/components/password-input/index.ts +7 -0
  47. package/src/components/password-input/password-input.styles.ts +30 -0
  48. package/src/components/password-input/password-input.tsx +127 -0
  49. package/src/components/resizable/index.ts +9 -0
  50. package/src/components/resizable/resizable.styles.ts +28 -0
  51. package/src/components/resizable/resizable.tsx +69 -0
  52. package/src/components/sheet/sheet.styles.ts +7 -7
  53. package/src/components/stepper/index.ts +2 -0
  54. package/src/components/stepper/stepper.styles.ts +74 -0
  55. package/src/components/stepper/stepper.tsx +138 -0
  56. package/src/components/tag-input/index.ts +2 -0
  57. package/src/components/tag-input/tag-input.styles.ts +39 -0
  58. package/src/components/tag-input/tag-input.tsx +198 -0
  59. package/src/components/timeline/index.ts +8 -0
  60. package/src/components/timeline/timeline.styles.ts +56 -0
  61. package/src/components/timeline/timeline.tsx +91 -0
  62. package/src/components/toggle/index.ts +9 -0
  63. package/src/components/toggle/toggle.styles.ts +39 -0
  64. package/src/components/toggle/toggle.tsx +61 -0
  65. package/src/components/tree-view/index.ts +2 -0
  66. package/src/components/tree-view/tree-view.styles.ts +42 -0
  67. package/src/components/tree-view/tree-view.tsx +274 -0
  68. package/src/components/visually-hidden/index.ts +1 -0
  69. package/src/components/visually-hidden/visually-hidden.tsx +10 -0
  70. package/src/index.ts +20 -0
  71. package/src/patterns/chart/chart-parts.tsx +171 -0
  72. package/src/patterns/chart/chart.styles.ts +35 -0
  73. package/src/patterns/chart/chart.tsx +369 -0
  74. package/src/patterns/chart/index.ts +13 -0
  75. package/styles.css +16 -0
@@ -1,40 +1,8 @@
1
1
  "use client";
2
- import { textTokens } from "@glyphui/tokens";
2
+ import { a as themedBorder, o as transition, r as focusRing, s as useComponentConfig, t as tv } from "./tv-DBAGlgXJ.js";
3
3
  import { Slot } from "radix-ui";
4
4
  import { Fragment, createContext, useContext } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
- import { createTV } from "tailwind-variants";
7
- //#region src/provider/glyph-context.ts
8
- const GlyphContext = createContext(null);
9
- /** The active theme and app-level settings. Must be used under `GlyphProvider`. */
10
- function useGlyph() {
11
- const value = useContext(GlyphContext);
12
- if (!value) throw new Error("useGlyph must be used inside <GlyphProvider>.");
13
- return value;
14
- }
15
- /** The router-aware link component configured on `GlyphProvider`. */
16
- function useLinkComponent() {
17
- return useContext(GlyphContext)?.linkComponent ?? "a";
18
- }
19
- //#endregion
20
- //#region src/hooks/use-component-config.ts
21
- /**
22
- * Applies the theme's per-component settings (`theme.components[name]`):
23
- * fills unset variant props from `defaultVariants` and returns the extra slot classes.
24
- * Every styled component calls this first.
25
- */
26
- function useComponentConfig(name, props) {
27
- const override = (useContext(GlyphContext)?.theme)?.components[name];
28
- if (!override) return [props, {}];
29
- let merged = props;
30
- const defaults = override.defaultVariants;
31
- if (defaults) {
32
- merged = { ...props };
33
- for (const [key, value] of Object.entries(defaults)) if (merged[key] === void 0) merged[key] = value;
34
- }
35
- return [merged, override.className ?? {}];
36
- }
37
- //#endregion
38
6
  //#region src/internal/icons.tsx
39
7
  function Icon({ children, ...props }) {
40
8
  return /* @__PURE__ */ jsx("svg", {
@@ -123,28 +91,6 @@ const AlertIcon = (p) => /* @__PURE__ */ jsxs(Icon, {
123
91
  }), /* @__PURE__ */ jsx("path", { d: "M12 8v4M12 16h.01" })]
124
92
  });
125
93
  //#endregion
126
- //#region src/utils/styles.ts
127
- /** Shared class fragments. Kept as literals so Tailwind's scanner picks them up. */
128
- const focusRing = "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background";
129
- const themedBorder = "border-(length:--glyph-border-width)";
130
- const transition = "transition-[color,background-color,border-color,box-shadow,transform,opacity] duration-(--glyph-duration-base) ease-standard";
131
- /** Popover surfaces: Select, Tooltip-like menus. */
132
- const popover = "z-50 overflow-hidden rounded-[min(var(--radius-md),var(--radius-lg))] border-(length:--glyph-border-width) border-border bg-raised text-foreground shadow-lg animate-pop-in";
133
- //#endregion
134
- //#region src/utils/tw-merge-config.ts
135
- /**
136
- * Teaches tailwind-merge about Glyph's custom utilities so `cn('text-h1', 'text-small')`
137
- * keeps only the last size instead of treating `text-h1` as a color.
138
- */
139
- const twMergeConfig = { extend: { theme: {
140
- text: [...textTokens],
141
- radius: ["pill"]
142
- } } };
143
- //#endregion
144
- //#region src/utils/tv.ts
145
- /** `tailwind-variants` preconfigured with Glyph's merge rules. All component styles use this. */
146
- const tv = createTV({ twMergeConfig });
147
- //#endregion
148
94
  //#region src/components/spinner/spinner.styles.ts
149
95
  const spinnerStyles = tv({
150
96
  slots: {
@@ -318,4 +264,4 @@ function useFieldControl(props) {
318
264
  };
319
265
  }
320
266
  //#endregion
321
- export { useGlyph as A, MenuIcon as C, XIcon as D, SearchIcon as E, useComponentConfig as O, InboxIcon as S, PanelLeftIcon as T, CheckIcon as _, buttonStyles as a, ChevronRightIcon as b, tv as c, popover as d, themedBorder as f, ArrowUpIcon as g, ArrowDownIcon as h, IconButton as i, useLinkComponent as j, GlyphContext as k, twMergeConfig as l, AlertIcon as m, useFieldControl as n, Spinner as o, transition as p, Button as r, spinnerStyles as s, FieldContext as t, focusRing as u, ChevronDownIcon as v, MinusIcon as w, ChevronsUpDownIcon as x, ChevronLeftIcon as y };
267
+ export { MenuIcon as _, buttonStyles as a, SearchIcon as b, AlertIcon as c, CheckIcon as d, ChevronDownIcon as f, InboxIcon as g, ChevronsUpDownIcon as h, IconButton as i, ArrowDownIcon as l, ChevronRightIcon as m, useFieldControl as n, Spinner as o, ChevronLeftIcon as p, Button as r, spinnerStyles as s, FieldContext as t, ArrowUpIcon as u, MinusIcon as v, XIcon as x, PanelLeftIcon as y };
package/dist/form.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use client";
2
- import { c as tv, m as AlertIcon, r as Button } from "./field-context-B6WOcK5m.js";
3
- import { t as Field } from "./field-CCecIzdq.js";
2
+ import { t as tv } from "./tv-DBAGlgXJ.js";
3
+ import { c as AlertIcon, r as Button } from "./field-context-anGPYXbW.js";
4
+ import { t as Field } from "./field-CWZ_FdkD.js";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  import { standardSchemaResolver } from "@hookform/resolvers/standard-schema";
6
7
  import { Controller, FormProvider, useForm as useForm$1, useFormState } from "react-hook-form";