@hintoric/ui 0.2.0 → 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.
- package/dist/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/Autocomplete/types.d.ts +7 -0
- package/dist/components/Autocomplete/types.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/types.d.ts +4 -0
- package/dist/components/Checkbox/types.d.ts.map +1 -1
- package/dist/components/ColorSchemeMenu/ColorSchemeMenu.d.ts +15 -0
- package/dist/components/ColorSchemeMenu/ColorSchemeMenu.d.ts.map +1 -0
- package/dist/components/ColorSchemeMenu/index.d.ts +3 -0
- package/dist/components/ColorSchemeMenu/index.d.ts.map +1 -0
- package/dist/components/ColorSchemeMenu/types.d.ts +11 -0
- package/dist/components/ColorSchemeMenu/types.d.ts.map +1 -0
- package/dist/components/ColorSchemeMenuItems/ColorSchemeMenuItems.d.ts +13 -0
- package/dist/components/ColorSchemeMenuItems/ColorSchemeMenuItems.d.ts.map +1 -0
- package/dist/components/ColorSchemeMenuItems/index.d.ts +3 -0
- package/dist/components/ColorSchemeMenuItems/index.d.ts.map +1 -0
- package/dist/components/ColorSchemeMenuItems/types.d.ts +10 -0
- package/dist/components/ColorSchemeMenuItems/types.d.ts.map +1 -0
- package/dist/components/ColorSchemeSelect/ColorSchemeSelect.d.ts +11 -0
- package/dist/components/ColorSchemeSelect/ColorSchemeSelect.d.ts.map +1 -0
- package/dist/components/ColorSchemeSelect/index.d.ts +3 -0
- package/dist/components/ColorSchemeSelect/index.d.ts.map +1 -0
- package/dist/components/ColorSchemeSelect/types.d.ts +11 -0
- package/dist/components/ColorSchemeSelect/types.d.ts.map +1 -0
- package/dist/components/ColorSchemeSwitch/ColorSchemeSwitch.d.ts +18 -0
- package/dist/components/ColorSchemeSwitch/ColorSchemeSwitch.d.ts.map +1 -0
- package/dist/components/ColorSchemeSwitch/index.d.ts +3 -0
- package/dist/components/ColorSchemeSwitch/index.d.ts.map +1 -0
- package/dist/components/ColorSchemeSwitch/types.d.ts +9 -0
- package/dist/components/ColorSchemeSwitch/types.d.ts.map +1 -0
- package/dist/components/ColorSchemeToggle/ColorSchemeToggle.d.ts +18 -0
- package/dist/components/ColorSchemeToggle/ColorSchemeToggle.d.ts.map +1 -0
- package/dist/components/ColorSchemeToggle/index.d.ts +3 -0
- package/dist/components/ColorSchemeToggle/index.d.ts.map +1 -0
- package/dist/components/ColorSchemeToggle/types.d.ts +8 -0
- package/dist/components/ColorSchemeToggle/types.d.ts.map +1 -0
- package/dist/components/ColorSchemeToggleGroup/ColorSchemeToggleGroup.d.ts +17 -0
- package/dist/components/ColorSchemeToggleGroup/ColorSchemeToggleGroup.d.ts.map +1 -0
- package/dist/components/ColorSchemeToggleGroup/index.d.ts +3 -0
- package/dist/components/ColorSchemeToggleGroup/index.d.ts.map +1 -0
- package/dist/components/ColorSchemeToggleGroup/types.d.ts +13 -0
- package/dist/components/ColorSchemeToggleGroup/types.d.ts.map +1 -0
- package/dist/components/ConfirmationDialog/ConfirmationDialog.d.ts +4 -0
- package/dist/components/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -0
- package/dist/components/ConfirmationDialog/index.d.ts +3 -0
- package/dist/components/ConfirmationDialog/index.d.ts.map +1 -0
- package/dist/components/ConfirmationDialog/types.d.ts +25 -0
- package/dist/components/ConfirmationDialog/types.d.ts.map +1 -0
- package/dist/components/Form/Form.d.ts +7 -0
- package/dist/components/Form/Form.d.ts.map +1 -0
- package/dist/components/Form/index.d.ts +3 -0
- package/dist/components/Form/index.d.ts.map +1 -0
- package/dist/components/Form/types.d.ts +37 -0
- package/dist/components/Form/types.d.ts.map +1 -0
- package/dist/components/FormField/FormField.d.ts +11 -0
- package/dist/components/FormField/FormField.d.ts.map +1 -0
- package/dist/components/FormField/index.d.ts +3 -0
- package/dist/components/FormField/index.d.ts.map +1 -0
- package/dist/components/FormField/types.d.ts +25 -0
- package/dist/components/FormField/types.d.ts.map +1 -0
- package/dist/components/FormHelperText/FormHelperText.d.ts.map +1 -1
- package/dist/components/FormLabel/FormLabel.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/types.d.ts +9 -0
- package/dist/components/Input/types.d.ts.map +1 -1
- package/dist/components/LocaleSwitcher/LocaleSwitcher.d.ts +1 -1
- package/dist/components/LocaleSwitcher/LocaleSwitcher.d.ts.map +1 -1
- package/dist/components/LocaleSwitcher/types.d.ts +10 -15
- package/dist/components/LocaleSwitcher/types.d.ts.map +1 -1
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/types.d.ts +4 -0
- package/dist/components/Radio/types.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup/types.d.ts +10 -0
- package/dist/components/RadioGroup/types.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/types.d.ts +6 -0
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/types.d.ts +11 -0
- package/dist/components/Slider/types.d.ts.map +1 -1
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/types.d.ts +12 -0
- package/dist/components/Switch/types.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/types.d.ts +6 -0
- package/dist/components/Textarea/types.d.ts.map +1 -1
- package/dist/index.d.ts +22 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6571 -5538
- package/dist/index.js.map +1 -1
- package/dist/internal/colorScheme.d.ts +18 -0
- package/dist/internal/colorScheme.d.ts.map +1 -0
- package/dist/internal/form/FieldShell.d.ts +25 -0
- package/dist/internal/form/FieldShell.d.ts.map +1 -0
- package/dist/internal/form/adapters.d.ts +9 -0
- package/dist/internal/form/adapters.d.ts.map +1 -0
- package/dist/internal/form/index.d.ts +10 -0
- package/dist/internal/form/index.d.ts.map +1 -0
- package/dist/internal/form/omitProps.d.ts +18 -0
- package/dist/internal/form/omitProps.d.ts.map +1 -0
- package/dist/internal/form/useBoundField.d.ts +16 -0
- package/dist/internal/form/useBoundField.d.ts.map +1 -0
- package/dist/internal/form/useFieldIds.d.ts +10 -0
- package/dist/internal/form/useFieldIds.d.ts.map +1 -0
- package/dist/internal/form/useForkRef.d.ts +11 -0
- package/dist/internal/form/useForkRef.d.ts.map +1 -0
- package/dist/internal/svg-icons/DarkModeIcon.d.ts +3 -0
- package/dist/internal/svg-icons/DarkModeIcon.d.ts.map +1 -0
- package/dist/internal/svg-icons/LightModeIcon.d.ts +3 -0
- package/dist/internal/svg-icons/LightModeIcon.d.ts.map +1 -0
- package/dist/internal/svg-icons/SettingsBrightnessIcon.d.ts +3 -0
- package/dist/internal/svg-icons/SettingsBrightnessIcon.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/dist/theme/ColorSchemeProvider.d.ts +11 -2
- package/dist/theme/ColorSchemeProvider.d.ts.map +1 -1
- package/dist/theme/DateTimeProvider.d.ts.map +1 -1
- package/dist/theme/LocaleProvider.d.ts +38 -0
- package/dist/theme/LocaleProvider.d.ts.map +1 -0
- package/dist/utils/colorVariantClasses.d.ts +13 -0
- package/dist/utils/colorVariantClasses.d.ts.map +1 -1
- package/package.json +8 -3
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface LocaleOption {
|
|
3
|
+
/** The value handed back to `onLocaleChange`. A BCP 47 tag in practice, but not enforced. */
|
|
4
|
+
value: string;
|
|
5
|
+
/** What the user reads. The caller decides whether that is "Deutsch", "German" or "DE". */
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* ISO 3166-1 alpha-2 country code for the flag, e.g. `AT`. Only needed when
|
|
9
|
+
* the flag should not follow the tag's own region subtag — `de-DE` already
|
|
10
|
+
* resolves to `DE` on its own, but a region-less `de` has nothing to derive
|
|
11
|
+
* from, and `en` deliberately belongs to no single country.
|
|
12
|
+
*/
|
|
13
|
+
region?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface LocaleContextValue {
|
|
16
|
+
locale: string;
|
|
17
|
+
/** `undefined` when the provider got no `onLocaleChange` — then it is a read-only source. */
|
|
18
|
+
setLocale: ((locale: string) => void) | undefined;
|
|
19
|
+
/** `undefined` when the provider got no `locales`. */
|
|
20
|
+
locales: readonly LocaleOption[] | undefined;
|
|
21
|
+
}
|
|
22
|
+
export interface LocaleProviderProps {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
/** The current language. Required — this provider mirrors, it does not own. */
|
|
25
|
+
locale: string;
|
|
26
|
+
onLocaleChange?: (locale: string) => void;
|
|
27
|
+
locales?: readonly LocaleOption[];
|
|
28
|
+
}
|
|
29
|
+
export declare function LocaleProvider({ children, locale, onLocaleChange, locales }: LocaleProviderProps): React.JSX.Element;
|
|
30
|
+
export declare function useLocale(): LocaleContextValue;
|
|
31
|
+
/**
|
|
32
|
+
* The non-throwing read of the same context, for components that have to keep
|
|
33
|
+
* working without a provider: `RelativeTime` falls back to the runtime
|
|
34
|
+
* default, `LocaleSwitcher` to its own props. Package-internal — not exported
|
|
35
|
+
* from `index.ts`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useLocaleContext(): LocaleContextValue | undefined;
|
|
38
|
+
//# sourceMappingURL=LocaleProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocaleProvider.d.ts","sourceRoot":"","sources":["../../src/theme/LocaleProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,YAAY;IAC3B,6FAA6F;IAC7F,KAAK,EAAE,MAAM,CAAC;IACd,2FAA2F;IAC3F,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,6FAA6F;IAC7F,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAClD,sDAAsD;IACtD,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,CAAC;CAC9C;AAID,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CACnC;AAUD,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,mBAAmB,qBAMhG;AAED,wBAAgB,SAAS,IAAI,kBAAkB,CAM9C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,kBAAkB,GAAG,SAAS,CAEjE"}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
export type JoyVariant = 'solid' | 'soft' | 'outlined' | 'plain';
|
|
2
2
|
export type JoyColor = 'primary' | 'neutral' | 'danger' | 'success' | 'warning';
|
|
3
3
|
export declare const INTERACTIVE_COLOR_CLASSES: Record<JoyVariant, Record<JoyColor, string>>;
|
|
4
|
+
/**
|
|
5
|
+
* Just the disabled text colour, without the `disabled:` prefix — for an
|
|
6
|
+
* element that has to carry that colour unconditionally rather than only while
|
|
7
|
+
* `:disabled` matches.
|
|
8
|
+
*
|
|
9
|
+
* Button's loading indicator is the case: the root turns `text-transparent!`
|
|
10
|
+
* while loading (to hide the label the way Joy does), and an indicator drawn in
|
|
11
|
+
* `currentColor` would inherit that transparency and vanish. Joy re-colours its
|
|
12
|
+
* own indicator for exactly the same reason, with
|
|
13
|
+
* `theme.variants[variant + 'Disabled'][color].color` — a loading button is
|
|
14
|
+
* always disabled, so the disabled colour is the right one.
|
|
15
|
+
*/
|
|
16
|
+
export declare const DISABLED_TEXT_CLASSES: Record<JoyVariant, Record<JoyColor, string>>;
|
|
4
17
|
export declare const ACTIVE_BG_CLASS: Record<JoyVariant, Record<JoyColor, string>>;
|
|
5
18
|
export declare const HOVER_BG_CLASS: Record<JoyVariant, Record<JoyColor, string>>;
|
|
6
19
|
export declare const SURFACE_COLOR_CLASSES: Record<JoyVariant, Record<JoyColor, string>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorVariantClasses.d.ts","sourceRoot":"","sources":["../../src/utils/colorVariantClasses.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;AACjE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAMhF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CA6BlF,CAAC;AAOF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CA6BxE,CAAC;AASF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CA6BvE,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAiC9E,CAAC;AAOF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CA6B7E,CAAC;AAUF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAA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EAAE,MAAM,CAAC,CAiC9E,CAAC;AAOF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CA6B7E,CAAC;AAUF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CA6B/E,CAAC;AAOF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CA6B5E,CAAC;AAOF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CA6B7E,CAAC;AAMF,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAM7D,CAAC;AAmBF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAM9D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hintoric/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Joy UI's look and API, built on Base UI and Tailwind CSS.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,10 +32,13 @@
|
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": "^18.3.0 || ^19.0.0",
|
|
35
|
-
"react-dom": "^18.3.0 || ^19.0.0"
|
|
35
|
+
"react-dom": "^18.3.0 || ^19.0.0",
|
|
36
|
+
"react-hook-form": "^7.54.0",
|
|
37
|
+
"zod": "^4.0.0"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
40
|
"@base-ui/react": "^1.7.0",
|
|
41
|
+
"@hookform/resolvers": "^5.9.1",
|
|
39
42
|
"@tanstack/react-table": "^9.2.4",
|
|
40
43
|
"class-variance-authority": "^0.7.1",
|
|
41
44
|
"clsx": "^2.1.1",
|
|
@@ -59,11 +62,13 @@
|
|
|
59
62
|
"playwright": "^1.62.1",
|
|
60
63
|
"react": "^19.2.8",
|
|
61
64
|
"react-dom": "^19.2.8",
|
|
65
|
+
"react-hook-form": "^7.87.0",
|
|
62
66
|
"tailwindcss": "^4.3.3",
|
|
63
67
|
"typescript": "^7.0.2",
|
|
64
68
|
"vite": "^8.2.2",
|
|
65
69
|
"vite-plugin-dts": "^5.1.0",
|
|
66
|
-
"vitest": "^4.1.11"
|
|
70
|
+
"vitest": "^4.1.11",
|
|
71
|
+
"zod": "^4.5.4"
|
|
67
72
|
},
|
|
68
73
|
"scripts": {
|
|
69
74
|
"build": "vite build",
|