@viraui/react 0.0.15 → 0.0.17

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 (155) hide show
  1. package/dist/catalog.json +6 -0
  2. package/dist/components/avatar/avatar.css +1 -55
  3. package/dist/components/avatar/avatar.d.ts +1 -2
  4. package/dist/components/avatar/avatar.js +49 -14
  5. package/dist/components/avatar/avatar.module.js +7 -0
  6. package/dist/components/avatar/index.d.ts +2 -2
  7. package/dist/components/basic-input/basic-input.css +1 -45
  8. package/dist/components/basic-input/basic-input.d.ts +0 -1
  9. package/dist/components/basic-input/basic-input.js +24 -13
  10. package/dist/components/basic-input/basic-input.module.js +3 -0
  11. package/dist/components/basic-input/field-helper-copy.d.ts +2 -1
  12. package/dist/components/basic-input/field-helper-copy.js +43 -24
  13. package/dist/components/basic-input/field-label.css +1 -0
  14. package/dist/components/basic-input/field-label.d.ts +10 -0
  15. package/dist/components/basic-input/field-label.js +24 -0
  16. package/dist/components/basic-input/field-label.module.js +3 -0
  17. package/dist/components/basic-input/index.d.ts +7 -2
  18. package/dist/components/basic-input/input-control-group.d.ts +2 -0
  19. package/dist/components/basic-input/input-control-group.js +40 -7
  20. package/dist/components/button/button.css +1 -156
  21. package/dist/components/button/button.d.ts +3 -3
  22. package/dist/components/button/button.js +104 -14
  23. package/dist/components/button/button.module.js +7 -0
  24. package/dist/components/button/index.d.ts +2 -2
  25. package/dist/components/checkbox/checkbox.css +1 -0
  26. package/dist/components/checkbox/checkbox.d.ts +65 -0
  27. package/dist/components/checkbox/checkbox.guide.json +22 -0
  28. package/dist/components/checkbox/checkbox.js +73 -0
  29. package/dist/components/checkbox/checkbox.module.js +10 -0
  30. package/dist/components/checkbox/index.d.ts +2 -0
  31. package/dist/components/clamp-text/clamp-text.css +1 -12
  32. package/dist/components/clamp-text/clamp-text.d.ts +1 -2
  33. package/dist/components/clamp-text/clamp-text.js +27 -22
  34. package/dist/components/clamp-text/clamp-text.module.js +3 -0
  35. package/dist/components/clamp-text/index.d.ts +2 -2
  36. package/dist/components/elevator/elevator.d.ts +5 -5
  37. package/dist/components/elevator/elevator.js +27 -27
  38. package/dist/components/elevator/index.d.ts +2 -2
  39. package/dist/components/icon/icon.css +1 -7
  40. package/dist/components/icon/icon.d.ts +2 -3
  41. package/dist/components/icon/icon.js +18 -9
  42. package/dist/components/icon/icon.module.js +3 -0
  43. package/dist/components/icon/index.d.ts +2 -2
  44. package/dist/components/icon-button/icon-button.d.ts +2 -2
  45. package/dist/components/icon-button/icon-button.js +10 -3
  46. package/dist/components/icon-button/index.d.ts +2 -2
  47. package/dist/components/index.d.ts +18 -17
  48. package/dist/components/select/index.d.ts +2 -2
  49. package/dist/components/select/select-group.d.ts +1 -1
  50. package/dist/components/select/select-group.js +37 -9
  51. package/dist/components/select/select-indicator-slot.js +33 -10
  52. package/dist/components/select/select-option.d.ts +1 -1
  53. package/dist/components/select/select-option.js +40 -10
  54. package/dist/components/select/select-separator.js +14 -6
  55. package/dist/components/select/select.css +1 -193
  56. package/dist/components/select/select.d.ts +10 -11
  57. package/dist/components/select/select.js +156 -32
  58. package/dist/components/select/select.module.js +19 -0
  59. package/dist/components/skeleton/index.d.ts +2 -2
  60. package/dist/components/skeleton/skeleton.css +1 -36
  61. package/dist/components/skeleton/skeleton.d.ts +2 -3
  62. package/dist/components/skeleton/skeleton.js +26 -15
  63. package/dist/components/skeleton/skeleton.module.js +6 -0
  64. package/dist/components/slider/index.d.ts +2 -2
  65. package/dist/components/slider/slider-control.d.ts +1 -2
  66. package/dist/components/slider/slider-control.js +43 -19
  67. package/dist/components/slider/slider-utils.js +6 -3
  68. package/dist/components/slider/slider.css +1 -64
  69. package/dist/components/slider/slider.d.ts +5 -8
  70. package/dist/components/slider/slider.js +83 -17
  71. package/dist/components/slider/slider.module.js +12 -0
  72. package/dist/components/spinner/index.d.ts +2 -2
  73. package/dist/components/spinner/spinner.css +1 -45
  74. package/dist/components/spinner/spinner.d.ts +1 -2
  75. package/dist/components/spinner/spinner.js +29 -6
  76. package/dist/components/spinner/spinner.module.js +7 -0
  77. package/dist/components/stack/index.d.ts +2 -2
  78. package/dist/components/stack/stack.css +1 -57
  79. package/dist/components/stack/stack.d.ts +2 -3
  80. package/dist/components/stack/stack.js +40 -36
  81. package/dist/components/stack/stack.module.js +3 -0
  82. package/dist/components/surface/index.d.ts +2 -2
  83. package/dist/components/surface/surface.css +1 -70
  84. package/dist/components/surface/surface.d.ts +10 -6
  85. package/dist/components/surface/surface.js +43 -40
  86. package/dist/components/surface/surface.module.js +6 -0
  87. package/dist/components/switch/index.d.ts +2 -2
  88. package/dist/components/switch/switch.css +1 -73
  89. package/dist/components/switch/switch.d.ts +17 -5
  90. package/dist/components/switch/switch.js +59 -13
  91. package/dist/components/switch/switch.module.js +7 -0
  92. package/dist/components/text/index.d.ts +2 -2
  93. package/dist/components/text/text.css +1 -140
  94. package/dist/components/text/text.d.ts +8 -3
  95. package/dist/components/text/text.js +46 -41
  96. package/dist/components/text/text.module.js +3 -0
  97. package/dist/components/textarea/index.d.ts +2 -2
  98. package/dist/components/textarea/textarea.css +1 -45
  99. package/dist/components/textarea/textarea.d.ts +3 -4
  100. package/dist/components/textarea/textarea.js +51 -11
  101. package/dist/components/textarea/textarea.module.js +7 -0
  102. package/dist/components/textfield/index.d.ts +2 -2
  103. package/dist/components/textfield/textfield.css +1 -87
  104. package/dist/components/textfield/textfield.d.ts +3 -4
  105. package/dist/components/textfield/textfield.js +58 -12
  106. package/dist/components/textfield/textfield.module.js +9 -0
  107. package/dist/components/title/index.d.ts +2 -2
  108. package/dist/components/title/title.css +1 -127
  109. package/dist/components/title/title.d.ts +8 -3
  110. package/dist/components/title/title.js +44 -39
  111. package/dist/components/title/title.module.js +3 -0
  112. package/dist/consumption.json +8 -4
  113. package/dist/core/elevation/elevation-types.js +6 -3
  114. package/dist/core/elevation/get-elevation-props.d.ts +1 -1
  115. package/dist/core/elevation/get-elevation-props.js +14 -11
  116. package/dist/core/props/intrinsic-vira-props.js +12 -9
  117. package/dist/core/styles/resolve-axis-padding.d.ts +1 -1
  118. package/dist/core/styles/resolve-axis-padding.js +15 -16
  119. package/dist/core/theme/resolve-theme-value.d.ts +1 -1
  120. package/dist/core/theme/resolve-theme-value.js +7 -6
  121. package/dist/index.d.ts +2 -2
  122. package/dist/index.js +21 -1
  123. package/dist/internal-icons/icon-registry.d.ts +242 -239
  124. package/dist/internal-icons/icon-registry.js +247 -238
  125. package/dist/internal-icons/icons/duo/Magnifier.d.ts +7 -0
  126. package/dist/internal-icons/icons/duo/Magnifier.js +13 -0
  127. package/dist/internal-icons/icons/duo/Minus.d.ts +7 -0
  128. package/dist/internal-icons/icons/duo/Minus.js +13 -0
  129. package/dist/internal-icons/icons/duo/Plus.d.ts +7 -0
  130. package/dist/internal-icons/icons/duo/Plus.js +13 -0
  131. package/dist/internal-icons/icons/duo/index.d.ts +241 -238
  132. package/dist/internal-icons/icons/duo/index.js +241 -238
  133. package/dist/preflight-surface.json +160 -0
  134. package/dist/preflight.css +1 -1
  135. package/package.json +11 -9
  136. package/dist/components/avatar/index.js +0 -1
  137. package/dist/components/basic-input/index.js +0 -1
  138. package/dist/components/button/index.js +0 -1
  139. package/dist/components/clamp-text/index.js +0 -1
  140. package/dist/components/elevator/index.js +0 -1
  141. package/dist/components/icon/index.js +0 -1
  142. package/dist/components/icon-button/index.js +0 -1
  143. package/dist/components/index.js +0 -17
  144. package/dist/components/select/index.js +0 -1
  145. package/dist/components/skeleton/index.js +0 -1
  146. package/dist/components/slider/index.js +0 -1
  147. package/dist/components/slider/slider-control.css +0 -71
  148. package/dist/components/spinner/index.js +0 -1
  149. package/dist/components/stack/index.js +0 -1
  150. package/dist/components/surface/index.js +0 -1
  151. package/dist/components/switch/index.js +0 -1
  152. package/dist/components/text/index.js +0 -1
  153. package/dist/components/textarea/index.js +0 -1
  154. package/dist/components/textfield/index.js +0 -1
  155. package/dist/components/title/index.js +0 -1
@@ -1,17 +1,107 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button as PrimitiveButton } from '@base-ui/react/button';
3
- import { Spinner } from '../../components/spinner/index.js';
4
- import { extractIntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
5
- import { clsx } from 'clsx';
6
1
  import './button.css';
7
- const spinnerDimensionsBySize = {
8
- small: 'small',
9
- medium: 'small',
10
- big: 'regular',
2
+ "use client";
3
+ import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
4
+ import { Spinner } from "../spinner/spinner.js";
5
+ import button_module_default from "./button.module.js";
6
+ import { clsx } from "clsx";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { useRender } from "@base-ui/react/use-render";
9
+ import * as React from "react";
10
+ import { Button } from "@base-ui/react/button";
11
+ //#region src/components/button/button.tsx
12
+ var spinnerDimensionsBySize = {
13
+ small: "small",
14
+ medium: "small",
15
+ big: "regular"
11
16
  };
12
- export const Button = ({ children, className, disabled, icon, iconPosition = 'start', loading = false, size = 'medium', variant = 'primary', ...otherProps }) => {
13
- const isDisabled = disabled || loading;
14
- const isIconOnly = Boolean(icon) && (children == null || children === '');
15
- const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
16
- return (_jsxs(PrimitiveButton, { ...componentProps, ...intrinsicAttributes, "aria-busy": loading || undefined, className: clsx('Button', className), "data-loading": loading ? 'true' : 'false', "data-size": size, "data-icon-only": isIconOnly ? 'true' : undefined, "data-icon-position": icon && !isIconOnly ? iconPosition : undefined, "data-variant": variant, disabled: isDisabled, focusableWhenDisabled: loading, children: [isIconOnly ? (_jsx("span", { "aria-hidden": "true", className: "Content", "data-loading": loading ? 'true' : 'false', children: icon })) : (_jsxs(_Fragment, { children: [icon && (_jsx("span", { "aria-hidden": "true", className: "Content", "data-loading": loading ? 'true' : 'false', children: icon })), _jsx("span", { className: "Content", "data-loading": loading ? 'true' : 'false', children: children })] })), loading ? (_jsx("span", { "aria-hidden": "true", className: "SpinnerOverlay", children: _jsx(Spinner, { size: spinnerDimensionsBySize[size] }) })) : null] }));
17
+ function usesButtonPrimitiveRender(render) {
18
+ return render === void 0 || React.isValidElement(render) && render.type === "button";
19
+ }
20
+ var ButtonRenderRoot = ({ isDisabled, ref, render, rootProps }) => {
21
+ const { onClick, ...restRootProps } = rootProps;
22
+ return useRender({
23
+ defaultTagName: "button",
24
+ render,
25
+ ref,
26
+ state: { disabled: isDisabled },
27
+ props: {
28
+ ...restRootProps,
29
+ onClick: (event) => {
30
+ if (isDisabled) {
31
+ event.preventDefault();
32
+ return;
33
+ }
34
+ onClick?.(event);
35
+ },
36
+ ...isDisabled ? { "aria-disabled": true } : {}
37
+ }
38
+ });
17
39
  };
40
+ var ButtonRoot = ({ children, className, intrinsicAttributes, isDisabled, isIconOnly, icon, iconPosition, loading, passThroughProps, ref, render, size, variant }) => {
41
+ const rootProps = {
42
+ ...passThroughProps,
43
+ ...intrinsicAttributes,
44
+ "aria-busy": loading || void 0,
45
+ children,
46
+ className: clsx(button_module_default.Button, className),
47
+ "data-loading": loading ? "true" : "false",
48
+ "data-size": size,
49
+ "data-icon-only": isIconOnly ? "true" : void 0,
50
+ "data-icon-position": icon && !isIconOnly ? iconPosition : void 0,
51
+ "data-variant": variant
52
+ };
53
+ if (usesButtonPrimitiveRender(render)) return /* @__PURE__ */ jsx(Button, {
54
+ ...rootProps,
55
+ render,
56
+ ref,
57
+ disabled: isDisabled,
58
+ focusableWhenDisabled: loading
59
+ });
60
+ return /* @__PURE__ */ jsx(ButtonRenderRoot, {
61
+ isDisabled,
62
+ ref,
63
+ render,
64
+ rootProps
65
+ });
66
+ };
67
+ var Button$1 = ({ children, className, disabled, icon, iconPosition = "start", loading = false, size = "medium", variant = "primary", ...otherProps }) => {
68
+ const isDisabled = disabled || loading;
69
+ const isIconOnly = Boolean(icon) && (children == null || children === "");
70
+ const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
71
+ const { render, ref, ...passThroughProps } = componentProps;
72
+ return /* @__PURE__ */ jsxs(ButtonRoot, {
73
+ className,
74
+ intrinsicAttributes,
75
+ isDisabled,
76
+ isIconOnly,
77
+ icon,
78
+ iconPosition,
79
+ loading,
80
+ passThroughProps,
81
+ ref,
82
+ render,
83
+ size,
84
+ variant,
85
+ children: [isIconOnly ? /* @__PURE__ */ jsx("span", {
86
+ "aria-hidden": "true",
87
+ className: button_module_default.Content,
88
+ "data-loading": loading ? "true" : "false",
89
+ children: icon
90
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [icon && /* @__PURE__ */ jsx("span", {
91
+ "aria-hidden": "true",
92
+ className: button_module_default.Content,
93
+ "data-loading": loading ? "true" : "false",
94
+ children: icon
95
+ }), /* @__PURE__ */ jsx("span", {
96
+ className: button_module_default.Content,
97
+ "data-loading": loading ? "true" : "false",
98
+ children
99
+ })] }), loading ? /* @__PURE__ */ jsx("span", {
100
+ "aria-hidden": "true",
101
+ className: button_module_default.SpinnerOverlay,
102
+ children: /* @__PURE__ */ jsx(Spinner, { size: spinnerDimensionsBySize[size] })
103
+ }) : null]
104
+ });
105
+ };
106
+ //#endregion
107
+ export { Button$1 as Button };
@@ -0,0 +1,7 @@
1
+ var button_module_default = {
2
+ Button: "button-module_Button_oPhrP",
3
+ Content: "button-module_Content_w-pX-",
4
+ SpinnerOverlay: "button-module_SpinnerOverlay_vKqw1"
5
+ };
6
+ //#endregion
7
+ export { button_module_default as default };
@@ -1,2 +1,2 @@
1
- export { Button } from './button.js';
2
- export type { ButtonProps } from './button.js';
1
+ export { Button } from './button';
2
+ export type { ButtonProps } from './button';
@@ -0,0 +1 @@
1
+ .checkbox-module_Checkbox_3oGip{--checkbox-size:var(--space-medium);--checkbox-radius:var(--radius-x-small);--checkbox-background:var(--global-contrast);--checkbox-border-color:transparent;--checkbox-indicator-color:contrast-color(var(--global-primary));&:has([required]) [data-field-label]:after{content:" *";color:var(--highlight-red)}}.checkbox-module_CheckboxRoot_PeyF5{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;appearance:none;border:0;box-shadow:inset 0 0 0 1px var(--checkbox-border-color);inline-size:var(--checkbox-size);block-size:var(--checkbox-size);background:var(--checkbox-background);border-radius:var(--checkbox-radius);&[data-size=regular]{--checkbox-size:var(--space-large);--checkbox-radius:var(--radius-small)}&[data-checked]:not([data-disabled]):not([data-invalid]),&[data-indeterminate]:not([data-disabled]):not([data-invalid]){--checkbox-background:var(--global-primary);--checkbox-border-color:var(--global-primary);box-shadow:none}&[data-invalid]:not([data-disabled]),.checkbox-module_Checkbox_3oGip[data-invalid]>&:not([data-disabled]){--checkbox-border-color:var(--highlight-red);--checkbox-indicator-color:var(--highlight-red);box-shadow:inset 0 0 0 1px var(--highlight-red);outline-color:oklab(from var(--highlight-red) l a b/.5)}&[data-disabled],.checkbox-module_Checkbox_3oGip[data-disabled]>&{--checkbox-background:var(--global-disabled-background);--checkbox-border-color:transparent;--checkbox-indicator-color:var(--global-disabled-foreground);box-shadow:none}}.checkbox-module_Indicator_C-k-l{display:inline-flex;align-items:center;justify-content:center;color:var(--checkbox-indicator-color)}.checkbox-module_Icon_926Sa{stroke:currentColor}.checkbox-module_CheckboxRoot_PeyF5:not([data-indeterminate]) .checkbox-module_MinusIcon_Q57pY,.checkbox-module_CheckboxRoot_PeyF5[data-indeterminate] .checkbox-module_CheckIcon_XqUcs{display:none}.checkbox-module_CheckboxRoot_PeyF5[data-indeterminate] .checkbox-module_MinusIcon_Q57pY{display:inline-flex}
@@ -0,0 +1,65 @@
1
+ import { CheckboxRoot, FieldRoot } from '@base-ui/react';
2
+ import { StackProps } from '..';
3
+ import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
4
+ import type * as React from 'react';
5
+ /**
6
+ * Public Checkbox props.
7
+ *
8
+ * Includes Base UI checkbox props such as `checked`, `defaultChecked`, `indeterminate`,
9
+ * `disabled`, and change handlers, plus optional field copy rendered with the shared Vira
10
+ * field label/helper pattern.
11
+ *
12
+ * @default Base UI pass-through props keep upstream defaults.
13
+ */
14
+ export type CheckboxProps = CheckboxRoot.Props & Omit<FieldRoot.Props, 'ref'> & {
15
+ /**
16
+ * Adds `data-grow="false"` to the field root when false.
17
+ *
18
+ * @default The field root does not render a grow attribute.
19
+ */
20
+ grow?: IntrinsicViraProps['grow'];
21
+ /**
22
+ * Adds `data-shrink="false"` to the field root when false.
23
+ *
24
+ * @default The field root does not render a shrink attribute.
25
+ */
26
+ shrink?: IntrinsicViraProps['shrink'];
27
+ /**
28
+ * Visible label rendered with shared internal `FieldLabel`.
29
+ *
30
+ * @default No label is rendered.
31
+ */
32
+ label?: React.ReactNode;
33
+ /**
34
+ * Helper copy rendered with `Field.Description` and `Text` while the field is valid.
35
+ *
36
+ * @default No description is rendered.
37
+ */
38
+ description?: React.ReactNode;
39
+ /**
40
+ * Error copy rendered with `Field.Error` and `Text` in the same slot as `description`.
41
+ * Replaces description while the field is invalid.
42
+ *
43
+ * @default No static error copy is rendered.
44
+ */
45
+ error?: React.ReactNode;
46
+ /**
47
+ * Controls the visual checkbox size.
48
+ *
49
+ * @default 'small'
50
+ */
51
+ size?: 'regular' | 'small';
52
+ /**
53
+ * Sets block padding using one token for both sides or a `[start, end]` tuple.
54
+ *
55
+ * @default No block padding.
56
+ */
57
+ vPadding?: StackProps['vPadding'];
58
+ /**
59
+ * Sets inline padding using one token for both sides or a `[start, end]` tuple.
60
+ *
61
+ * @default No inline padding.
62
+ */
63
+ hPadding?: StackProps['hPadding'];
64
+ };
65
+ export declare const Checkbox: React.FC<CheckboxProps>;
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "Checkbox",
3
+ "summary": "Field-wrapped checkbox control with optional field copy.",
4
+ "whenToUse": [
5
+ "Single or multi-select boolean choices with optional label and helper text",
6
+ "Invalid and disabled states with Switch-parity focus treatment"
7
+ ],
8
+ "whenNotToUse": [
9
+ "Unlabeled checkbox without aria-label on the root",
10
+ "Mutually exclusive options in a set (use radio pattern instead)"
11
+ ],
12
+ "accessibility": [
13
+ "Provide visible label or aria-label so the checkbox has an accessible name",
14
+ "Checked and indeterminate states must map to native checkbox semantics exposed by the control",
15
+ "Surface invalid state and error copy through the shared field pattern"
16
+ ],
17
+ "antiPatterns": [
18
+ "Rendering a checkbox without label and without aria-label",
19
+ "Expecting description to stay visible when invalid without an error message"
20
+ ],
21
+ "related": ["Switch", "Stack", "Text"]
22
+ }
@@ -0,0 +1,73 @@
1
+ import './checkbox.css';
2
+ "use client";
3
+ import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
4
+ import { FieldHelperCopy } from "../basic-input/field-helper-copy.js";
5
+ import { FieldLabel } from "../basic-input/field-label.js";
6
+ import { Stack } from "../stack/stack.js";
7
+ import checkbox_module_default from "./checkbox.module.js";
8
+ import { Icon } from "../icon/icon.js";
9
+ import { clsx } from "clsx";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { Checkbox, Field } from "@base-ui/react";
12
+ //#region src/components/checkbox/checkbox.tsx
13
+ var Checkbox$1 = ({ className, description, dirty, disabled, error, invalid, label, name, ref, size = "small", vPadding, hPadding, touched, validate, validationDebounceTime, validationMode, ...checkboxRootProps }) => {
14
+ const hasTextDescription = Boolean(description || error);
15
+ const iconSize = size === "small" ? 12 : 16;
16
+ const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(checkboxRootProps);
17
+ return /* @__PURE__ */ jsx(Field.Root, {
18
+ ...intrinsicAttributes,
19
+ className: checkbox_module_default.Checkbox,
20
+ dirty,
21
+ disabled,
22
+ invalid,
23
+ name,
24
+ touched,
25
+ validate,
26
+ validationDebounceTime,
27
+ validationMode,
28
+ render: /* @__PURE__ */ jsx(Stack, {
29
+ direction: "row",
30
+ columnGap: size === "small" ? "small" : "medium",
31
+ fillChildren: false,
32
+ vAlign: hasTextDescription ? "start" : "center"
33
+ }),
34
+ children: /* @__PURE__ */ jsx(Field.Label, { children: /* @__PURE__ */ jsxs(Stack, {
35
+ direction: "row",
36
+ columnGap: size === "small" ? "small" : "medium",
37
+ fillChildren: false,
38
+ vAlign: hasTextDescription ? "start" : "center",
39
+ ...hPadding !== void 0 ? { hPadding } : {},
40
+ ...vPadding !== void 0 ? { vPadding } : {},
41
+ children: [/* @__PURE__ */ jsx(Checkbox.Root, {
42
+ ...componentProps,
43
+ className: clsx(checkbox_module_default.CheckboxRoot, className),
44
+ "data-size": size,
45
+ disabled,
46
+ name,
47
+ ref,
48
+ children: /* @__PURE__ */ jsxs(Checkbox.Indicator, {
49
+ className: checkbox_module_default.Indicator,
50
+ children: [/* @__PURE__ */ jsx(Icon, {
51
+ className: clsx(checkbox_module_default.Icon, checkbox_module_default.CheckIcon),
52
+ name: "Check",
53
+ size: iconSize
54
+ }), /* @__PURE__ */ jsx(Icon, {
55
+ className: clsx(checkbox_module_default.Icon, checkbox_module_default.MinusIcon),
56
+ name: "Minus",
57
+ size: iconSize
58
+ })]
59
+ })
60
+ }), label || description || error ? /* @__PURE__ */ jsxs(Stack, {
61
+ direction: "column",
62
+ fillChildren: false,
63
+ rowGap: size === "small" ? "2x-small" : "x-small",
64
+ children: [label && /* @__PURE__ */ jsx(FieldLabel, { children: label }), /* @__PURE__ */ jsx(FieldHelperCopy, {
65
+ description,
66
+ error
67
+ })]
68
+ }) : null]
69
+ }) })
70
+ });
71
+ };
72
+ //#endregion
73
+ export { Checkbox$1 as Checkbox };
@@ -0,0 +1,10 @@
1
+ var checkbox_module_default = {
2
+ Checkbox: "checkbox-module_Checkbox_3oGip",
3
+ CheckboxRoot: "checkbox-module_CheckboxRoot_PeyF5",
4
+ Indicator: "checkbox-module_Indicator_C-k-l",
5
+ Icon: "checkbox-module_Icon_926Sa",
6
+ MinusIcon: "checkbox-module_MinusIcon_Q57pY",
7
+ CheckIcon: "checkbox-module_CheckIcon_XqUcs"
8
+ };
9
+ //#endregion
10
+ export { checkbox_module_default as default };
@@ -0,0 +1,2 @@
1
+ export { Checkbox } from './checkbox';
2
+ export type { CheckboxProps } from './checkbox';
@@ -1,12 +1 @@
1
- @scope (.ClampText) {
2
- :scope {
3
- display: -webkit-box;
4
- -webkit-line-clamp: var(--clamp-text-rows, 1);
5
- -webkit-box-orient: vertical;
6
- overflow: hidden;
7
-
8
- &[data-clamp-text-inline='true'] {
9
- display: -webkit-inline-box;
10
- }
11
- }
12
- }
1
+ .clamp-text-module_ClampText_Whnkd{display:-webkit-box;-webkit-line-clamp:var(--clamp-text-rows,1);-webkit-box-orient:vertical;overflow:hidden;&[data-clamp-text-inline=true]{display:-webkit-inline-box}}
@@ -1,7 +1,6 @@
1
1
  import { useRender } from '@base-ui/react/use-render';
2
+ import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
2
3
  import type * as React from 'react';
3
- import './clamp-text.css';
4
- import type { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
5
4
  /**
6
5
  * Public ClampText props.
7
6
  *
@@ -1,24 +1,29 @@
1
- 'use client';
2
- import { useRender } from '@base-ui/react/use-render';
3
- import { extractIntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
4
- import { clsx } from 'clsx';
5
- import { useMemo } from 'react';
6
1
  import './clamp-text.css';
7
- export const ClampText = ({ className, inline = false, ref, render, rows = 1, style, ...otherProps }) => {
8
- const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
9
- const dynamicStyle = useMemo(() => ({
10
- '--clamp-text-rows': rows,
11
- }), [rows]);
12
- return useRender({
13
- defaultTagName: 'span',
14
- render,
15
- ref,
16
- props: {
17
- ...componentProps,
18
- ...intrinsicAttributes,
19
- 'data-clamp-text-inline': inline ? 'true' : 'false',
20
- className: clsx('ClampText', className),
21
- style: { ...dynamicStyle, ...style },
22
- },
23
- });
2
+ "use client";
3
+ import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
4
+ import clamp_text_module_default from "./clamp-text.module.js";
5
+ import { clsx } from "clsx";
6
+ import { useRender } from "@base-ui/react/use-render";
7
+ import { useMemo } from "react";
8
+ //#region src/components/clamp-text/clamp-text.tsx
9
+ var ClampText = ({ className, inline = false, ref, render, rows = 1, style, ...otherProps }) => {
10
+ const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
11
+ const dynamicStyle = useMemo(() => ({ "--clamp-text-rows": rows }), [rows]);
12
+ return useRender({
13
+ defaultTagName: "span",
14
+ render,
15
+ ref,
16
+ props: {
17
+ ...componentProps,
18
+ ...intrinsicAttributes,
19
+ "data-clamp-text-inline": inline ? "true" : "false",
20
+ className: clsx(clamp_text_module_default.ClampText, className),
21
+ style: {
22
+ ...dynamicStyle,
23
+ ...style
24
+ }
25
+ }
26
+ });
24
27
  };
28
+ //#endregion
29
+ export { ClampText };
@@ -0,0 +1,3 @@
1
+ var clamp_text_module_default = { ClampText: "clamp-text-module_ClampText_Whnkd" };
2
+ //#endregion
3
+ export { clamp_text_module_default as default };
@@ -1,2 +1,2 @@
1
- export { ClampText } from './clamp-text.js';
2
- export type { ClampTextProps } from './clamp-text.js';
1
+ export { ClampText } from './clamp-text';
2
+ export type { ClampTextProps } from './clamp-text';
@@ -1,9 +1,9 @@
1
+ import { ElevationDirection, ElevationLevel, ElevationShadowColor } from '../../core/elevation/elevation-types';
2
+ import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
1
3
  import type * as React from 'react';
2
- import type { ElevationDirection, ElevationLevel, ElevationShadowColor } from '../../core/elevation/elevation-types.js';
3
- import type { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
4
- export type { ElevationDirection, ElevationLevel, ElevationShadowColor, } from '../../core/elevation/elevation-types.js';
5
- export { ELEVATION_DEFAULTS } from '../../core/elevation/elevation-types.js';
6
- export { getElevationProps } from '../../core/elevation/get-elevation-props.js';
4
+ export type { ElevationDirection, ElevationLevel, ElevationShadowColor, } from '../../core/elevation/elevation-types';
5
+ export { ELEVATION_DEFAULTS } from '../../core/elevation/elevation-types';
6
+ export { getElevationProps } from '../../core/elevation/get-elevation-props';
7
7
  /**
8
8
  * Public Elevator props.
9
9
  *
@@ -1,29 +1,29 @@
1
- import { Children, cloneElement, isValidElement } from 'react';
2
- import { getElevationProps } from '../../core/elevation/get-elevation-props.js';
3
- import { extractIntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
4
- export { ELEVATION_DEFAULTS } from '../../core/elevation/elevation-types.js';
5
- export { getElevationProps } from '../../core/elevation/get-elevation-props.js';
6
- const mergeChildStyle = (childStyle, elevationStyle) => ({
7
- ...(childStyle ?? {}),
8
- ...elevationStyle,
1
+ import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
2
+ import "../../core/elevation/elevation-types.js";
3
+ import { getElevationProps } from "../../core/elevation/get-elevation-props.js";
4
+ import { Children, cloneElement, isValidElement } from "react";
5
+ //#region src/components/elevator/elevator.tsx
6
+ var mergeChildStyle = (childStyle, elevationStyle) => ({
7
+ ...childStyle ?? {},
8
+ ...elevationStyle
9
9
  });
10
- export const Elevator = ({ children, resting, hover, direction, shadowColor, extraShadow, ...otherProps }) => {
11
- const { intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
12
- const elevation = getElevationProps({
13
- resting,
14
- ...(hover !== undefined ? { hover } : {}),
15
- ...(direction !== undefined ? { direction } : {}),
16
- ...(shadowColor !== undefined ? { shadowColor } : {}),
17
- ...(extraShadow !== undefined ? { extraShadow } : {}),
18
- });
19
- return Children.map(children, (child) => {
20
- if (!isValidElement(child)) {
21
- return child;
22
- }
23
- return cloneElement(child, {
24
- ...intrinsicAttributes,
25
- ...elevation.attributes,
26
- style: mergeChildStyle(child.props.style, elevation.style),
27
- });
28
- });
10
+ var Elevator = ({ children, resting, hover, direction, shadowColor, extraShadow, ...otherProps }) => {
11
+ const { intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
12
+ const elevation = getElevationProps({
13
+ resting,
14
+ ...hover !== void 0 ? { hover } : {},
15
+ ...direction !== void 0 ? { direction } : {},
16
+ ...shadowColor !== void 0 ? { shadowColor } : {},
17
+ ...extraShadow !== void 0 ? { extraShadow } : {}
18
+ });
19
+ return Children.map(children, (child) => {
20
+ if (!isValidElement(child)) return child;
21
+ return cloneElement(child, {
22
+ ...intrinsicAttributes,
23
+ ...elevation.attributes,
24
+ style: mergeChildStyle(child.props.style, elevation.style)
25
+ });
26
+ });
29
27
  };
28
+ //#endregion
29
+ export { Elevator };
@@ -1,2 +1,2 @@
1
- export { ELEVATION_DEFAULTS, Elevator, getElevationProps } from './elevator.js';
2
- export type { ElevationDirection, ElevationLevel, ElevationShadowColor, ElevatorProps } from './elevator.js';
1
+ export { ELEVATION_DEFAULTS, Elevator, getElevationProps } from './elevator';
2
+ export type { ElevationDirection, ElevationLevel, ElevationShadowColor, ElevatorProps } from './elevator';
@@ -1,7 +1 @@
1
- @scope (.Icon) {
2
- :scope {
3
- display: inline-block;
4
- flex: none;
5
- vertical-align: middle;
6
- }
7
- }
1
+ .icon-module_Icon_6DoBq{display:inline-flex;flex:none;vertical-align:middle;& [fill]{fill:currentcolor}& [fill=none][stroke]{fill:none;stroke:currentcolor}}
@@ -1,6 +1,5 @@
1
- import type { GeneratedIconName, GeneratedIconVariant } from '#internal-icons/icon-registry';
2
- import './icon.css';
3
- import type { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
1
+ import { GeneratedIconName, GeneratedIconVariant } from '../../../dist/internal-icons/icon-registry.js';
2
+ import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
4
3
  export type IconName = GeneratedIconName;
5
4
  export type IconVariant = GeneratedIconVariant;
6
5
  export type IconProps = React.ComponentProps<'svg'> & IntrinsicViraProps & {
@@ -1,11 +1,20 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { generatedDefaultIconVariant, generatedIconRegistry } from '#internal-icons/icon-registry';
3
- import { extractIntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
4
- import { clsx } from 'clsx';
5
1
  import './icon.css';
6
- export const Icon = ({ className, name, size = 24, variant = generatedDefaultIconVariant, ...otherProps }) => {
7
- const resolvedVariant = generatedIconRegistry[variant] ? variant : generatedDefaultIconVariant;
8
- const ResolvedIcon = generatedIconRegistry[resolvedVariant][name];
9
- const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
10
- return (_jsx(ResolvedIcon, { ...componentProps, ...intrinsicAttributes, "aria-hidden": "true", className: clsx('Icon', className), size: size }));
2
+ import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
3
+ import icon_module_default from "./icon.module.js";
4
+ import { clsx } from "clsx";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { generatedDefaultIconVariant, generatedIconRegistry } from "#internal-icons/icon-registry";
7
+ //#region src/components/icon/icon.tsx
8
+ var Icon = ({ className, name, size = 24, variant = generatedDefaultIconVariant, ...otherProps }) => {
9
+ const ResolvedIcon = generatedIconRegistry[generatedIconRegistry[variant] ? variant : generatedDefaultIconVariant][name];
10
+ const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
11
+ return /* @__PURE__ */ jsx(ResolvedIcon, {
12
+ ...componentProps,
13
+ ...intrinsicAttributes,
14
+ "aria-hidden": "true",
15
+ className: clsx(icon_module_default.Icon, className),
16
+ size
17
+ });
11
18
  };
19
+ //#endregion
20
+ export { Icon };
@@ -0,0 +1,3 @@
1
+ var icon_module_default = { Icon: "icon-module_Icon_6DoBq" };
2
+ //#endregion
3
+ export { icon_module_default as default };
@@ -1,2 +1,2 @@
1
- export { Icon } from './icon.js';
2
- export type { IconProps } from './icon.js';
1
+ export { Icon } from './icon';
2
+ export type { IconProps } from './icon';
@@ -1,5 +1,5 @@
1
- import type { ButtonProps } from '../index.js';
2
- import type { ReactNode } from 'react';
1
+ import { ButtonProps } from '..';
2
+ import { ReactNode } from 'react';
3
3
  type AccessibleNameProps = {
4
4
  'aria-label': string;
5
5
  'aria-labelledby'?: never;
@@ -1,3 +1,10 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Button } from '../../components/button/button.js';
3
- export const IconButton = ({ icon, size = 'medium', ...props }) => (_jsx(Button, { icon: icon, size: size, ...props }));
1
+ import { Button } from "../button/button.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/icon-button/icon-button.tsx
4
+ var IconButton = ({ icon, size = "medium", ...props }) => /* @__PURE__ */ jsx(Button, {
5
+ icon,
6
+ size,
7
+ ...props
8
+ });
9
+ //#endregion
10
+ export { IconButton };
@@ -1,2 +1,2 @@
1
- export { IconButton } from './icon-button.js';
2
- export type { IconButtonProps } from './icon-button.js';
1
+ export { IconButton } from './icon-button';
2
+ export type { IconButtonProps } from './icon-button';
@@ -1,17 +1,18 @@
1
- export * from './avatar/index.js';
2
- export * from './clamp-text/index.js';
3
- export * from './elevator/index.js';
4
- export * from './button/index.js';
5
- export * from './icon-button/index.js';
6
- export * from './textfield/index.js';
7
- export * from './textarea/index.js';
8
- export * from './slider/index.js';
9
- export * from './switch/index.js';
10
- export * from './select/index.js';
11
- export * from './icon/index.js';
12
- export * from './skeleton/index.js';
13
- export * from './stack/index.js';
14
- export * from './surface/index.js';
15
- export * from './spinner/index.js';
16
- export * from './text/index.js';
17
- export * from './title/index.js';
1
+ export * from './avatar';
2
+ export * from './clamp-text';
3
+ export * from './elevator';
4
+ export * from './button';
5
+ export * from './icon-button';
6
+ export * from './textfield';
7
+ export * from './textarea';
8
+ export * from './slider';
9
+ export * from './switch';
10
+ export * from './checkbox';
11
+ export * from './select';
12
+ export * from './icon';
13
+ export * from './skeleton';
14
+ export * from './stack';
15
+ export * from './surface';
16
+ export * from './spinner';
17
+ export * from './text';
18
+ export * from './title';
@@ -1,2 +1,2 @@
1
- export { Select } from './select.js';
2
- export type { SelectProps } from './select.js';
1
+ export { Select } from './select';
2
+ export type { SelectProps } from './select';
@@ -1,4 +1,4 @@
1
- import type { SelectGroup as SelectGroupPrimitive } from '@base-ui/react/select';
1
+ import { SelectGroup as SelectGroupPrimitive } from '@base-ui/react/select';
2
2
  import type * as React from 'react';
3
3
  /**
4
4
  * Public Select.Group props.