iryx-ui 0.0.1 → 0.1.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 (57) hide show
  1. package/README.md +161 -2
  2. package/dist/component-names.d.ts +1 -1
  3. package/dist/component-names.js +13 -1
  4. package/dist/components/App.js +5 -0
  5. package/dist/components/App.vue.d.ts +36 -0
  6. package/dist/components/App.vue_vue_type_script_setup_true_lang.js +51 -0
  7. package/dist/components/Button.vue.d.ts +1 -0
  8. package/dist/components/Button.vue_vue_type_script_setup_true_lang.js +8 -5
  9. package/dist/components/Checkbox.js +5 -0
  10. package/dist/components/Checkbox.vue.d.ts +46 -0
  11. package/dist/components/Checkbox.vue_vue_type_script_setup_true_lang.js +79 -0
  12. package/dist/components/Form.js +5 -0
  13. package/dist/components/Form.vue.d.ts +54 -0
  14. package/dist/components/Form.vue_vue_type_script_setup_true_lang.js +79 -0
  15. package/dist/components/FormField.js +5 -0
  16. package/dist/components/FormField.vue.d.ts +46 -0
  17. package/dist/components/FormField.vue_vue_type_script_setup_true_lang.js +93 -0
  18. package/dist/components/Input.js +5 -0
  19. package/dist/components/Input.vue.d.ts +29 -0
  20. package/dist/components/Input.vue_vue_type_script_setup_true_lang.js +57 -0
  21. package/dist/components/Label.js +5 -0
  22. package/dist/components/Label.vue.d.ts +23 -0
  23. package/dist/components/Label.vue_vue_type_script_setup_true_lang.js +41 -0
  24. package/dist/components/RadioGroup.js +5 -0
  25. package/dist/components/RadioGroup.vue.d.ts +41 -0
  26. package/dist/components/RadioGroup.vue_vue_type_script_setup_true_lang.js +72 -0
  27. package/dist/components/Select.js +5 -0
  28. package/dist/components/Select.vue.d.ts +42 -0
  29. package/dist/components/Select.vue_vue_type_script_setup_true_lang.js +84 -0
  30. package/dist/components/Switch.vue.d.ts +25 -2
  31. package/dist/components/Switch.vue_vue_type_script_setup_true_lang.js +45 -14
  32. package/dist/components/Textarea.js +5 -0
  33. package/dist/components/Textarea.vue.d.ts +28 -0
  34. package/dist/components/Textarea.vue_vue_type_script_setup_true_lang.js +57 -0
  35. package/dist/components/index.d.ts +9 -0
  36. package/dist/components/index.js +24 -6
  37. package/dist/composables/form.d.ts +67 -0
  38. package/dist/composables/form.js +20 -0
  39. package/dist/index.d.ts +10 -0
  40. package/dist/index.js +24 -9
  41. package/dist/plugin.js +8 -8
  42. package/dist/theme/checkbox.d.ts +89 -0
  43. package/dist/theme/checkbox.js +37 -0
  44. package/dist/theme/form.d.ts +68 -0
  45. package/dist/theme/form.js +14 -0
  46. package/dist/theme/index.d.ts +5 -0
  47. package/dist/theme/input.d.ts +60 -0
  48. package/dist/theme/input.js +27 -0
  49. package/dist/theme/label.d.ts +14 -0
  50. package/dist/theme/label.js +8 -0
  51. package/dist/theme/radio-group.d.ts +71 -0
  52. package/dist/theme/radio-group.js +30 -0
  53. package/dist/theme/select.d.ts +56 -0
  54. package/dist/theme/select.js +20 -0
  55. package/dist/theme/switch.d.ts +27 -0
  56. package/dist/theme/switch.js +5 -1
  57. package/package.json +8 -8
@@ -0,0 +1,28 @@
1
+ export interface TextareaProps {
2
+ size?: 'sm' | 'md' | 'lg';
3
+ rows?: number;
4
+ placeholder?: string;
5
+ disabled?: boolean;
6
+ required?: boolean;
7
+ /** Mark the field as invalid — styles the border and ring red. */
8
+ invalid?: boolean;
9
+ id?: string;
10
+ /** Skip built-in classes; you take over styling entirely. */
11
+ unstyled?: boolean;
12
+ class?: string;
13
+ }
14
+ type __VLS_Props = TextareaProps;
15
+ type __VLS_ModelProps = {
16
+ modelValue?: string | null;
17
+ };
18
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
19
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ "update:modelValue": (value: string | null | undefined) => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
22
+ "onUpdate:modelValue"?: ((value: string | null | undefined) => any) | undefined;
23
+ }>, {
24
+ unstyled: boolean;
25
+ invalid: boolean;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
@@ -0,0 +1,57 @@
1
+ import { useIryxUiConfig as e } from "../config.js";
2
+ import { useFormField as t } from "../composables/form.js";
3
+ import { textareaTheme as n } from "../theme/input.js";
4
+ import { computed as r, createElementBlock as i, defineComponent as a, mergeModels as o, normalizeClass as s, openBlock as c, unref as l, useModel as u, vModelText as d, withDirectives as f } from "vue";
5
+ //#region src/components/Textarea.vue?vue&type=script&setup=true&lang.ts
6
+ var p = [
7
+ "id",
8
+ "rows",
9
+ "placeholder",
10
+ "disabled",
11
+ "required",
12
+ "aria-invalid",
13
+ "aria-describedby"
14
+ ], m = /*@__PURE__*/ a({
15
+ __name: "Textarea",
16
+ props: /*@__PURE__*/ o({
17
+ size: {},
18
+ rows: {},
19
+ placeholder: {},
20
+ disabled: { type: Boolean },
21
+ required: { type: Boolean },
22
+ invalid: {
23
+ type: Boolean,
24
+ default: void 0
25
+ },
26
+ id: {},
27
+ unstyled: {
28
+ type: Boolean,
29
+ default: void 0
30
+ },
31
+ class: {}
32
+ }, {
33
+ modelValue: {},
34
+ modelModifiers: {}
35
+ }),
36
+ emits: ["update:modelValue"],
37
+ setup(a) {
38
+ let o = a, m = u(a, "modelValue"), h = t(), g = r(() => o.id ?? h?.id.value), _ = r(() => o.invalid ?? h?.invalid.value ?? !1), v = e(), y = r(() => o.unstyled ?? v.unstyled), b = r(() => y.value ? o.class : n({
39
+ size: o.size,
40
+ invalid: _.value,
41
+ class: o.class
42
+ }));
43
+ return (e, t) => f((c(), i("textarea", {
44
+ id: g.value,
45
+ "onUpdate:modelValue": t[0] ||= (e) => m.value = e,
46
+ rows: o.rows,
47
+ placeholder: o.placeholder,
48
+ disabled: o.disabled,
49
+ required: o.required,
50
+ "aria-invalid": _.value || void 0,
51
+ "aria-describedby": l(h)?.describedBy.value,
52
+ class: s(b.value)
53
+ }, null, 10, p)), [[d, m.value]]);
54
+ }
55
+ });
56
+ //#endregion
57
+ export { m as default };
@@ -1,2 +1,11 @@
1
+ export { default as App } from './App.vue';
1
2
  export { default as Button } from './Button.vue';
3
+ export { default as Checkbox } from './Checkbox.vue';
4
+ export { default as Form } from './Form.vue';
5
+ export { default as FormField } from './FormField.vue';
6
+ export { default as Input } from './Input.vue';
7
+ export { default as Label } from './Label.vue';
8
+ export { default as RadioGroup } from './RadioGroup.vue';
9
+ export { default as Select } from './Select.vue';
2
10
  export { default as Switch } from './Switch.vue';
11
+ export { default as Textarea } from './Textarea.vue';
@@ -1,10 +1,28 @@
1
1
  import { __exportAll as e } from "../_virtual/_rolldown/runtime.js";
2
- import t from "./Button.js";
3
- import n from "./Switch.js";
2
+ import t from "./App.js";
3
+ import n from "./Button.js";
4
+ import r from "./Checkbox.js";
5
+ import i from "./Form.js";
6
+ import a from "./Label.js";
7
+ import o from "./FormField.js";
8
+ import s from "./Input.js";
9
+ import c from "./RadioGroup.js";
10
+ import l from "./Select.js";
11
+ import u from "./Switch.js";
12
+ import d from "./Textarea.js";
4
13
  //#region src/components/index.ts
5
- var r = /* @__PURE__ */ e({
6
- Button: () => t,
7
- Switch: () => n
14
+ var f = /* @__PURE__ */ e({
15
+ App: () => t,
16
+ Button: () => n,
17
+ Checkbox: () => r,
18
+ Form: () => i,
19
+ FormField: () => o,
20
+ Input: () => s,
21
+ Label: () => a,
22
+ RadioGroup: () => c,
23
+ Select: () => l,
24
+ Switch: () => u,
25
+ Textarea: () => d
8
26
  });
9
27
  //#endregion
10
- export { r as components_exports };
28
+ export { f as components_exports };
@@ -0,0 +1,67 @@
1
+ import type { ComputedRef, InjectionKey, Ref } from 'vue';
2
+ /** A validation failure. `name` is a dot-path into the form state. */
3
+ export interface FormError {
4
+ name?: string;
5
+ message: string;
6
+ }
7
+ export interface FormSubmitEvent<T> {
8
+ data: T;
9
+ }
10
+ /** When a field re-validates. `submit` always runs regardless. */
11
+ export type FormValidateOn = 'blur' | 'input' | 'change';
12
+ /**
13
+ * Minimal structural type for the Standard Schema spec, so any compliant
14
+ * validator (Zod 3.24+, Valibot, ArkType…) works without Iryx depending on it.
15
+ *
16
+ * @see https://standardschema.dev
17
+ */
18
+ export interface StandardSchemaLike<Output = unknown> {
19
+ '~standard': {
20
+ version: number;
21
+ vendor: string;
22
+ validate: (value: unknown) => StandardSchemaResult<Output> | Promise<StandardSchemaResult<Output>>;
23
+ };
24
+ }
25
+ export interface StandardSchemaIssue {
26
+ message: string;
27
+ path?: ReadonlyArray<PropertyKey | {
28
+ key: PropertyKey;
29
+ }>;
30
+ }
31
+ export type StandardSchemaResult<Output> = {
32
+ value: Output;
33
+ issues?: undefined;
34
+ } | {
35
+ issues: ReadonlyArray<StandardSchemaIssue>;
36
+ value?: undefined;
37
+ };
38
+ export declare function isStandardSchema(value: unknown): value is StandardSchemaLike;
39
+ /** Join a Standard Schema issue path into a dot-path (`address.city`). */
40
+ export declare function issuePath(issue: StandardSchemaIssue): string | undefined;
41
+ /** Read a dot-path out of an object, tolerating missing intermediates. */
42
+ export declare function getByPath(object: unknown, path: string): unknown;
43
+ export interface FormContext {
44
+ errors: Ref<FormError[]>;
45
+ validateOn: ComputedRef<FormValidateOn[]>;
46
+ disabled: ComputedRef<boolean>;
47
+ /** Full state object, so fields can watch their own slice. */
48
+ state: ComputedRef<Record<string, unknown>>;
49
+ errorFor: (name: string | undefined) => string | undefined;
50
+ validateField: (name: string) => Promise<void>;
51
+ }
52
+ export declare const formContextKey: InjectionKey<FormContext>;
53
+ /** Context a `FormField` exposes to the control it wraps. */
54
+ export interface FormFieldContext {
55
+ id: ComputedRef<string>;
56
+ name: ComputedRef<string | undefined>;
57
+ invalid: ComputedRef<boolean>;
58
+ describedBy: ComputedRef<string | undefined>;
59
+ }
60
+ export declare const formFieldContextKey: InjectionKey<FormFieldContext>;
61
+ /** Access the enclosing form, if any. */
62
+ export declare function useForm(): FormContext | undefined;
63
+ /**
64
+ * Access the enclosing `FormField`, if any. Controls use this to pick up the
65
+ * generated `id`, the invalid state and `aria-describedby` automatically.
66
+ */
67
+ export declare function useFormField(): FormFieldContext | undefined;
@@ -0,0 +1,20 @@
1
+ import { inject as e } from "vue";
2
+ //#region src/composables/form.ts
3
+ function t(e) {
4
+ return typeof e == "object" && !!e && "~standard" in e;
5
+ }
6
+ function n(e) {
7
+ if (e.path?.length) return e.path.map((e) => typeof e == "object" && e ? e.key : e).join(".");
8
+ }
9
+ function r(e, t) {
10
+ return t.split(".").reduce((e, t) => e?.[t], e);
11
+ }
12
+ var i = Symbol.for("iryx-ui:form"), a = Symbol.for("iryx-ui:form-field");
13
+ function o() {
14
+ return e(i, void 0);
15
+ }
16
+ function s() {
17
+ return e(a, void 0);
18
+ }
19
+ //#endregion
20
+ export { i as formContextKey, a as formFieldContextKey, r as getByPath, t as isStandardSchema, n as issuePath, o as useForm, s as useFormField };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,19 @@
1
1
  export { componentNames } from './component-names';
2
2
  export type { ComponentName } from './component-names';
3
3
  export * from './components';
4
+ export type { AppProps } from './components/App.vue';
4
5
  export type { ButtonProps } from './components/Button.vue';
6
+ export type { CheckboxProps } from './components/Checkbox.vue';
7
+ export type { FormProps } from './components/Form.vue';
8
+ export type { FormFieldProps } from './components/FormField.vue';
9
+ export type { InputProps } from './components/Input.vue';
10
+ export type { LabelProps } from './components/Label.vue';
11
+ export type { RadioGroupItemOption, RadioGroupProps } from './components/RadioGroup.vue';
12
+ export type { SelectItemOption, SelectProps } from './components/Select.vue';
5
13
  export type { SwitchProps } from './components/Switch.vue';
14
+ export type { TextareaProps } from './components/Textarea.vue';
6
15
  export * from './composables/appearance';
16
+ export * from './composables/form';
7
17
  export { defaultConfig, iryxUiConfigKey, useIryxUiConfig } from './config';
8
18
  export type { IryxUiConfig } from './config';
9
19
  export { createIryxUi, IryxUi } from './plugin';
package/dist/index.js CHANGED
@@ -1,10 +1,25 @@
1
1
  import { componentNames as e } from "./component-names.js";
2
- import { defaultConfig as t, iryxUiConfigKey as n, useIryxUiConfig as r } from "./config.js";
3
- import { buttonTheme as i } from "./theme/button.js";
4
- import a from "./components/Button.js";
5
- import { switchTheme as o } from "./theme/switch.js";
6
- import s from "./components/Switch.js";
7
- import { initAppearance as c, useAppearance as l } from "./composables/appearance.js";
8
- import { applyTheme as u, clearTheme as d, themes as f } from "./theme/presets.js";
9
- import { IryxUi as p, createIryxUi as m } from "./plugin.js";
10
- export { a as Button, p as IryxUi, s as Switch, u as applyTheme, i as buttonTheme, d as clearTheme, e as componentNames, m as createIryxUi, t as defaultConfig, c as initAppearance, n as iryxUiConfigKey, o as switchTheme, f as themes, l as useAppearance, r as useIryxUiConfig };
2
+ import { initAppearance as t, useAppearance as n } from "./composables/appearance.js";
3
+ import { defaultConfig as r, iryxUiConfigKey as i, useIryxUiConfig as a } from "./config.js";
4
+ import { applyTheme as o, clearTheme as s, themes as c } from "./theme/presets.js";
5
+ import l from "./components/App.js";
6
+ import { buttonTheme as u } from "./theme/button.js";
7
+ import d from "./components/Button.js";
8
+ import { checkboxTheme as f } from "./theme/checkbox.js";
9
+ import p from "./components/Checkbox.js";
10
+ import { formContextKey as m, formFieldContextKey as h, getByPath as g, isStandardSchema as _, issuePath as v, useForm as y, useFormField as b } from "./composables/form.js";
11
+ import x from "./components/Form.js";
12
+ import { labelTheme as S } from "./theme/label.js";
13
+ import C from "./components/Label.js";
14
+ import w from "./components/FormField.js";
15
+ import { fieldBase as T, inputTheme as E, textareaTheme as D } from "./theme/input.js";
16
+ import O from "./components/Input.js";
17
+ import { radioGroupTheme as k } from "./theme/radio-group.js";
18
+ import A from "./components/RadioGroup.js";
19
+ import { selectTheme as j } from "./theme/select.js";
20
+ import M from "./components/Select.js";
21
+ import { switchTheme as N } from "./theme/switch.js";
22
+ import P from "./components/Switch.js";
23
+ import F from "./components/Textarea.js";
24
+ import { IryxUi as I, createIryxUi as L } from "./plugin.js";
25
+ export { l as App, d as Button, p as Checkbox, x as Form, w as FormField, O as Input, I as IryxUi, C as Label, A as RadioGroup, M as Select, P as Switch, F as Textarea, o as applyTheme, u as buttonTheme, f as checkboxTheme, s as clearTheme, e as componentNames, L as createIryxUi, r as defaultConfig, T as fieldBase, m as formContextKey, h as formFieldContextKey, g as getByPath, t as initAppearance, E as inputTheme, i as iryxUiConfigKey, _ as isStandardSchema, v as issuePath, S as labelTheme, k as radioGroupTheme, j as selectTheme, N as switchTheme, D as textareaTheme, c as themes, n as useAppearance, y as useForm, b as useFormField, a as useIryxUiConfig };
package/dist/plugin.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { componentNames as e } from "./component-names.js";
2
- import { defaultConfig as t, iryxUiConfigKey as n } from "./config.js";
3
- import { components_exports as r } from "./components/index.js";
4
- import { initAppearance as i } from "./composables/appearance.js";
5
- import { applyTheme as a } from "./theme/presets.js";
2
+ import { initAppearance as t } from "./composables/appearance.js";
3
+ import { defaultConfig as n, iryxUiConfigKey as r } from "./config.js";
4
+ import { applyTheme as i } from "./theme/presets.js";
5
+ import { components_exports as a } from "./components/index.js";
6
6
  //#region src/plugin.ts
7
7
  function o(o = {}) {
8
8
  let { prefix: s = "I", appearance: c, theme: l, ...u } = o;
9
9
  return { install(o) {
10
- o.provide(n, {
11
- ...t,
10
+ o.provide(r, {
11
+ ...n,
12
12
  ...u
13
13
  });
14
- for (let t of e) o.component(`${s}${t}`, r[t]);
15
- l && a(l), c && i(c);
14
+ for (let t of e) o.component(`${s}${t}`, a[t]);
15
+ l && i(l), c && t(c);
16
16
  } };
17
17
  }
18
18
  var s = o();
@@ -0,0 +1,89 @@
1
+ export declare const checkboxTheme: import("tailwind-variants").TVReturnType<{
2
+ size: {
3
+ sm: {
4
+ root: string;
5
+ indicator: string;
6
+ };
7
+ md: {
8
+ root: string;
9
+ indicator: string;
10
+ };
11
+ lg: {
12
+ root: string;
13
+ indicator: string;
14
+ };
15
+ };
16
+ /** Nudges the box down so it centres against the label's first line. */
17
+ withText: {
18
+ true: {
19
+ root: string;
20
+ };
21
+ };
22
+ }, {
23
+ /** Only rendered when a `label` or `description` is provided. */
24
+ wrapper: string;
25
+ root: string;
26
+ indicator: string;
27
+ content: string;
28
+ label: string;
29
+ description: string;
30
+ }, undefined, {
31
+ size: {
32
+ sm: {
33
+ root: string;
34
+ indicator: string;
35
+ };
36
+ md: {
37
+ root: string;
38
+ indicator: string;
39
+ };
40
+ lg: {
41
+ root: string;
42
+ indicator: string;
43
+ };
44
+ };
45
+ /** Nudges the box down so it centres against the label's first line. */
46
+ withText: {
47
+ true: {
48
+ root: string;
49
+ };
50
+ };
51
+ }, {
52
+ /** Only rendered when a `label` or `description` is provided. */
53
+ wrapper: string;
54
+ root: string;
55
+ indicator: string;
56
+ content: string;
57
+ label: string;
58
+ description: string;
59
+ }, import("tailwind-variants").TVReturnType<{
60
+ size: {
61
+ sm: {
62
+ root: string;
63
+ indicator: string;
64
+ };
65
+ md: {
66
+ root: string;
67
+ indicator: string;
68
+ };
69
+ lg: {
70
+ root: string;
71
+ indicator: string;
72
+ };
73
+ };
74
+ /** Nudges the box down so it centres against the label's first line. */
75
+ withText: {
76
+ true: {
77
+ root: string;
78
+ };
79
+ };
80
+ }, {
81
+ /** Only rendered when a `label` or `description` is provided. */
82
+ wrapper: string;
83
+ root: string;
84
+ indicator: string;
85
+ content: string;
86
+ label: string;
87
+ description: string;
88
+ }, undefined, unknown, unknown, undefined>>;
89
+ export type CheckboxSlots = keyof ReturnType<typeof checkboxTheme>;
@@ -0,0 +1,37 @@
1
+ import { tv as e } from "tailwind-variants";
2
+ //#region src/theme/checkbox.ts
3
+ var t = e({
4
+ slots: {
5
+ wrapper: "flex items-start gap-2.5",
6
+ root: "peer flex shrink-0 cursor-pointer items-center justify-center rounded border border-border bg-background text-primary-foreground transition-colors outline-none focus-visible:ring-2 focus-visible:ring-primary/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary",
7
+ indicator: "flex items-center justify-center text-current",
8
+ content: "grid gap-1",
9
+ label: "text-sm leading-5 font-medium text-foreground select-none",
10
+ description: "text-sm leading-snug text-muted-foreground"
11
+ },
12
+ variants: {
13
+ size: {
14
+ sm: {
15
+ root: "size-3.5",
16
+ indicator: "[&_svg]:size-2.5"
17
+ },
18
+ md: {
19
+ root: "size-4",
20
+ indicator: "[&_svg]:size-3"
21
+ },
22
+ lg: {
23
+ root: "size-5",
24
+ indicator: "[&_svg]:size-3.5"
25
+ }
26
+ },
27
+ withText: { true: { root: "mt-0.5" } }
28
+ },
29
+ compoundVariants: [{
30
+ size: "lg",
31
+ withText: !0,
32
+ class: { root: "mt-0" }
33
+ }],
34
+ defaultVariants: { size: "md" }
35
+ });
36
+ //#endregion
37
+ export { t as checkboxTheme };
@@ -0,0 +1,68 @@
1
+ export declare const formFieldTheme: import("tailwind-variants").TVReturnType<{
2
+ [key: string]: {
3
+ [key: string]: import("tailwind-variants").ClassValue | {
4
+ header?: import("tailwind-variants").ClassValue;
5
+ label?: import("tailwind-variants").ClassValue;
6
+ root?: import("tailwind-variants").ClassValue;
7
+ description?: import("tailwind-variants").ClassValue;
8
+ error?: import("tailwind-variants").ClassValue;
9
+ hint?: import("tailwind-variants").ClassValue;
10
+ control?: import("tailwind-variants").ClassValue;
11
+ help?: import("tailwind-variants").ClassValue;
12
+ };
13
+ };
14
+ } | {
15
+ [x: string]: {
16
+ [x: string]: import("tailwind-variants").ClassValue | {
17
+ header?: import("tailwind-variants").ClassValue;
18
+ label?: import("tailwind-variants").ClassValue;
19
+ root?: import("tailwind-variants").ClassValue;
20
+ description?: import("tailwind-variants").ClassValue;
21
+ error?: import("tailwind-variants").ClassValue;
22
+ hint?: import("tailwind-variants").ClassValue;
23
+ control?: import("tailwind-variants").ClassValue;
24
+ help?: import("tailwind-variants").ClassValue;
25
+ };
26
+ };
27
+ } | {}, {
28
+ root: string;
29
+ header: string;
30
+ label: string;
31
+ hint: string;
32
+ description: string;
33
+ control: string;
34
+ error: string;
35
+ help: string;
36
+ }, undefined, {
37
+ [key: string]: {
38
+ [key: string]: import("tailwind-variants").ClassValue | {
39
+ header?: import("tailwind-variants").ClassValue;
40
+ label?: import("tailwind-variants").ClassValue;
41
+ root?: import("tailwind-variants").ClassValue;
42
+ description?: import("tailwind-variants").ClassValue;
43
+ error?: import("tailwind-variants").ClassValue;
44
+ hint?: import("tailwind-variants").ClassValue;
45
+ control?: import("tailwind-variants").ClassValue;
46
+ help?: import("tailwind-variants").ClassValue;
47
+ };
48
+ };
49
+ } | {}, {
50
+ root: string;
51
+ header: string;
52
+ label: string;
53
+ hint: string;
54
+ description: string;
55
+ control: string;
56
+ error: string;
57
+ help: string;
58
+ }, import("tailwind-variants").TVReturnType<unknown, {
59
+ root: string;
60
+ header: string;
61
+ label: string;
62
+ hint: string;
63
+ description: string;
64
+ control: string;
65
+ error: string;
66
+ help: string;
67
+ }, undefined, unknown, unknown, undefined>>;
68
+ export type FormFieldSlots = keyof ReturnType<typeof formFieldTheme>;
@@ -0,0 +1,14 @@
1
+ import { tv as e } from "tailwind-variants";
2
+ //#region src/theme/form.ts
3
+ var t = e({ slots: {
4
+ root: "space-y-1.5",
5
+ header: "flex items-center justify-between gap-2",
6
+ label: "",
7
+ hint: "text-sm leading-none text-muted-foreground",
8
+ description: "text-sm leading-snug text-muted-foreground",
9
+ control: "",
10
+ error: "text-sm leading-snug text-red-500",
11
+ help: "text-sm leading-snug text-muted-foreground"
12
+ } });
13
+ //#endregion
14
+ export { t as formFieldTheme };
@@ -1,3 +1,8 @@
1
1
  export * from './button';
2
+ export * from './checkbox';
3
+ export * from './input';
4
+ export * from './label';
2
5
  export * from './presets';
6
+ export * from './radio-group';
7
+ export * from './select';
3
8
  export * from './switch';
@@ -0,0 +1,60 @@
1
+ /** Shared field chrome for Input, Textarea and the Select trigger. */
2
+ export declare const fieldBase = "w-full rounded-lg border border-border bg-background text-foreground transition-colors outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-primary/50 disabled:cursor-not-allowed disabled:opacity-50";
3
+ export declare const inputTheme: import("tailwind-variants").TVReturnType<{
4
+ size: {
5
+ sm: string;
6
+ md: string;
7
+ lg: string;
8
+ };
9
+ invalid: {
10
+ true: string;
11
+ };
12
+ }, undefined, "flex w-full rounded-lg border border-border bg-background text-foreground transition-colors outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-primary/50 disabled:cursor-not-allowed disabled:opacity-50", {
13
+ size: {
14
+ sm: string;
15
+ md: string;
16
+ lg: string;
17
+ };
18
+ invalid: {
19
+ true: string;
20
+ };
21
+ }, undefined, import("tailwind-variants").TVReturnType<{
22
+ size: {
23
+ sm: string;
24
+ md: string;
25
+ lg: string;
26
+ };
27
+ invalid: {
28
+ true: string;
29
+ };
30
+ }, undefined, "flex w-full rounded-lg border border-border bg-background text-foreground transition-colors outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-primary/50 disabled:cursor-not-allowed disabled:opacity-50", unknown, unknown, undefined>>;
31
+ export declare const textareaTheme: import("tailwind-variants").TVReturnType<{
32
+ size: {
33
+ sm: string;
34
+ md: string;
35
+ lg: string;
36
+ };
37
+ invalid: {
38
+ true: string;
39
+ };
40
+ }, undefined, "block resize-y w-full rounded-lg border border-border bg-background text-foreground transition-colors outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-primary/50 disabled:cursor-not-allowed disabled:opacity-50", {
41
+ size: {
42
+ sm: string;
43
+ md: string;
44
+ lg: string;
45
+ };
46
+ invalid: {
47
+ true: string;
48
+ };
49
+ }, undefined, import("tailwind-variants").TVReturnType<{
50
+ size: {
51
+ sm: string;
52
+ md: string;
53
+ lg: string;
54
+ };
55
+ invalid: {
56
+ true: string;
57
+ };
58
+ }, undefined, "block resize-y w-full rounded-lg border border-border bg-background text-foreground transition-colors outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-primary/50 disabled:cursor-not-allowed disabled:opacity-50", unknown, unknown, undefined>>;
59
+ export type InputVariants = Parameters<typeof inputTheme>[0];
60
+ export type TextareaVariants = Parameters<typeof textareaTheme>[0];
@@ -0,0 +1,27 @@
1
+ import { tv as e } from "tailwind-variants";
2
+ //#region src/theme/input.ts
3
+ var t = "w-full rounded-lg border border-border bg-background text-foreground transition-colors outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-primary/50 disabled:cursor-not-allowed disabled:opacity-50", n = e({
4
+ base: `flex ${t}`,
5
+ variants: {
6
+ size: {
7
+ sm: "h-8 px-2.5 text-sm",
8
+ md: "h-9 px-3 text-sm",
9
+ lg: "h-10 px-4 text-base"
10
+ },
11
+ invalid: { true: "border-red-500 focus-visible:ring-red-500/40" }
12
+ },
13
+ defaultVariants: { size: "md" }
14
+ }), r = e({
15
+ base: `block resize-y ${t}`,
16
+ variants: {
17
+ size: {
18
+ sm: "min-h-16 px-2.5 py-1.5 text-sm",
19
+ md: "min-h-20 px-3 py-2 text-sm",
20
+ lg: "min-h-24 px-4 py-2.5 text-base"
21
+ },
22
+ invalid: { true: "border-red-500 focus-visible:ring-red-500/40" }
23
+ },
24
+ defaultVariants: { size: "md" }
25
+ });
26
+ //#endregion
27
+ export { t as fieldBase, n as inputTheme, r as textareaTheme };
@@ -0,0 +1,14 @@
1
+ export declare const labelTheme: import("tailwind-variants").TVReturnType<{
2
+ required: {
3
+ true: string;
4
+ };
5
+ }, undefined, "inline-flex items-center gap-1 text-sm leading-none font-medium text-foreground select-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50", {
6
+ required: {
7
+ true: string;
8
+ };
9
+ }, undefined, import("tailwind-variants").TVReturnType<{
10
+ required: {
11
+ true: string;
12
+ };
13
+ }, undefined, "inline-flex items-center gap-1 text-sm leading-none font-medium text-foreground select-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50", unknown, unknown, undefined>>;
14
+ export type LabelVariants = Parameters<typeof labelTheme>[0];
@@ -0,0 +1,8 @@
1
+ import { tv as e } from "tailwind-variants";
2
+ //#region src/theme/label.ts
3
+ var t = e({
4
+ base: "inline-flex items-center gap-1 text-sm leading-none font-medium text-foreground select-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
5
+ variants: { required: { true: "after:text-red-500 after:content-['*']" } }
6
+ });
7
+ //#endregion
8
+ export { t as labelTheme };