@myghf/ui 0.2.0 → 0.4.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 (72) hide show
  1. package/README.md +27 -106
  2. package/dist/components/alert/Alert.vue.d.ts +46 -0
  3. package/dist/components/alert/Alert.vue.d.ts.map +1 -0
  4. package/dist/components/avatar/Avatar.vue.d.ts +12 -0
  5. package/dist/components/avatar/Avatar.vue.d.ts.map +1 -0
  6. package/dist/components/button/Button.vue.d.ts +11 -4
  7. package/dist/components/button/Button.vue.d.ts.map +1 -1
  8. package/dist/components/date-picker/DatePicker.vue.d.ts +24 -1
  9. package/dist/components/date-picker/DatePicker.vue.d.ts.map +1 -1
  10. package/dist/components/drawer/Drawer.vue.d.ts +54 -0
  11. package/dist/components/drawer/Drawer.vue.d.ts.map +1 -0
  12. package/dist/components/dropdown-menu/DropdownMenuGroup.vue.d.ts +18 -0
  13. package/dist/components/dropdown-menu/DropdownMenuGroup.vue.d.ts.map +1 -0
  14. package/dist/components/dropdown-menu/DropdownMenuItem.vue.d.ts +5 -1
  15. package/dist/components/dropdown-menu/DropdownMenuItem.vue.d.ts.map +1 -1
  16. package/dist/components/dropdown-menu/DropdownMenuLabel.vue.d.ts +18 -0
  17. package/dist/components/dropdown-menu/DropdownMenuLabel.vue.d.ts.map +1 -0
  18. package/dist/components/dropdown-menu/DropdownMenuSeparator.vue.d.ts +3 -0
  19. package/dist/components/dropdown-menu/DropdownMenuSeparator.vue.d.ts.map +1 -0
  20. package/dist/components/form-field/FormDescription.vue.d.ts +22 -0
  21. package/dist/components/form-field/FormDescription.vue.d.ts.map +1 -0
  22. package/dist/components/form-field/FormField.vue.d.ts +37 -0
  23. package/dist/components/form-field/FormField.vue.d.ts.map +1 -0
  24. package/dist/components/form-field/FormMessage.vue.d.ts +22 -0
  25. package/dist/components/form-field/FormMessage.vue.d.ts.map +1 -0
  26. package/dist/components/input/Input.vue.d.ts +8 -0
  27. package/dist/components/input/Input.vue.d.ts.map +1 -1
  28. package/dist/components/input-number/InputNumber.vue.d.ts +31 -0
  29. package/dist/components/input-number/InputNumber.vue.d.ts.map +1 -0
  30. package/dist/components/label/Label.vue.d.ts +24 -0
  31. package/dist/components/label/Label.vue.d.ts.map +1 -0
  32. package/dist/components/select/Select.vue.d.ts +4 -0
  33. package/dist/components/select/Select.vue.d.ts.map +1 -1
  34. package/dist/components/skeleton/Skeleton.vue.d.ts +51 -0
  35. package/dist/components/skeleton/Skeleton.vue.d.ts.map +1 -0
  36. package/dist/components/spinner/Spinner.vue.d.ts +13 -0
  37. package/dist/components/spinner/Spinner.vue.d.ts.map +1 -0
  38. package/dist/components/tag/Tag.vue.d.ts +4 -28
  39. package/dist/components/tag/Tag.vue.d.ts.map +1 -1
  40. package/dist/components/textarea/Textarea.vue.d.ts +9 -1
  41. package/dist/components/textarea/Textarea.vue.d.ts.map +1 -1
  42. package/dist/components/theme-toggle/ThemeToggle.vue.d.ts +10 -0
  43. package/dist/components/theme-toggle/ThemeToggle.vue.d.ts.map +1 -0
  44. package/dist/components/toast/Toast.vue.d.ts +12 -0
  45. package/dist/components/toast/Toast.vue.d.ts.map +1 -0
  46. package/dist/components/toast/Toaster.vue.d.ts +33 -0
  47. package/dist/components/toast/Toaster.vue.d.ts.map +1 -0
  48. package/dist/components/toast/useToast.d.ts +44 -0
  49. package/dist/components/toast/useToast.d.ts.map +1 -0
  50. package/dist/index.d.ts +29 -0
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +1643 -448
  53. package/dist/index.js.map +1 -1
  54. package/dist/lib/date.d.ts +7 -0
  55. package/dist/lib/date.d.ts.map +1 -1
  56. package/dist/lib/formField.d.ts +27 -0
  57. package/dist/lib/formField.d.ts.map +1 -0
  58. package/dist/lib/locale.d.ts +6 -0
  59. package/dist/lib/locale.d.ts.map +1 -0
  60. package/dist/lib/number.d.ts +16 -0
  61. package/dist/lib/number.d.ts.map +1 -0
  62. package/dist/lib/theme.d.ts +36 -0
  63. package/dist/lib/theme.d.ts.map +1 -0
  64. package/dist/lib/tones.d.ts +9 -0
  65. package/dist/lib/tones.d.ts.map +1 -0
  66. package/dist/nuxt.d.ts +14 -0
  67. package/dist/nuxt.d.ts.map +1 -0
  68. package/dist/nuxt.js +32 -0
  69. package/dist/nuxt.js.map +1 -0
  70. package/dist/tailwindPreset.js +1 -0
  71. package/dist/tokens.css +13 -0
  72. package/package.json +23 -1
@@ -7,4 +7,11 @@ export declare function clampTime(d: Date, time: string): Date;
7
7
  export declare function sortRange(a: Date, b: Date): [Date, Date];
8
8
  export declare function sortRange(a: Date | null, b: Date | null): [Date | null, Date | null];
9
9
  export declare function toISODate(d: Date): string;
10
+ export declare function buildHourOptions(hourFormat: '12' | '24'): number[];
11
+ export declare function buildMinuteOptions(minuteStep: number): number[];
12
+ export declare function to12Hour(hour24: number): {
13
+ hour: number;
14
+ meridiem: 'am' | 'pm';
15
+ };
16
+ export declare function from12Hour(hour: number, meridiem: 'am' | 'pm'): number;
10
17
  //# sourceMappingURL=date.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/lib/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsC,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAE1G,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,GAAG,YAAY,CAEjD;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,CAG9C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG9C;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI9C;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAIrD;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AACzD,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,CAAA;AAMrF,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAIzC"}
1
+ {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/lib/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsC,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAE1G,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,GAAG,YAAY,CAEjD;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,CAG9C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG9C;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI9C;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAIrD;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AACzD,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,CAAA;AAMrF,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAIzC;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,EAAE,CAGlE;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAK/D;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAA;CAAE,CAKhF;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,CAGtE"}
@@ -0,0 +1,27 @@
1
+ import { ComputedRef, InjectionKey } from 'vue';
2
+ /**
3
+ * Shared context provided by `FormField` and consumed by `Label` (and, in
4
+ * later tasks, `Input`, `Textarea`, and `Select`) to auto-wire `for`/`id`,
5
+ * `aria-describedby`, `aria-invalid`, and `required` onto a control.
6
+ *
7
+ * Every member is a computed ref so the context stays reactive when the
8
+ * `FormField` props change after mount.
9
+ */
10
+ export interface FormFieldContext {
11
+ /** The control id: the `FormField` `id` prop, or a generated fallback. */
12
+ id: ComputedRef<string>;
13
+ /** Space-joined description/error ids, or `undefined` when neither exists. */
14
+ describedBy: ComputedRef<string | undefined>;
15
+ /** `true` when the field should be marked invalid (defaults to `Boolean(error)`). */
16
+ invalid: ComputedRef<boolean>;
17
+ /** `true` when the field is required. */
18
+ required: ComputedRef<boolean>;
19
+ }
20
+ export declare const formFieldKey: InjectionKey<FormFieldContext>;
21
+ /**
22
+ * Reads the nearest `FormField` context. Returns `null` when there is no
23
+ * provider, so consumers can fall back to their explicit props and behave
24
+ * exactly as they did before the context existed.
25
+ */
26
+ export declare function useFormField(): FormFieldContext | null;
27
+ //# sourceMappingURL=formField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formField.d.ts","sourceRoot":"","sources":["../../src/lib/formField.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,KAAK,CAAA;AAEjE;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,EAAE,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACvB,8EAA8E;IAC9E,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,qFAAqF;IACrF,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC7B,yCAAyC;IACzC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CAC/B;AAED,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,gBAAgB,CAA8B,CAAA;AAEtF;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,gBAAgB,GAAG,IAAI,CAEtD"}
@@ -0,0 +1,6 @@
1
+ export declare function getFirstDayOfWeek(locale: string): number;
2
+ export declare function getWeekdayLabels(locale: string, weekStartsOn: number): string[];
3
+ export declare function getMonthLabel(date: Date, locale: string): string;
4
+ export declare function formatLocalizedDate(date: Date, locale: string): string;
5
+ export declare function formatLocalizedTime(date: Date, locale: string, hourFormat: '12' | '24'): string;
6
+ //# sourceMappingURL=locale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/lib/locale.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAYxD;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAO/E;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,CAM/F"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Normalise a numeric field value: empty and non-finite inputs collapse to
3
+ * `null`, while `0` and every other finite number pass through unchanged.
4
+ */
5
+ export declare function toNumberOrNull(value: number | null | undefined): number | null;
6
+ /**
7
+ * Compose the `Intl.NumberFormatOptions` for a number field. Later sources win,
8
+ * so explicit `formatOptions` override the `currency` shorthand and `integer`
9
+ * forces zero fraction digits regardless of what came before.
10
+ */
11
+ export declare function mergeFormatOptions(input: {
12
+ currency?: string;
13
+ formatOptions?: Intl.NumberFormatOptions;
14
+ integer?: boolean;
15
+ }): Intl.NumberFormatOptions;
16
+ //# sourceMappingURL=number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/lib/number.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAG9E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAA;IACxC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,GAAG,IAAI,CAAC,mBAAmB,CAM3B"}
@@ -0,0 +1,36 @@
1
+ import { ComputedRef, Ref } from 'vue';
2
+ export type ThemeMode = 'light' | 'dark' | 'system';
3
+ export type ThemeAttribute = 'both' | 'class' | 'data-theme';
4
+ export interface UseThemeOptions {
5
+ /** localStorage key used to persist an explicit mode. Defaults to `'myghf-theme'`. */
6
+ storageKey?: string;
7
+ /** Which attribute(s) to write on `<html>`. Defaults to `'both'`. */
8
+ attribute?: ThemeAttribute;
9
+ /** Mode used when nothing is stored. Defaults to `'system'`. */
10
+ defaultMode?: ThemeMode;
11
+ }
12
+ export interface UseThemeReturn {
13
+ /** The user's chosen mode (`'system'` follows the OS). */
14
+ mode: Ref<ThemeMode>;
15
+ /** The effective mode after resolving `'system'` against the OS preference. */
16
+ resolved: ComputedRef<'light' | 'dark'>;
17
+ /** Convenience flag: `resolved === 'dark'`. */
18
+ isDark: ComputedRef<boolean>;
19
+ setMode(mode: ThemeMode): void;
20
+ toggle(): void;
21
+ enable(): void;
22
+ disable(): void;
23
+ reset(): void;
24
+ }
25
+ /**
26
+ * Builds an independent theme controller. Writes `.dark` and/or
27
+ * `data-theme="dark"` on `<html>` so the CSS dark token block activates.
28
+ * Safe to call during SSR: without a DOM it resolves to light and is a no-op.
29
+ */
30
+ export declare function createTheme(options?: UseThemeOptions): UseThemeReturn;
31
+ /**
32
+ * Returns a single shared theme controller, lazily created on first call.
33
+ * Later calls reuse it; in dev a mismatched options object logs a warning.
34
+ */
35
+ export declare function useTheme(options?: UseThemeOptions): UseThemeReturn;
36
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/lib/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE3C,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAA;AACnD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,CAAA;AAE5D,MAAM,WAAW,eAAe;IAC9B,sFAAsF;IACtF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,qEAAqE;IACrE,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B,gEAAgE;IAChE,WAAW,CAAC,EAAE,SAAS,CAAA;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,CAAA;IACpB,+EAA+E;IAC/E,QAAQ,EAAE,WAAW,CAAC,OAAO,GAAG,MAAM,CAAC,CAAA;IACvC,+CAA+C;IAC/C,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC5B,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAA;IAC9B,MAAM,IAAI,IAAI,CAAA;IACd,MAAM,IAAI,IAAI,CAAA;IACd,OAAO,IAAI,IAAI,CAAA;IACf,KAAK,IAAI,IAAI,CAAA;CACd;AA4CD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,eAAoB,GAAG,cAAc,CA4EzE;AAKD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,cAAc,CAmBlE"}
@@ -0,0 +1,9 @@
1
+ export type Tone = 'info' | 'success' | 'warning' | 'danger' | 'secondary';
2
+ export interface ToneClasses {
3
+ soft: string;
4
+ outline: string;
5
+ icon: string;
6
+ role: 'alert' | 'status';
7
+ }
8
+ export declare const toneClasses: Record<Tone, ToneClasses>;
9
+ //# sourceMappingURL=tones.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tones.d.ts","sourceRoot":"","sources":["../../src/lib/tones.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAA;AAE1E,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAA;CACzB;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,IAAI,EAAE,WAAW,CA+BjD,CAAA"}
package/dist/nuxt.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ export interface ModuleOptions {
2
+ /** Auto-import the component exports. */
3
+ autoImports?: boolean;
4
+ /** Optional prefix for auto-imported components. */
5
+ prefix?: string;
6
+ }
7
+ /**
8
+ * Vue component exports that can be auto-imported by the Nuxt module.
9
+ * Kept in sync with the component `default` exports in `src/index.ts`.
10
+ */
11
+ export declare const AUTO_IMPORT_COMPONENTS: string[];
12
+ declare const _default: import('@nuxt/schema').NuxtModule<ModuleOptions, ModuleOptions, false>;
13
+ export default _default;
14
+ //# sourceMappingURL=nuxt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nuxt.d.ts","sourceRoot":"","sources":["../src/nuxt.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,UAgDlC,CAAA;;AAED,wBAiCE"}
package/dist/nuxt.js ADDED
@@ -0,0 +1,32 @@
1
+ import { addComponent as e, defineNuxtModule as t } from "@nuxt/kit";
2
+ //#region src/nuxt.ts
3
+ var n = /* @__PURE__ */ "ThemeToggle.Icon.Button.Input.InputNumber.Textarea.Password.Label.FormField.FormDescription.FormMessage.Checkbox.Tag.Alert.Message.Spinner.Skeleton.Avatar.Tabs.TabsList.TabsTrigger.TabsContent.Select.SelectButton.DatePicker.Dialog.Drawer.DropdownMenu.DropdownMenuTrigger.DropdownMenuContent.DropdownMenuItem.DropdownMenuSeparator.DropdownMenuLabel.DropdownMenuGroup.TransferList.Table.TableHeader.TableBody.TableRow.TableHead.TableCell.TableEmpty.TablePagination.DataTable.TreeTable.TreeSelect.Toaster".split("."), r = t({
4
+ meta: {
5
+ name: "@myghf/ui",
6
+ configKey: "myghfUi"
7
+ },
8
+ defaults: {
9
+ autoImports: !0,
10
+ prefix: ""
11
+ },
12
+ async setup(t, r) {
13
+ r.options.build.transpile.push("@myghf/ui"), r.options.css.unshift("@myghf/ui/tokens.css");
14
+ let i = r.options.tailwindcss;
15
+ if (i) {
16
+ i.config ??= {};
17
+ let e = i.config.content ?? [];
18
+ e.push("./node_modules/@myghf/ui/dist/**/*.js"), i.config.content = e;
19
+ let t = i.config.presets ?? [], n = (await import("@myghf/ui/tailwind-preset")).default;
20
+ t.push(n), i.config.presets = t;
21
+ }
22
+ if (t.autoImports) for (let r of n) e({
23
+ name: `${t.prefix}${r}`,
24
+ export: r,
25
+ filePath: "@myghf/ui"
26
+ });
27
+ }
28
+ });
29
+ //#endregion
30
+ export { n as AUTO_IMPORT_COMPONENTS, r as default };
31
+
32
+ //# sourceMappingURL=nuxt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nuxt.js","names":[],"sources":["../src/nuxt.ts"],"sourcesContent":["import { addComponent, defineNuxtModule } from '@nuxt/kit'\n\nexport interface ModuleOptions {\n /** Auto-import the component exports. */\n autoImports?: boolean\n /** Optional prefix for auto-imported components. */\n prefix?: string\n}\n\n/**\n * Vue component exports that can be auto-imported by the Nuxt module.\n * Kept in sync with the component `default` exports in `src/index.ts`.\n */\nexport const AUTO_IMPORT_COMPONENTS = [\n 'ThemeToggle',\n 'Icon',\n 'Button',\n 'Input',\n 'InputNumber',\n 'Textarea',\n 'Password',\n 'Label',\n 'FormField',\n 'FormDescription',\n 'FormMessage',\n 'Checkbox',\n 'Tag',\n 'Alert',\n 'Message',\n 'Spinner',\n 'Skeleton',\n 'Avatar',\n 'Tabs',\n 'TabsList',\n 'TabsTrigger',\n 'TabsContent',\n 'Select',\n 'SelectButton',\n 'DatePicker',\n 'Dialog',\n 'Drawer',\n 'DropdownMenu',\n 'DropdownMenuTrigger',\n 'DropdownMenuContent',\n 'DropdownMenuItem',\n 'DropdownMenuSeparator',\n 'DropdownMenuLabel',\n 'DropdownMenuGroup',\n 'TransferList',\n 'Table',\n 'TableHeader',\n 'TableBody',\n 'TableRow',\n 'TableHead',\n 'TableCell',\n 'TableEmpty',\n 'TablePagination',\n 'DataTable',\n 'TreeTable',\n 'TreeSelect',\n 'Toaster',\n]\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: { name: '@myghf/ui', configKey: 'myghfUi' },\n defaults: { autoImports: true, prefix: '' },\n async setup(options, nuxt) {\n nuxt.options.build.transpile.push('@myghf/ui')\n nuxt.options.css.unshift('@myghf/ui/tokens.css')\n\n // Tailwind is provided by @nuxtjs/tailwindcss, which is not a dependency\n // here, so access its config defensively.\n const tw = (nuxt.options as unknown as Record<string, unknown>).tailwindcss as\n | { config?: Record<string, unknown> }\n | undefined\n if (tw) {\n tw.config ??= {}\n const content = (tw.config.content as string[] | undefined) ?? []\n content.push('./node_modules/@myghf/ui/dist/**/*.js')\n tw.config.content = content\n const presets = (tw.config.presets as unknown[] | undefined) ?? []\n // Tailwind requires preset *objects*; it does not resolve string paths.\n // The specifier is a variable so it is resolved at runtime by the\n // consumer rather than bundled into this module.\n const presetId = '@myghf/ui/tailwind-preset'\n const preset = (await import(presetId)).default\n presets.push(preset)\n tw.config.presets = presets\n }\n\n if (options.autoImports) {\n for (const name of AUTO_IMPORT_COMPONENTS) {\n addComponent({ name: `${options.prefix}${name}`, export: name, filePath: '@myghf/ui' })\n }\n }\n },\n})\n"],"mappings":";;AAaA,IAAa,IAAyB,ihBAgDtC,GAEA,IAAe,EAAgC;CAC7C,MAAM;EAAE,MAAM;EAAa,WAAW;CAAU;CAChD,UAAU;EAAE,aAAa;EAAM,QAAQ;CAAG;CAC1C,MAAM,MAAM,GAAS,GAAM;EAEzB,AADA,EAAK,QAAQ,MAAM,UAAU,KAAK,WAAW,GAC7C,EAAK,QAAQ,IAAI,QAAQ,sBAAsB;EAI/C,IAAM,IAAM,EAAK,QAA+C;EAGhE,IAAI,GAAI;GACN,EAAG,WAAW,CAAC;GACf,IAAM,IAAW,EAAG,OAAO,WAAoC,CAAC;GAEhE,AADA,EAAQ,KAAK,uCAAuC,GACpD,EAAG,OAAO,UAAU;GACpB,IAAM,IAAW,EAAG,OAAO,WAAqC,CAAC,GAK3D,KAAU,MAAM,OAAO,6BAAA,CAAW;GAExC,AADA,EAAQ,KAAK,CAAM,GACnB,EAAG,OAAO,UAAU;EACtB;EAEA,IAAI,EAAQ,aACV,KAAK,IAAM,KAAQ,GACjB,EAAa;GAAE,MAAM,GAAG,EAAQ,SAAS;GAAQ,QAAQ;GAAM,UAAU;EAAY,CAAC;CAG5F;AACF,CAAC"}
@@ -1,5 +1,6 @@
1
1
  /** @type {import('tailwindcss').Config} */
2
2
  export default {
3
+ darkMode: ['class', '.dark'],
3
4
  theme: {
4
5
  extend: {
5
6
  fontFamily: {
package/dist/tokens.css CHANGED
@@ -79,3 +79,16 @@
79
79
  --myghf-info-800: 0 73 99;
80
80
  --myghf-info-900: 0 49 66;
81
81
  }
82
+
83
+ [data-theme='dark'],
84
+ .dark {
85
+ color-scheme: dark;
86
+
87
+ /* surfaces */
88
+ --myghf-background: 15 18 23;
89
+ --myghf-foreground: 243 244 246;
90
+ --myghf-surface: 26 30 37;
91
+ --myghf-surface-muted: 39 44 53;
92
+ --myghf-border: 55 61 71;
93
+ --myghf-muted: 156 163 175;
94
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myghf/ui",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -23,6 +23,10 @@
23
23
  "./tailwind-preset": {
24
24
  "import": "./dist/tailwindPreset.js"
25
25
  },
26
+ "./nuxt": {
27
+ "types": "./dist/nuxt.d.ts",
28
+ "import": "./dist/nuxt.js"
29
+ },
26
30
  "./package.json": "./package.json"
27
31
  },
28
32
  "files": [
@@ -36,6 +40,9 @@
36
40
  "typecheck": "vue-tsc --noEmit",
37
41
  "test": "vitest run",
38
42
  "changeset": "changeset",
43
+ "docs:dev": "vitepress dev docs",
44
+ "docs:build": "vitepress build docs",
45
+ "docs:preview": "vitepress preview docs",
39
46
  "prepublishOnly": "npm run build"
40
47
  },
41
48
  "dependencies": {
@@ -48,20 +55,35 @@
48
55
  "tailwind-variants": "^1.0.0"
49
56
  },
50
57
  "peerDependencies": {
58
+ "@nuxt/kit": ">=3.0.0",
59
+ "@nuxt/schema": ">=3.0.0",
51
60
  "tailwindcss": "^3.4.0",
52
61
  "vue": "^3.5.0"
53
62
  },
63
+ "peerDependenciesMeta": {
64
+ "@nuxt/kit": {
65
+ "optional": true
66
+ },
67
+ "@nuxt/schema": {
68
+ "optional": true
69
+ }
70
+ },
54
71
  "devDependencies": {
55
72
  "@changesets/cli": "^3.0.3",
73
+ "@nuxt/kit": "^4.5.2",
74
+ "@nuxt/schema": "^4.5.2",
56
75
  "@types/node": "^24.0.0",
57
76
  "@vitejs/plugin-vue": "^6.0.7",
58
77
  "@vue/test-utils": "^2.5.1",
59
78
  "@vue/tsconfig": "^0.9.1",
79
+ "autoprefixer": "^10.6.1",
60
80
  "jsdom": "^30.1.1",
81
+ "postcss": "^8.5.28",
61
82
  "tailwindcss": "^3.4.19",
62
83
  "typescript": "~6.0.2",
63
84
  "vite": "^8.3.1",
64
85
  "vite-plugin-dts": "^4.5.4",
86
+ "vitepress": "^1.6.4",
65
87
  "vitest": "^4.1.10",
66
88
  "vue": "^3.5.39",
67
89
  "vue-tsc": "^3.3.5"