@ox0/ui 0.5.1 → 0.7.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.
@@ -1,16 +1,20 @@
1
1
  import { type ReactNode } from "react";
2
+ export type DialogWidth = "sm" | "md" | "lg" | "xl";
3
+ export type DialogMaxHeight = "sm" | "md" | "lg" | "xl";
2
4
  export interface DialogProps {
3
5
  readonly children?: ReactNode;
4
- /** Extra class applied to the dialog element — use for custom max-width or layout. */
5
- readonly className?: string;
6
6
  /** Closes on backdrop click — use for ephemeral info or side tasks. */
7
7
  readonly isEphemeral?: boolean;
8
8
  /** Prevents Escape from closing — use for dialogs that require explicit action. */
9
9
  readonly isDismissDisabled?: boolean;
10
10
  readonly isOpen: boolean;
11
+ /** Caps the dialog height. Default: grows with content up to the viewport. */
12
+ readonly maxHeight?: DialogMaxHeight | undefined;
11
13
  readonly onClose: () => void;
14
+ /** Controls the max-width of the dialog. Default: "md" (~32rem). */
15
+ readonly width?: DialogWidth | undefined;
12
16
  }
13
- declare function DialogRoot({ children, className, isDismissDisabled, isEphemeral, isOpen, onClose, }: DialogProps): ReactNode;
17
+ declare function DialogRoot({ children, isDismissDisabled, isEphemeral, isOpen, maxHeight, onClose, width, }: DialogProps): ReactNode;
14
18
  export interface DialogHeaderProps {
15
19
  readonly children?: ReactNode;
16
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAA;AA+Bd,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B,sFAAsF;IACtF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,i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/components/menu.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EAQf,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAI7C,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAA;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAA;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;CAC5B;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAA;IAC1B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;QAC7B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QAC5B,aAAa,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAA;QACzC,SAAS,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAA;QACtC,eAAe,CAAC,EAAE,OAAO,CAAA;QACzB,eAAe,CAAC,EAAE,MAAM,CAAA;KACzB,CAAC,CAAA;CACH;AAwMD,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,SAAS,+BAgK5D"}
@@ -7,6 +7,7 @@ export interface SelectOption {
7
7
  export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "value" | "defaultValue" | "onChange" | "aria-label" | "disabled"> {
8
8
  readonly label?: ReactNode;
9
9
  readonly ariaLabel?: string;
10
+ readonly description?: ReactNode;
10
11
  readonly isDisabled?: boolean;
11
12
  readonly isInvalid?: boolean;
12
13
  readonly errorMessage?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,oBAAoB,EAK1B,MAAM,OAAO,CAAA;AAId,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAC5B;AAED,MAAM,WAAW,WAAY,SAAQ,IAAI,CACvC,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,CAClE;IACC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,CAAA;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;IACzC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5C;AAED,eAAO,MAAM,MAAM,2GA8FjB,CAAA"}
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAAA,OAAO,EA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AAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5C;AAED,eAAO,MAAM,QAAQ,+GAiGnB,CAAA"}
@@ -1,11 +1,18 @@
1
1
  import { type InputHTMLAttributes, type ReactNode } from "react";
2
- export interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "disabled" | "onChange"> {
2
+ import type { IconComponent } from "./button";
3
+ export interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "disabled" | "onChange" | "readOnly" | "aria-label"> {
4
+ readonly ariaLabel?: string;
3
5
  readonly description?: ReactNode;
4
6
  readonly errorMessage?: ReactNode;
7
+ readonly icon?: IconComponent;
8
+ readonly isClearable?: boolean;
5
9
  readonly isDisabled?: boolean;
6
10
  readonly isInvalid?: boolean;
11
+ readonly isReadOnly?: boolean;
7
12
  readonly label?: ReactNode;
13
+ readonly onClear?: () => void;
8
14
  readonly onChange?: (value: string) => void;
15
+ readonly variant?: "default" | "flat";
9
16
  }
10
17
  export declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
11
18
  //# sourceMappingURL=text-field.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../src/components/text-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAInF,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,UAAU,GAAG,UAAU,CACjC;IACC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAA;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,CAAA;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,SAAS,CAAC,EA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AAA"}
package/dist/index.js CHANGED
@@ -207,7 +207,7 @@ var __webpack_modules__ = {
207
207
  var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_rsbuild_core_1_2_19_node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_pnpm_rsbuild_core_1_2_19_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default());
208
208
  ___CSS_LOADER_EXPORT___.push([
209
209
  module.id,
210
- ".overlay-KCSdjX{padding:var(--ox0-space-xl);z-index:var(--ox0-z-overlay);place-items:center;animation:.2s ease-out overlayShow-lH7CfL;display:grid;position:fixed;inset:0}.overlay-KCSdjX[data-exiting]{animation:.15s ease-in forwards overlayHide-F4Gj2F}.backdrop-DQalCV{backdrop-filter:blur(1px);background:#00000080;grid-area:1/1;position:fixed;inset:0}.dialog-WXDUzL{background:var(--ox0-color-surface);border:1px solid var(--ox0-color-border);border-radius:var(--ox0-radius-md);box-shadow:var(--ox0-shadow-modal);gap:var(--ox0-space-lg);max-width:32rem;padding:var(--ox0-space-xl);grid-area:1/1;width:100%;margin:auto;animation:.2s ease-out dialogShow-YtVdkm;display:grid;position:relative}.overlay-KCSdjX[data-exiting] .dialog-WXDUzL{animation:.15s ease-in forwards dialogHide-uSvQPq}.header-ogdbpL{align-items:flex-start;gap:var(--ox0-space-sm);justify-content:space-between;display:flex}.title-uK_Bbe{font-size:var(--ox0-font-size-lg);font-weight:var(--ox0-font-weight-semibold);flex:1;margin:0}.body-j8xBuG{min-width:0}.footer-w0_Blm{gap:var(--ox0-space-sm);justify-content:flex-end;display:flex}@keyframes overlayShow-lH7CfL{0%{opacity:0}to{opacity:1}}@keyframes overlayHide-F4Gj2F{0%{opacity:1}to{opacity:0}}@keyframes dialogShow-YtVdkm{0%{opacity:0;transform:translateY(-12px)scale(.96)}to{opacity:1;transform:none}}@keyframes dialogHide-uSvQPq{0%{opacity:1;transform:none}to{opacity:0;transform:translateY(-12px)scale(.96)}}@media (prefers-reduced-motion:reduce){.overlay-KCSdjX,.overlay-KCSdjX[data-exiting],.dialog-WXDUzL,.overlay-KCSdjX[data-exiting] .dialog-WXDUzL{animation-duration:1ms}}",
210
+ ".overlay-KCSdjX{padding:var(--ox0-space-xl);z-index:var(--ox0-z-overlay);place-items:center;animation:.2s ease-out overlayShow-lH7CfL;display:grid;position:fixed;inset:0}.overlay-KCSdjX[data-exiting]{animation:.15s ease-in forwards overlayHide-F4Gj2F}.backdrop-DQalCV{backdrop-filter:blur(1px);background:#00000080;grid-area:1/1;position:fixed;inset:0}.dialog-WXDUzL{background:var(--ox0-color-surface);border:1px solid var(--ox0-color-border);border-radius:var(--ox0-radius-md);box-shadow:var(--ox0-shadow-modal);gap:var(--ox0-space-lg);max-width:32rem;padding:var(--ox0-space-xl);grid-area:1/1;width:100%;margin:auto;animation:.2s ease-out dialogShow-YtVdkm;display:grid;position:relative}.dialog-WXDUzL[data-width=sm]{max-width:28rem}.dialog-WXDUzL[data-width=lg]{max-width:52rem}.dialog-WXDUzL[data-width=xl]{max-width:60rem}.dialog-WXDUzL[data-max-height=sm]{max-height:20rem}.dialog-WXDUzL[data-max-height=md]{max-height:28rem}.dialog-WXDUzL[data-max-height=lg]{max-height:40rem}.dialog-WXDUzL[data-max-height=xl]{max-height:min(80vh,48rem)}.dialog-WXDUzL[data-max-height]{grid-template-rows:auto 1fr auto}.dialog-WXDUzL[data-max-height] .body-j8xBuG{min-height:0;overflow:auto}.overlay-KCSdjX[data-exiting] .dialog-WXDUzL{animation:.15s ease-in forwards dialogHide-uSvQPq}.header-ogdbpL{align-items:flex-start;gap:var(--ox0-space-sm);justify-content:space-between;display:flex}.title-uK_Bbe{font-size:var(--ox0-font-size-lg);font-weight:var(--ox0-font-weight-semibold);flex:1;margin:0}.body-j8xBuG{min-width:0}.footer-w0_Blm{gap:var(--ox0-space-sm);justify-content:flex-end;display:flex}@keyframes overlayShow-lH7CfL{0%{opacity:0}to{opacity:1}}@keyframes overlayHide-F4Gj2F{0%{opacity:1}to{opacity:0}}@keyframes dialogShow-YtVdkm{0%{opacity:0;transform:translateY(-12px)scale(.96)}to{opacity:1;transform:none}}@keyframes dialogHide-uSvQPq{0%{opacity:1;transform:none}to{opacity:0;transform:translateY(-12px)scale(.96)}}@media (prefers-reduced-motion:reduce){.overlay-KCSdjX,.overlay-KCSdjX[data-exiting],.dialog-WXDUzL,.overlay-KCSdjX[data-exiting] .dialog-WXDUzL{animation-duration:1ms}}",
211
211
  ""
212
212
  ]);
213
213
  ___CSS_LOADER_EXPORT___.locals = {
@@ -217,10 +217,10 @@ var __webpack_modules__ = {
217
217
  backdrop: "backdrop-DQalCV",
218
218
  dialog: "dialog-WXDUzL",
219
219
  dialogShow: "dialogShow-YtVdkm",
220
+ body: "body-j8xBuG",
220
221
  dialogHide: "dialogHide-uSvQPq",
221
222
  header: "header-ogdbpL",
222
223
  title: "title-uK_Bbe",
223
- body: "body-j8xBuG",
224
224
  footer: "footer-w0_Blm"
225
225
  };
226
226
  const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___;
@@ -372,7 +372,7 @@ var __webpack_modules__ = {
372
372
  var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_rsbuild_core_1_2_19_node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_pnpm_rsbuild_core_1_2_19_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default());
373
373
  ___CSS_LOADER_EXPORT___.push([
374
374
  module.id,
375
- ".root-FHU2Km{gap:var(--ox0-space-xs);display:grid}.label-QcwXLk{color:var(--ox0-color-muted);font-size:var(--ox0-font-size-sm);font-weight:var(--ox0-font-weight-medium)}.select-gSATBt{background:var(--ox0-color-surface);border:1px solid var(--ox0-color-border);border-radius:var(--ox0-radius-sm);color:var(--ox0-color-foreground);font:inherit;font-size:var(--ox0-font-size-md);min-height:34px;padding:0 var(--ox0-space-md);transition:border-color var(--ox0-duration-fast)var(--ox0-ease-crisp),box-shadow var(--ox0-duration-fast)var(--ox0-ease-crisp)}.select-gSATBt:hover{border-color:var(--ox0-color-border-strong)}.select-gSATBt:focus{outline:none}.select-gSATBt.focusVisible-jXb33t{border-color:var(--ox0-color-accent);box-shadow:0 0 0 3px var(--ox0-color-focus-ring)}.select-gSATBt:disabled{background:var(--ox0-color-canvas);color:var(--ox0-color-disabled);cursor:not-allowed}.select-gSATBt.invalid-KfZYsG{border-color:var(--ox0-color-danger)}.select-gSATBt.invalid-KfZYsG.focusVisible-jXb33t{box-shadow:0 0 0 3px var(--ox0-color-danger-subtle)}.error-j2vRdG{color:var(--ox0-color-danger-text);font-size:var(--ox0-font-size-sm)}",
375
+ ".root-FHU2Km{gap:var(--ox0-space-xs);display:grid}.label-QcwXLk{color:var(--ox0-color-muted);font-size:var(--ox0-font-size-sm);font-weight:var(--ox0-font-weight-medium)}.select-gSATBt{background:var(--ox0-color-surface);border:1px solid var(--ox0-color-border);border-radius:var(--ox0-radius-sm);color:var(--ox0-color-foreground);font:inherit;font-size:var(--ox0-font-size-md);min-height:34px;padding:0 var(--ox0-space-md);transition:border-color var(--ox0-duration-fast)var(--ox0-ease-crisp),box-shadow var(--ox0-duration-fast)var(--ox0-ease-crisp)}.select-gSATBt:hover{border-color:var(--ox0-color-border-strong)}.select-gSATBt:focus{outline:none}.select-gSATBt.focusVisible-jXb33t{border-color:var(--ox0-color-accent);box-shadow:0 0 0 3px var(--ox0-color-focus-ring)}.select-gSATBt:disabled{background:var(--ox0-color-canvas);color:var(--ox0-color-disabled);cursor:not-allowed}.select-gSATBt.invalid-KfZYsG{border-color:var(--ox0-color-danger)}.select-gSATBt.invalid-KfZYsG.focusVisible-jXb33t{box-shadow:0 0 0 3px var(--ox0-color-danger-subtle)}.description-wugNPd{color:var(--ox0-color-muted);font-size:var(--ox0-font-size-sm)}.error-j2vRdG{color:var(--ox0-color-danger-text);font-size:var(--ox0-font-size-sm)}",
376
376
  ""
377
377
  ]);
378
378
  ___CSS_LOADER_EXPORT___.locals = {
@@ -381,6 +381,7 @@ var __webpack_modules__ = {
381
381
  select: "select-gSATBt",
382
382
  focusVisible: "focusVisible-jXb33t",
383
383
  invalid: "invalid-KfZYsG",
384
+ description: "description-wugNPd",
384
385
  error: "error-j2vRdG"
385
386
  };
386
387
  const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___;
@@ -452,14 +453,18 @@ var __webpack_modules__ = {
452
453
  var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_rsbuild_core_1_2_19_node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_pnpm_rsbuild_core_1_2_19_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default());
453
454
  ___CSS_LOADER_EXPORT___.push([
454
455
  module.id,
455
- ".root-EDj_sz{color:var(--ox0-color-foreground);font-size:var(--ox0-font-size-md);gap:var(--ox0-space-xs);display:grid}.label-S2rwc9{font-weight:var(--ox0-font-weight-medium)}.input-pJgRNM{background:var(--ox0-color-surface);border:1px solid var(--ox0-color-border);border-radius:var(--ox0-radius-sm);color:var(--ox0-color-foreground);font:inherit;padding:.625rem var(--ox0-space-md);transition:border-color var(--ox0-duration-fast)var(--ox0-ease-crisp),box-shadow var(--ox0-duration-fast)var(--ox0-ease-crisp)}.input-pJgRNM::placeholder{color:var(--ox0-color-disabled)}.input-pJgRNM:hover{border-color:var(--ox0-color-border-strong)}.input-pJgRNM:focus{border-color:var(--ox0-color-accent);box-shadow:0 0 0 3px var(--ox0-color-focus-ring);outline:none}.input-pJgRNM:disabled{background:var(--ox0-color-canvas);color:var(--ox0-color-disabled);cursor:not-allowed}.input-pJgRNM.invalid-M29JY3{border-color:var(--ox0-color-danger)}.input-pJgRNM.invalid-M29JY3:focus{box-shadow:0 0 0 3px var(--ox0-color-danger-subtle)}.description-U5SfzR{color:var(--ox0-color-muted);font-size:var(--ox0-font-size-sm)}.error-PaIi5f{color:var(--ox0-color-danger-text);font-size:var(--ox0-font-size-sm)}",
456
+ ".root-EDj_sz{color:var(--ox0-color-foreground);font-size:var(--ox0-font-size-md);gap:var(--ox0-space-xs);display:grid}.label-S2rwc9{font-weight:var(--ox0-font-weight-medium)}.control-Vog3id{background:var(--ox0-color-surface);border:1px solid var(--ox0-color-border);border-radius:var(--ox0-radius-sm);align-items:center;gap:var(--ox0-space-xs);min-height:36px;padding-inline:var(--ox0-space-md);transition:border-color var(--ox0-duration-fast)var(--ox0-ease-crisp),box-shadow var(--ox0-duration-fast)var(--ox0-ease-crisp);display:flex}.control-Vog3id:hover{border-color:var(--ox0-color-border-strong)}.control-Vog3id.focusVisible-r4K4nT{border-color:var(--ox0-color-accent);box-shadow:0 0 0 3px var(--ox0-color-focus-ring)}.control-Vog3id.invalid-M29JY3{border-color:var(--ox0-color-danger)}.control-Vog3id.invalid-M29JY3.focusVisible-r4K4nT{box-shadow:0 0 0 3px var(--ox0-color-danger-subtle)}.control-Vog3id[data-variant=flat]{border:none;border-bottom:1px solid var(--ox0-color-border);padding-inline:var(--ox0-space-xs);background:0 0;border-radius:0}.control-Vog3id[data-variant=flat]:hover{border-bottom-color:var(--ox0-color-border-strong)}.control-Vog3id[data-variant=flat].focusVisible-r4K4nT{border-bottom-color:var(--ox0-color-accent);box-shadow:none}.icon-SJ2fI8{color:var(--ox0-color-muted);flex:none;display:inline-flex}.input-pJgRNM{color:inherit;font:inherit;background:0 0;border:none;outline:none;flex:auto;min-inline-size:0;padding-block:.625rem}.input-pJgRNM::placeholder{color:var(--ox0-color-disabled)}.input-pJgRNM:disabled{color:var(--ox0-color-disabled);cursor:not-allowed}.control-Vog3id:has(.input-pJgRNM:disabled){background:var(--ox0-color-canvas);cursor:not-allowed}.clear-eMD0M3{block-size:24px;color:var(--ox0-color-muted);cursor:pointer;background:0 0;border:none;border-radius:999px;flex:none;justify-content:center;align-items:center;inline-size:24px;display:inline-flex}.clear-eMD0M3:hover{color:var(--ox0-color-foreground)}.description-U5SfzR{color:var(--ox0-color-muted);font-size:var(--ox0-font-size-sm)}.error-PaIi5f{color:var(--ox0-color-danger-text);font-size:var(--ox0-font-size-sm)}",
456
457
  ""
457
458
  ]);
458
459
  ___CSS_LOADER_EXPORT___.locals = {
459
460
  root: "root-EDj_sz",
460
461
  label: "label-S2rwc9",
461
- input: "input-pJgRNM",
462
+ control: "control-Vog3id",
463
+ focusVisible: "focusVisible-r4K4nT",
462
464
  invalid: "invalid-M29JY3",
465
+ icon: "icon-SJ2fI8",
466
+ input: "input-pJgRNM",
467
+ clear: "clear-eMD0M3",
463
468
  description: "description-U5SfzR",
464
469
  error: "error-PaIi5f"
465
470
  };
@@ -2107,7 +2112,7 @@ function useDialogContext() {
2107
2112
  if (!ctx) throw new Error("Dialog subcomponents must be used inside <Dialog>");
2108
2113
  return ctx;
2109
2114
  }
2110
- function DialogRoot({ children, className, isDismissDisabled, isEphemeral, isOpen, onClose }) {
2115
+ function DialogRoot({ children, isDismissDisabled, isEphemeral, isOpen, maxHeight, onClose, width }) {
2111
2116
  const titleId = (0, __WEBPACK_EXTERNAL_MODULE_react__.useId)();
2112
2117
  const dialogRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
2113
2118
  const [isVisible, setIsVisible] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(isOpen);
@@ -2187,7 +2192,9 @@ function DialogRoot({ children, className, isDismissDisabled, isEphemeral, isOpe
2187
2192
  ref: dialogRef,
2188
2193
  "aria-labelledby": titleId,
2189
2194
  "aria-modal": "true",
2190
- className: className ? `${components_dialog_module.dialog} ${className}` : components_dialog_module.dialog,
2195
+ className: components_dialog_module.dialog,
2196
+ "data-max-height": maxHeight,
2197
+ "data-width": width,
2191
2198
  open: true,
2192
2199
  onKeyDown: handleKeyDown,
2193
2200
  children: children
@@ -2579,7 +2586,7 @@ function buildLevels(root, openPath, activeIndices) {
2579
2586
  ];
2580
2587
  let items = root;
2581
2588
  for(let d = 0; d < openPath.length; d++){
2582
- const parent = items[openPath[d]];
2589
+ const parent = items[openPath[d] ?? 0];
2583
2590
  if (!parent?.items?.length) break;
2584
2591
  items = parent.items;
2585
2592
  levels.push({
@@ -2830,7 +2837,8 @@ function Menu({ ariaLabel, items, trigger }) {
2830
2837
  ]);
2831
2838
  const registerBtn = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((depth, index, node)=>{
2832
2839
  if (!buttonRefs.current[depth]) buttonRefs.current[depth] = [];
2833
- buttonRefs.current[depth][index] = node;
2840
+ const depthRefs = buttonRefs.current[depth];
2841
+ if (depthRefs) depthRefs[index] = node;
2834
2842
  }, []);
2835
2843
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
2836
2844
  if (!isOpen) return;
@@ -2888,7 +2896,7 @@ function Menu({ ariaLabel, items, trigger }) {
2888
2896
  onClose: close,
2889
2897
  onOpenChild: openChild,
2890
2898
  onSelect: handleSelect,
2891
- referenceEl: 0 === level.depth ? triggerRef.current : buttonRefs.current[level.depth - 1]?.[openPath[level.depth - 1]] ?? null,
2899
+ referenceEl: 0 === level.depth ? triggerRef.current : buttonRefs.current[level.depth - 1]?.[openPath[level.depth - 1] ?? 0] ?? null,
2892
2900
  registerBtn: registerBtn
2893
2901
  }, level.depth))
2894
2902
  })
@@ -3199,10 +3207,11 @@ select_module_options.domAPI = styleDomAPI_default();
3199
3207
  select_module_options.insertStyleElement = insertStyleElement_default();
3200
3208
  injectStylesIntoStyleTag_default()(select_module.Z, select_module_options);
3201
3209
  const components_select_module = select_module.Z && select_module.Z.locals ? select_module.Z.locals : void 0;
3202
- const select_Select = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(function({ ariaLabel, className, defaultValue, errorMessage, id, isDisabled, isInvalid, label, onChange, options, placeholder, value: valueProp, ...props }, ref) {
3210
+ const select_Select = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(function({ ariaLabel, className, defaultValue, description, errorMessage, id, isDisabled, isInvalid, label, onChange, options, placeholder, value: valueProp, ...props }, ref) {
3203
3211
  if (!label && !ariaLabel) throw new Error("Select requires `label` or `ariaLabel`.");
3204
3212
  const generatedId = (0, __WEBPACK_EXTERNAL_MODULE_react__.useId)();
3205
3213
  const controlId = id ?? generatedId;
3214
+ const descriptionId = description ? `${controlId}-description` : void 0;
3206
3215
  const errorId = errorMessage ? `${controlId}-error` : void 0;
3207
3216
  const invalid = isInvalid || !!errorMessage;
3208
3217
  const isControlled = void 0 !== valueProp;
@@ -3226,7 +3235,10 @@ const select_Select = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwar
3226
3235
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("select", {
3227
3236
  ...props,
3228
3237
  ref: ref,
3229
- "aria-describedby": errorId,
3238
+ "aria-describedby": [
3239
+ descriptionId,
3240
+ errorId
3241
+ ].filter(Boolean).join(" ") || void 0,
3230
3242
  "aria-invalid": invalid || void 0,
3231
3243
  "aria-label": ariaLabel,
3232
3244
  className: [
@@ -3264,6 +3276,11 @@ const select_Select = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwar
3264
3276
  }, o.value))
3265
3277
  ]
3266
3278
  }),
3279
+ description ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
3280
+ className: components_select_module.description,
3281
+ id: descriptionId,
3282
+ children: description
3283
+ }) : null,
3267
3284
  errorMessage ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
3268
3285
  className: components_select_module.error,
3269
3286
  id: errorId,
@@ -3366,7 +3383,10 @@ const text_area_TextArea = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.f
3366
3383
  ].filter(Boolean).join(" ") || void 0;
3367
3384
  const invalid = isInvalid || !!errorMessage;
3368
3385
  const ref = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
3369
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useImperativeHandle)(forwardedRef, ()=>ref.current);
3386
+ (0, __WEBPACK_EXTERNAL_MODULE_react__.useImperativeHandle)(forwardedRef, ()=>{
3387
+ if (!ref.current) throw new Error("TextArea: internal ref is null");
3388
+ return ref.current;
3389
+ });
3370
3390
  function resize() {
3371
3391
  const el = ref.current;
3372
3392
  if (!el) return;
@@ -3434,7 +3454,7 @@ const text_area_TextArea = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.f
3434
3454
  ]
3435
3455
  });
3436
3456
  });
3437
- const text_field_TextField = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(function({ className, description, errorMessage, id: idProp, isDisabled, isInvalid, label, onChange, ...props }, ref) {
3457
+ const text_field_TextField = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(function({ ariaLabel, description, errorMessage, icon: Icon, id: idProp, isClearable = false, isDisabled, isInvalid, isReadOnly, label, onBlur, onClear, onChange, onFocus, onKeyDown, onPointerDown, variant = "default", ...props }, ref) {
3438
3458
  const generatedId = (0, __WEBPACK_EXTERNAL_MODULE_react__.useId)();
3439
3459
  const id = idProp ?? generatedId;
3440
3460
  const descriptionId = description ? `${id}-description` : void 0;
@@ -3444,6 +3464,28 @@ const text_field_TextField = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__
3444
3464
  errorId
3445
3465
  ].filter(Boolean).join(" ") || void 0;
3446
3466
  const invalid = isInvalid || !!errorMessage;
3467
+ const inputRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
3468
+ const setInputRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((node)=>{
3469
+ inputRef.current = node;
3470
+ if (!ref) return;
3471
+ if ("function" == typeof ref) {
3472
+ ref(node);
3473
+ return;
3474
+ }
3475
+ if ("current" in ref) ref.current = node;
3476
+ }, [
3477
+ ref
3478
+ ]);
3479
+ const [isFocusVisible, setIsFocusVisible] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
3480
+ const pointerActive = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(false);
3481
+ const handleClear = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(()=>{
3482
+ onChange?.("");
3483
+ onClear?.();
3484
+ inputRef.current?.focus();
3485
+ }, [
3486
+ onChange,
3487
+ onClear
3488
+ ]);
3447
3489
  return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
3448
3490
  className: components_text_field_module.root,
3449
3491
  children: [
@@ -3452,19 +3494,74 @@ const text_field_TextField = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__
3452
3494
  htmlFor: id,
3453
3495
  children: label
3454
3496
  }) : null,
3455
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("input", {
3456
- ...props,
3457
- ref: ref,
3458
- "aria-describedby": describedBy,
3459
- "aria-invalid": invalid || void 0,
3497
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
3460
3498
  className: [
3461
- components_text_field_module.input,
3499
+ components_text_field_module.control,
3462
3500
  invalid ? components_text_field_module.invalid : null,
3463
- className
3501
+ isFocusVisible ? components_text_field_module.focusVisible : null
3464
3502
  ].filter(Boolean).join(" "),
3465
- disabled: isDisabled,
3466
- id: id,
3467
- onChange: onChange ? (e)=>onChange(e.target.value) : void 0
3503
+ "data-variant": variant,
3504
+ children: [
3505
+ Icon ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
3506
+ "aria-hidden": "true",
3507
+ className: components_text_field_module.icon,
3508
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Icon, {
3509
+ size: 12
3510
+ })
3511
+ }) : null,
3512
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("input", {
3513
+ ...props,
3514
+ ref: setInputRef,
3515
+ "aria-describedby": describedBy,
3516
+ "aria-invalid": invalid || void 0,
3517
+ "aria-label": ariaLabel,
3518
+ className: components_text_field_module.input,
3519
+ disabled: isDisabled,
3520
+ id: id,
3521
+ readOnly: isReadOnly,
3522
+ onPointerDown: (e)=>{
3523
+ pointerActive.current = true;
3524
+ onPointerDown?.(e);
3525
+ },
3526
+ onFocus: (e)=>{
3527
+ if (!pointerActive.current) setIsFocusVisible(true);
3528
+ pointerActive.current = false;
3529
+ onFocus?.(e);
3530
+ },
3531
+ onBlur: (e)=>{
3532
+ setIsFocusVisible(false);
3533
+ onBlur?.(e);
3534
+ },
3535
+ onKeyDown: (e)=>{
3536
+ if (isClearable && "Escape" === e.key) {
3537
+ e.preventDefault();
3538
+ handleClear();
3539
+ }
3540
+ onKeyDown?.(e);
3541
+ },
3542
+ onChange: onChange ? (e)=>onChange(e.target.value) : void 0
3543
+ }),
3544
+ isClearable ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("button", {
3545
+ "aria-label": "Clear",
3546
+ className: components_text_field_module.clear,
3547
+ tabIndex: -1,
3548
+ type: "button",
3549
+ onClick: handleClear,
3550
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("svg", {
3551
+ "aria-hidden": "true",
3552
+ fill: "none",
3553
+ height: "12",
3554
+ viewBox: "0 0 12 12",
3555
+ width: "12",
3556
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", {
3557
+ d: "M2 2L10 10M10 2L2 10",
3558
+ stroke: "currentColor",
3559
+ strokeLinecap: "round",
3560
+ strokeWidth: "1.5"
3561
+ })
3562
+ })
3563
+ }) : null
3564
+ ]
3468
3565
  }),
3469
3566
  description ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
3470
3567
  className: components_text_field_module.description,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ox0/ui",
3
- "version": "0.5.1",
3
+ "version": "0.7.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],