@cloudflare/kumo 1.4.1 → 1.5.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.
- package/CHANGELOG.md +12 -0
- package/README.md +15 -7
- package/ai/component-registry.json +45 -127
- package/ai/component-registry.md +95 -100
- package/ai/schemas.ts +5 -4
- package/dist/.build-complete +1 -1
- package/dist/button-Bh96oxRL.js.map +1 -1
- package/dist/catalog.js +1 -1
- package/dist/{checkbox-C1LPq8eL.js → checkbox-CWANiedi.js} +3 -3
- package/dist/{checkbox-C1LPq8eL.js.map → checkbox-CWANiedi.js.map} +1 -1
- package/dist/{clipboard-text-CJSI9X2m.js → clipboard-text-CqueQiB8.js} +2 -2
- package/dist/{clipboard-text-CJSI9X2m.js.map → clipboard-text-CqueQiB8.js.map} +1 -1
- package/dist/{combobox-CWxn5aHA.js → combobox-C9koouxM.js} +4 -4
- package/dist/{combobox-CWxn5aHA.js.map → combobox-C9koouxM.js.map} +1 -1
- package/dist/{command-palette-J50WKjS7.js → command-palette-TGXgr6Vq.js} +2 -2
- package/dist/{command-palette-J50WKjS7.js.map → command-palette-TGXgr6Vq.js.map} +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/clipboard-text.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-palette.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/input.js +8 -7
- package/dist/components/label.js +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/meter.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sensitive-input.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/toast.js +5 -4
- package/dist/components/tooltip.js +1 -1
- package/dist/dialog-CpCeOqSZ.js +97 -0
- package/dist/dialog-CpCeOqSZ.js.map +1 -0
- package/dist/{dropdown-BAyk1knz.js → dropdown-DFeFcKfn.js} +3 -3
- package/dist/{dropdown-BAyk1knz.js.map → dropdown-DFeFcKfn.js.map} +1 -1
- package/dist/{field-B7ORz5ej.js → field-Dt-XuSaQ.js} +3 -3
- package/dist/{field-B7ORz5ej.js.map → field-Dt-XuSaQ.js.map} +1 -1
- package/dist/index.js +106 -104
- package/dist/{input-D6YgDfDG.js → input-GZAWBXYX.js} +3 -3
- package/dist/{input-D6YgDfDG.js.map → input-GZAWBXYX.js.map} +1 -1
- package/dist/{input-area-DN_Ncliw.js → input-area-CS1-ceY4.js} +21 -19
- package/dist/input-area-CS1-ceY4.js.map +1 -0
- package/dist/{input-group-BXzBwH4p.js → input-group-COo-wz5O.js} +2 -2
- package/dist/{input-group-BXzBwH4p.js.map → input-group-COo-wz5O.js.map} +1 -1
- package/dist/label-ChZ2Pp5p.js +58 -0
- package/dist/label-ChZ2Pp5p.js.map +1 -0
- package/dist/{link-CcuZKqob.js → link-Mj2WM1AS.js} +2 -2
- package/dist/{link-CcuZKqob.js.map → link-Mj2WM1AS.js.map} +1 -1
- package/dist/{menubar-CzimiryS.js → menubar-CbXWXQYR.js} +2 -2
- package/dist/{menubar-CzimiryS.js.map → menubar-CbXWXQYR.js.map} +1 -1
- package/dist/{meter-BrJnHJ3Q.js → meter-Bu5f3mAc.js} +2 -2
- package/dist/{meter-BrJnHJ3Q.js.map → meter-Bu5f3mAc.js.map} +1 -1
- package/dist/{pagination-D0x9KQSk.js → pagination-Bm8eMWpj.js} +2 -2
- package/dist/{pagination-D0x9KQSk.js.map → pagination-Bm8eMWpj.js.map} +1 -1
- package/dist/{popover-CtKDH8Yc.js → popover-D7yeRosi.js} +2 -2
- package/dist/{popover-CtKDH8Yc.js.map → popover-D7yeRosi.js.map} +1 -1
- package/dist/primitives/accordion.js +1 -1
- package/dist/primitives/alert-dialog.js +1 -1
- package/dist/primitives/autocomplete.js +1 -1
- package/dist/primitives/avatar.js +1 -1
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/checkbox-group.js +1 -1
- package/dist/primitives/checkbox.js +1 -1
- package/dist/primitives/collapsible.js +1 -1
- package/dist/primitives/combobox.js +1 -1
- package/dist/primitives/context-menu.js +1 -1
- package/dist/primitives/dialog.js +1 -1
- package/dist/primitives/direction-provider.js +1 -1
- package/dist/primitives/field.js +1 -1
- package/dist/primitives/fieldset.js +1 -1
- package/dist/primitives/form.js +1 -1
- package/dist/primitives/input.js +1 -1
- package/dist/primitives/menu.js +1 -1
- package/dist/primitives/menubar.js +1 -1
- package/dist/primitives/meter.js +1 -1
- package/dist/primitives/navigation-menu.js +1 -1
- package/dist/primitives/number-field.js +1 -1
- package/dist/primitives/popover.js +1 -1
- package/dist/primitives/preview-card.js +1 -1
- package/dist/primitives/progress.js +1 -1
- package/dist/primitives/radio-group.js +1 -1
- package/dist/primitives/radio.js +1 -1
- package/dist/primitives/scroll-area.js +1 -1
- package/dist/primitives/select.js +1 -1
- package/dist/primitives/separator.js +1 -1
- package/dist/primitives/slider.js +1 -1
- package/dist/primitives/switch.js +1 -1
- package/dist/primitives/tabs.js +1 -1
- package/dist/primitives/toast.js +1 -1
- package/dist/primitives/toggle-group.js +1 -1
- package/dist/primitives/toggle.js +1 -1
- package/dist/primitives/toolbar.js +1 -1
- package/dist/primitives/tooltip.js +1 -1
- package/dist/primitives.js +1 -1
- package/dist/{radio-CYejLANA.js → radio-CKn09bGo.js} +2 -2
- package/dist/{radio-CYejLANA.js.map → radio-CKn09bGo.js.map} +1 -1
- package/dist/{schemas-DCw6TIy0.js → schemas-B-D2OT-O.js} +7 -8
- package/dist/{schemas-DCw6TIy0.js.map → schemas-B-D2OT-O.js.map} +1 -1
- package/dist/{select-D4rKQAax.js → select-DvpgiOau.js} +3 -3
- package/dist/{select-D4rKQAax.js.map → select-DvpgiOau.js.map} +1 -1
- package/dist/{sensitive-input-DYvAmxkN.js → sensitive-input-BuYT6U6C.js} +4 -4
- package/dist/{sensitive-input-DYvAmxkN.js.map → sensitive-input-BuYT6U6C.js.map} +1 -1
- package/dist/src/components/button/button.d.ts +20 -12
- package/dist/src/components/button/button.d.ts.map +1 -1
- package/dist/src/components/dialog/dialog.d.ts +54 -13
- package/dist/src/components/dialog/dialog.d.ts.map +1 -1
- package/dist/src/components/dialog/index.d.ts +1 -1
- package/dist/src/components/dialog/index.d.ts.map +1 -1
- package/dist/src/components/input/index.d.ts +1 -1
- package/dist/src/components/input/index.d.ts.map +1 -1
- package/dist/src/components/input/input-area.d.ts +19 -0
- package/dist/src/components/input/input-area.d.ts.map +1 -1
- package/dist/src/components/label/label.d.ts +5 -3
- package/dist/src/components/label/label.d.ts.map +1 -1
- package/dist/src/components/toast/index.d.ts +1 -1
- package/dist/src/components/toast/index.d.ts.map +1 -1
- package/dist/src/components/toast/toast.d.ts +2 -0
- package/dist/src/components/toast/toast.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/{switch-z7FE1nQE.js → switch-Tu34uFoa.js} +3 -3
- package/dist/{switch-z7FE1nQE.js.map → switch-Tu34uFoa.js.map} +1 -1
- package/dist/{table-Sd2Etb1N.js → table-BUmvaBj8.js} +2 -2
- package/dist/{table-Sd2Etb1N.js.map → table-BUmvaBj8.js.map} +1 -1
- package/dist/{tabs-DAEeuQLd.js → tabs-B7THfqHW.js} +2 -2
- package/dist/{tabs-DAEeuQLd.js.map → tabs-B7THfqHW.js.map} +1 -1
- package/dist/{toast-B8ebpHaU.js → toast-Du4y8qng.js} +16 -14
- package/dist/{toast-B8ebpHaU.js.map → toast-Du4y8qng.js.map} +1 -1
- package/dist/{tooltip-C4DRhJi1.js → tooltip-BxV1H6AV.js} +2 -2
- package/dist/{tooltip-C4DRhJi1.js.map → tooltip-BxV1H6AV.js.map} +1 -1
- package/dist/{vendor-base-ui-kX0wjdav.js → vendor-base-ui-CQ6wEonS.js} +5 -5
- package/dist/{vendor-base-ui-kX0wjdav.js.map → vendor-base-ui-CQ6wEonS.js.map} +1 -1
- package/package.json +1 -1
- package/scripts/component-registry/index.ts +68 -12
- package/dist/dialog-x9n9wI13.js +0 -77
- package/dist/dialog-x9n9wI13.js.map +0 -1
- package/dist/input-area-DN_Ncliw.js.map +0 -1
- package/dist/label-B4FY8MX_.js +0 -50
- package/dist/label-B4FY8MX_.js.map +0 -1
|
@@ -5,8 +5,8 @@ import { useId as A } from "react";
|
|
|
5
5
|
import { c as g } from "./cn-Bhsu1vx2.js";
|
|
6
6
|
import { b as O } from "./button-Bh96oxRL.js";
|
|
7
7
|
import { S as P } from "./skeleton-line-CtpS1u1J.js";
|
|
8
|
-
import { F as z } from "./field-
|
|
9
|
-
import { aC as D, aD as T, aE as V, aF as B, aG as E, aH as G, aI as H, aJ as J, aK as K, aL as R } from "./vendor-base-ui-
|
|
8
|
+
import { F as z } from "./field-Dt-XuSaQ.js";
|
|
9
|
+
import { aC as D, aD as T, aE as V, aF as B, aG as E, aH as G, aI as H, aJ as J, aK as K, aL as R } from "./vendor-base-ui-CQ6wEonS.js";
|
|
10
10
|
function U({
|
|
11
11
|
children: r,
|
|
12
12
|
className: s,
|
|
@@ -119,4 +119,4 @@ U.Option = W;
|
|
|
119
119
|
export {
|
|
120
120
|
U as S
|
|
121
121
|
};
|
|
122
|
-
//# sourceMappingURL=select-
|
|
122
|
+
//# sourceMappingURL=select-DvpgiOau.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-D4rKQAax.js","sources":["../src/components/select/select.tsx"],"sourcesContent":["import { Select as SelectBase } from \"@base-ui/react/select\";\nimport { CaretUpDownIcon, CheckIcon } from \"@phosphor-icons/react\";\nimport { useId } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { buttonVariants } from \"../button\";\nimport { SkeletonLine } from \"../loader\";\nimport { Field, type FieldErrorMatch } from \"../field/field\";\n\n/** Select variant definitions (currently empty, reserved for future additions). */\nexport const KUMO_SELECT_VARIANTS = {\n // Select currently has no variant options but structure is ready for future additions\n} as const;\n\nexport const KUMO_SELECT_DEFAULT_VARIANTS = {} as const;\n\n/**\n * Select component styling metadata for Figma plugin code generation\n * Extracted from select.tsx implementation (source of truth)\n */\nexport const KUMO_SELECT_STYLING = {\n trigger: {\n height: 36, // h-9\n paddingX: 12, // px-3\n borderRadius: 8, // rounded-lg\n background: \"color-secondary\",\n text: \"text-color-surface\",\n ring: \"color-border\",\n fontSize: 16, // text-base\n fontWeight: 400, // font-normal\n },\n stateTokens: {\n focus: { ring: \"color-active\" },\n disabled: { opacity: 0.5 },\n },\n icons: {\n caret: { name: \"ph-caret-up-down\", size: 20 },\n check: { name: \"ph-check\", size: 20 },\n },\n popup: {\n background: \"color-secondary\",\n ring: \"color-border\",\n borderRadius: 8, // rounded-lg\n padding: 6, // p-1.5\n },\n option: {\n paddingX: 8, // px-2\n paddingY: 6, // py-1.5\n borderRadius: 4, // rounded\n fontSize: 16, // text-base\n highlightBackground: \"color-surface-secondary\",\n },\n} as const;\n\n// Derived types from KUMO_SELECT_VARIANTS\nexport interface KumoSelectVariantsProps {}\n\nexport function selectVariants(_props: KumoSelectVariantsProps = {}) {\n return cn(\n buttonVariants(),\n \"justify-between font-normal\",\n \"outline-none focus:opacity-100 focus-visible:ring-1 focus-visible:ring-kumo-ring *:in-focus:opacity-100\",\n );\n}\n\ntype SelectPropsGeneric<\n T,\n Multiple extends boolean | undefined = false,\n> = SelectBase.Root.Props<T, Multiple> &\n KumoSelectVariantsProps & {\n multiple?: Multiple;\n renderValue?: (value: Multiple extends true ? T[] : T) => ReactNode;\n className?: string;\n /** Label content for the select (enables Field wrapper) - can be a string or any React node */\n label?: ReactNode;\n /** Visually hide the label (sr-only). Set to `false` for a visible label. @default true */\n hideLabel?: boolean;\n placeholder?: string;\n loading?: boolean;\n /** Tooltip content to display next to the label via an info icon */\n labelTooltip?: ReactNode;\n /** Helper text displayed below the select */\n description?: ReactNode;\n /** Error message or validation error object */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n };\n\n/**\n * Select component props.\n *\n * @example\n * ```tsx\n * <Select label=\"Country\" onValueChange={setValue}>\n * <Select.Option value=\"us\">United States</Select.Option>\n * <Select.Option value=\"uk\">United Kingdom</Select.Option>\n * </Select>\n * ```\n */\nexport interface SelectProps {\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n /** Label content for the select (enables Field wrapper) — can be a string or any React node. */\n label?: ReactNode;\n /**\n * Visually hide the label while keeping it accessible to screen readers.\n * Set to `false` to show a visible label above the select via the Field wrapper.\n * @default true\n */\n hideLabel?: boolean;\n /** Placeholder text shown when no value is selected. */\n placeholder?: string;\n /** When `true`, shows a skeleton loader in place of the selected value. */\n loading?: boolean;\n /** Whether the select is disabled. */\n disabled?: boolean;\n /** Whether the select is required. When `false`, shows \"(optional)\" text. */\n required?: boolean;\n /** Tooltip content displayed next to the label via an info icon. */\n labelTooltip?: ReactNode;\n /** Currently selected value (controlled mode). */\n value?: unknown;\n /** Initial value for uncontrolled mode. */\n defaultValue?: unknown;\n /** Callback fired when the selected value changes. */\n onValueChange?: (value: unknown) => void;\n /** Enable multi-select mode. */\n multiple?: boolean;\n /** `Select.Option` elements to render in the dropdown. */\n children?: ReactNode;\n /** Helper text displayed below the select. */\n description?: ReactNode;\n /** Error message string or validation error object with `match` key. */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n}\n\n/**\n * Dropdown for selecting a value from a list of options.\n * Wraps Base UI Select with Kumo styling and optional Field integration.\n *\n * @example\n * ```tsx\n * <Select label=\"Fruit\" onValueChange={setFruit}>\n * <Select.Option value=\"apple\">Apple</Select.Option>\n * <Select.Option value=\"banana\">Banana</Select.Option>\n * </Select>\n * ```\n */\nexport function Select<T, Multiple extends boolean | undefined = false>({\n children,\n className,\n renderValue,\n label,\n hideLabel = true,\n placeholder,\n loading,\n labelTooltip,\n description,\n error,\n required,\n ...props\n}: SelectPropsGeneric<T, Multiple> & { required?: boolean }) {\n const labelId = useId();\n const propLookup = props as Record<string, unknown>;\n const ariaLabel = propLookup[\"aria-label\"] as string | undefined;\n const ariaLabelledby = propLookup[\"aria-labelledby\"] as string | undefined;\n // For aria-label, use string label or placeholder (ReactNode labels can't be used for aria-label)\n const fallbackLabel = typeof label === \"string\" ? label : placeholder;\n\n // Use Field wrapper when label is provided and not hidden\n const useFieldWrapper = label && !hideLabel;\n const triggerLabelledBy = useFieldWrapper\n ? undefined\n : (ariaLabelledby ?? (label ? labelId : undefined));\n const triggerAriaLabel =\n ariaLabel ?? (!triggerLabelledBy ? fallbackLabel : undefined);\n\n // Placeholder must be provide via the items props\n // We need to fake the items or do some transformation\n let items = props.items;\n if (placeholder) {\n if (!items) {\n items = [\n {\n value: null as T,\n label: placeholder,\n },\n ];\n } else if (typeof items === \"object\") {\n items = [\n {\n value: null as T,\n label: placeholder,\n },\n ...Object.entries(items).map(([key, value]) => ({\n value: key as T,\n label: value,\n })),\n ];\n } else if (Array.isArray(items)) {\n items = [\n {\n value: null as T,\n label: placeholder,\n },\n ...items,\n ];\n }\n }\n\n const selectControl = (\n <SelectBase.Root\n {...props}\n items={items}\n disabled={loading || props.disabled}\n >\n <SelectBase.Trigger\n className={cn(\n buttonVariants(),\n \"justify-between font-normal\",\n \"outline-none focus:opacity-100 focus-visible:ring-1 focus-visible:ring-kumo-ring *:in-focus:opacity-100\",\n props.disabled && \"cursor-not-allowed opacity-50\",\n className,\n )}\n aria-label={triggerAriaLabel}\n aria-labelledby={triggerLabelledBy}\n >\n {loading ? (\n <SkeletonLine className=\"w-32\" />\n ) : (\n <SelectBase.Value>{renderValue}</SelectBase.Value>\n )}\n <SelectBase.Icon className=\"flex items-center\">\n <CaretUpDownIcon />\n </SelectBase.Icon>\n </SelectBase.Trigger>\n <SelectBase.Portal>\n <SelectBase.Positioner className=\"z-50\">\n <SelectBase.Popup\n className={cn(\n \"z-50 overflow-hidden bg-kumo-control text-kumo-default\", // background\n \"rounded-lg shadow-lg ring ring-kumo-line\", // border part\n // 3px adjustment to account for padding + border differences\n \"min-w-[calc(var(--anchor-width)+3px)] p-1.5\", // spacing\n )}\n >\n {children}\n </SelectBase.Popup>\n </SelectBase.Positioner>\n </SelectBase.Portal>\n </SelectBase.Root>\n );\n\n // Use Field wrapper when label is provided and not hidden\n if (useFieldWrapper) {\n return (\n <Field\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n description={description}\n error={\n error\n ? typeof error === \"string\"\n ? { message: error, match: true }\n : error\n : undefined\n }\n >\n {selectControl}\n </Field>\n );\n }\n\n // Render with standalone label when label is hidden (sr-only)\n return (\n <>\n {label && (\n <span id={labelId} className=\"sr-only\">\n {label}\n </span>\n )}\n {selectControl}\n </>\n );\n}\n\ntype OptionProps<T> = {\n children: ReactNode;\n value: T;\n};\n\nfunction Option<T>({ children, value }: OptionProps<T>) {\n return (\n <SelectBase.Item\n value={value}\n className=\"group flex cursor-pointer items-center justify-between gap-2 rounded px-2 py-1.5 text-base data-highlighted:bg-kumo-overlay\"\n >\n <SelectBase.ItemText>{children}</SelectBase.ItemText>\n <SelectBase.ItemIndicator>\n <CheckIcon />\n </SelectBase.ItemIndicator>\n </SelectBase.Item>\n );\n}\n\nSelect.Option = Option;\n"],"names":["Select","children","className","renderValue","label","hideLabel","placeholder","loading","labelTooltip","description","error","required","props","labelId","useId","propLookup","ariaLabel","ariaLabelledby","fallbackLabel","useFieldWrapper","triggerLabelledBy","triggerAriaLabel","items","key","value","selectControl","jsxs","SelectBase.Root","SelectBase.Trigger","cn","buttonVariants","jsx","SkeletonLine","SelectBase.Value","SelectBase.Icon","CaretUpDownIcon","SelectBase.Portal","SelectBase.Positioner","SelectBase.Popup","Field","Fragment","Option","SelectBase.Item","SelectBase.ItemText","SelectBase.ItemIndicator","CheckIcon"],"mappings":";;;;;;;;;AAmJO,SAASA,EAAwD;AAAA,EACtE,UAAAC;AAAA,EACA,WAAAC;AAAA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S;AAAA,0BAC9B2C,GAAA,EACC,UAAA,gBAAAb,EAACc,KAAU,EAAA,CACb;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA7C,EAAO,SAASyC;"}
|
|
1
|
+
{"version":3,"file":"select-DvpgiOau.js","sources":["../src/components/select/select.tsx"],"sourcesContent":["import { Select as SelectBase } from \"@base-ui/react/select\";\nimport { CaretUpDownIcon, CheckIcon } from \"@phosphor-icons/react\";\nimport { useId } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { buttonVariants } from \"../button\";\nimport { SkeletonLine } from \"../loader\";\nimport { Field, type FieldErrorMatch } from \"../field/field\";\n\n/** Select variant definitions (currently empty, reserved for future additions). */\nexport const KUMO_SELECT_VARIANTS = {\n // Select currently has no variant options but structure is ready for future additions\n} as const;\n\nexport const KUMO_SELECT_DEFAULT_VARIANTS = {} as const;\n\n/**\n * Select component styling metadata for Figma plugin code generation\n * Extracted from select.tsx implementation (source of truth)\n */\nexport const KUMO_SELECT_STYLING = {\n trigger: {\n height: 36, // h-9\n paddingX: 12, // px-3\n borderRadius: 8, // rounded-lg\n background: \"color-secondary\",\n text: \"text-color-surface\",\n ring: \"color-border\",\n fontSize: 16, // text-base\n fontWeight: 400, // font-normal\n },\n stateTokens: {\n focus: { ring: \"color-active\" },\n disabled: { opacity: 0.5 },\n },\n icons: {\n caret: { name: \"ph-caret-up-down\", size: 20 },\n check: { name: \"ph-check\", size: 20 },\n },\n popup: {\n background: \"color-secondary\",\n ring: \"color-border\",\n borderRadius: 8, // rounded-lg\n padding: 6, // p-1.5\n },\n option: {\n paddingX: 8, // px-2\n paddingY: 6, // py-1.5\n borderRadius: 4, // rounded\n fontSize: 16, // text-base\n highlightBackground: \"color-surface-secondary\",\n },\n} as const;\n\n// Derived types from KUMO_SELECT_VARIANTS\nexport interface KumoSelectVariantsProps {}\n\nexport function selectVariants(_props: KumoSelectVariantsProps = {}) {\n return cn(\n buttonVariants(),\n \"justify-between font-normal\",\n \"outline-none focus:opacity-100 focus-visible:ring-1 focus-visible:ring-kumo-ring *:in-focus:opacity-100\",\n );\n}\n\ntype SelectPropsGeneric<\n T,\n Multiple extends boolean | undefined = false,\n> = SelectBase.Root.Props<T, Multiple> &\n KumoSelectVariantsProps & {\n multiple?: Multiple;\n renderValue?: (value: Multiple extends true ? T[] : T) => ReactNode;\n className?: string;\n /** Label content for the select (enables Field wrapper) - can be a string or any React node */\n label?: ReactNode;\n /** Visually hide the label (sr-only). Set to `false` for a visible label. @default true */\n hideLabel?: boolean;\n placeholder?: string;\n loading?: boolean;\n /** Tooltip content to display next to the label via an info icon */\n labelTooltip?: ReactNode;\n /** Helper text displayed below the select */\n description?: ReactNode;\n /** Error message or validation error object */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n };\n\n/**\n * Select component props.\n *\n * @example\n * ```tsx\n * <Select label=\"Country\" onValueChange={setValue}>\n * <Select.Option value=\"us\">United States</Select.Option>\n * <Select.Option value=\"uk\">United Kingdom</Select.Option>\n * </Select>\n * ```\n */\nexport interface SelectProps {\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n /** Label content for the select (enables Field wrapper) — can be a string or any React node. */\n label?: ReactNode;\n /**\n * Visually hide the label while keeping it accessible to screen readers.\n * Set to `false` to show a visible label above the select via the Field wrapper.\n * @default true\n */\n hideLabel?: boolean;\n /** Placeholder text shown when no value is selected. */\n placeholder?: string;\n /** When `true`, shows a skeleton loader in place of the selected value. */\n loading?: boolean;\n /** Whether the select is disabled. */\n disabled?: boolean;\n /** Whether the select is required. When `false`, shows \"(optional)\" text. */\n required?: boolean;\n /** Tooltip content displayed next to the label via an info icon. */\n labelTooltip?: ReactNode;\n /** Currently selected value (controlled mode). */\n value?: unknown;\n /** Initial value for uncontrolled mode. */\n defaultValue?: unknown;\n /** Callback fired when the selected value changes. */\n onValueChange?: (value: unknown) => void;\n /** Enable multi-select mode. */\n multiple?: boolean;\n /** `Select.Option` elements to render in the dropdown. */\n children?: ReactNode;\n /** Helper text displayed below the select. */\n description?: ReactNode;\n /** Error message string or validation error object with `match` key. */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n}\n\n/**\n * Dropdown for selecting a value from a list of options.\n * Wraps Base UI Select with Kumo styling and optional Field integration.\n *\n * @example\n * ```tsx\n * <Select label=\"Fruit\" onValueChange={setFruit}>\n * <Select.Option value=\"apple\">Apple</Select.Option>\n * <Select.Option value=\"banana\">Banana</Select.Option>\n * </Select>\n * ```\n */\nexport function Select<T, Multiple extends boolean | undefined = false>({\n children,\n className,\n renderValue,\n label,\n hideLabel = true,\n placeholder,\n loading,\n labelTooltip,\n description,\n error,\n required,\n ...props\n}: SelectPropsGeneric<T, Multiple> & { required?: boolean }) {\n const labelId = useId();\n const propLookup = props as Record<string, unknown>;\n const ariaLabel = propLookup[\"aria-label\"] as string | undefined;\n const ariaLabelledby = propLookup[\"aria-labelledby\"] as string | undefined;\n // For aria-label, use string label or placeholder (ReactNode labels can't be used for aria-label)\n const fallbackLabel = typeof label === \"string\" ? label : placeholder;\n\n // Use Field wrapper when label is provided and not hidden\n const useFieldWrapper = label && !hideLabel;\n const triggerLabelledBy = useFieldWrapper\n ? undefined\n : (ariaLabelledby ?? (label ? labelId : undefined));\n const triggerAriaLabel =\n ariaLabel ?? (!triggerLabelledBy ? fallbackLabel : undefined);\n\n // Placeholder must be provide via the items props\n // We need to fake the items or do some transformation\n let items = props.items;\n if (placeholder) {\n if (!items) {\n items = [\n {\n value: null as T,\n label: placeholder,\n },\n ];\n } else if (typeof items === \"object\") {\n items = [\n {\n value: null as T,\n label: placeholder,\n },\n ...Object.entries(items).map(([key, value]) => ({\n value: key as T,\n label: value,\n })),\n ];\n } else if (Array.isArray(items)) {\n items = [\n {\n value: null as T,\n label: placeholder,\n },\n ...items,\n ];\n }\n }\n\n const selectControl = (\n <SelectBase.Root\n {...props}\n items={items}\n disabled={loading || props.disabled}\n >\n <SelectBase.Trigger\n className={cn(\n buttonVariants(),\n \"justify-between font-normal\",\n \"outline-none focus:opacity-100 focus-visible:ring-1 focus-visible:ring-kumo-ring *:in-focus:opacity-100\",\n props.disabled && \"cursor-not-allowed opacity-50\",\n className,\n )}\n aria-label={triggerAriaLabel}\n aria-labelledby={triggerLabelledBy}\n >\n {loading ? (\n <SkeletonLine className=\"w-32\" />\n ) : (\n <SelectBase.Value>{renderValue}</SelectBase.Value>\n )}\n <SelectBase.Icon className=\"flex items-center\">\n <CaretUpDownIcon />\n </SelectBase.Icon>\n </SelectBase.Trigger>\n <SelectBase.Portal>\n <SelectBase.Positioner className=\"z-50\">\n <SelectBase.Popup\n className={cn(\n \"z-50 overflow-hidden bg-kumo-control text-kumo-default\", // background\n \"rounded-lg shadow-lg ring ring-kumo-line\", // border part\n // 3px adjustment to account for padding + border differences\n \"min-w-[calc(var(--anchor-width)+3px)] p-1.5\", // spacing\n )}\n >\n {children}\n </SelectBase.Popup>\n </SelectBase.Positioner>\n </SelectBase.Portal>\n </SelectBase.Root>\n );\n\n // Use Field wrapper when label is provided and not hidden\n if (useFieldWrapper) {\n return (\n <Field\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n description={description}\n error={\n error\n ? typeof error === \"string\"\n ? { message: error, match: true }\n : error\n : undefined\n }\n >\n {selectControl}\n </Field>\n );\n }\n\n // Render with standalone label when label is hidden (sr-only)\n return (\n <>\n {label && (\n <span id={labelId} className=\"sr-only\">\n {label}\n </span>\n )}\n {selectControl}\n </>\n );\n}\n\ntype OptionProps<T> = {\n children: ReactNode;\n value: T;\n};\n\nfunction Option<T>({ children, value }: OptionProps<T>) {\n return (\n <SelectBase.Item\n value={value}\n className=\"group flex cursor-pointer items-center justify-between gap-2 rounded px-2 py-1.5 text-base data-highlighted:bg-kumo-overlay\"\n >\n <SelectBase.ItemText>{children}</SelectBase.ItemText>\n <SelectBase.ItemIndicator>\n <CheckIcon />\n </SelectBase.ItemIndicator>\n </SelectBase.Item>\n );\n}\n\nSelect.Option = Option;\n"],"names":["Select","children","className","renderValue","label","hideLabel","placeholder","loading","labelTooltip","description","error","required","props","labelId","useId","propLookup","ariaLabel","ariaLabelledby","fallbackLabel","useFieldWrapper","triggerLabelledBy","triggerAriaLabel","items","key","value","selectControl","jsxs","SelectBase.Root","SelectBase.Trigger","cn","buttonVariants","jsx","SkeletonLine","SelectBase.Value","SelectBase.Icon","CaretUpDownIcon","SelectBase.Portal","SelectBase.Positioner","SelectBase.Popup","Field","Fragment","Option","SelectBase.Item","SelectBase.ItemText","SelectBase.ItemIndicator","CheckIcon"],"mappings":";;;;;;;;;AAmJO,SAASA,EAAwD;AAAA,EACtE,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GAA6D;AAC3D,QAAMC,IAAUC,EAAA,GACVC,IAAaH,GACbI,IAAYD,EAAW,YAAY,GACnCE,IAAiBF,EAAW,iBAAiB,GAE7CG,IAAgB,OAAOd,KAAU,WAAWA,IAAQE,GAGpDa,IAAkBf,KAAS,CAACC,GAC5Be,IAAoBD,IACtB,SACCF,MAAmBb,IAAQS,IAAU,SACpCQ,IACJL,MAAeI,IAAoC,SAAhBF;AAIrC,MAAII,IAAQV,EAAM;AAClB,EAAIN,MACGgB,IAOM,OAAOA,KAAU,WAC1BA,IAAQ;AAAA,IACN;AAAA,MACE,OAAO;AAAA,MACP,OAAOhB;AAAA,IAAA;AAAA,IAET,GAAG,OAAO,QAAQgB,CAAK,EAAE,IAAI,CAAC,CAACC,GAAKC,CAAK,OAAO;AAAA,MAC9C,OAAOD;AAAA,MACP,OAAOC;AAAA,IAAA,EACP;AAAA,EAAA,IAEK,MAAM,QAAQF,CAAK,MAC5BA,IAAQ;AAAA,IACN;AAAA,MACE,OAAO;AAAA,MACP,OAAOhB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BA,IACF;AAAA,MAGL,UAAAe;AAAA,IAAA;AAAA,EAAA,IAOL,gBAAAC,EAAAc,GAAA,EACG,UAAA;AAAA,IAAApC,uBACE,QAAA,EAAK,IAAIS,GAAS,WAAU,WAC1B,UAAAT,GACH;AAAA,IAEDqB;AAAA,EAAA,GACH;AAEJ;AAOA,SAASgB,EAAU,EAAE,UAAAxC,GAAU,OAAAuB,KAAyB;AACtD,SACE,gBAAAE;AAAA,IAACgB;AAAAA,IAAA;AAAA,MACC,OAAAlB;AAAA,MACA,WAAU;AAAA,MAEV,UAAA;AAAA,QAAA,gBAAAO,EAACY,GAAA,EAAqB,UAAA1C,GAAS;AAAA,0BAC9B2C,GAAA,EACC,UAAA,gBAAAb,EAACc,KAAU,EAAA,CACb;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA7C,EAAO,SAASyC;"}
|
|
@@ -3,9 +3,9 @@ import { jsxs as b, Fragment as ce, jsx as i } from "react/jsx-runtime";
|
|
|
3
3
|
import { EyeSlash as ue, Eye as pe } from "@phosphor-icons/react";
|
|
4
4
|
import { forwardRef as de, useState as w, useRef as N, useId as T, useCallback as l, useEffect as fe } from "react";
|
|
5
5
|
import { c as p } from "./cn-Bhsu1vx2.js";
|
|
6
|
-
import { K as me, i as ve } from "./input-
|
|
7
|
-
import { F as ge } from "./field-
|
|
8
|
-
import { I as he } from "./vendor-base-ui-
|
|
6
|
+
import { K as me, i as ve } from "./input-GZAWBXYX.js";
|
|
7
|
+
import { F as ge } from "./field-Dt-XuSaQ.js";
|
|
8
|
+
import { I as he } from "./vendor-base-ui-CQ6wEonS.js";
|
|
9
9
|
const Te = me, M = {
|
|
10
10
|
size: "base",
|
|
11
11
|
variant: "default"
|
|
@@ -255,4 +255,4 @@ export {
|
|
|
255
255
|
ye as S,
|
|
256
256
|
M as a
|
|
257
257
|
};
|
|
258
|
-
//# sourceMappingURL=sensitive-input-
|
|
258
|
+
//# sourceMappingURL=sensitive-input-BuYT6U6C.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sensitive-input-DYvAmxkN.js","sources":["../src/components/sensitive-input/sensitive-input.tsx"],"sourcesContent":["import { Eye, EyeSlash } from \"@phosphor-icons/react\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Input as BaseInput } from \"@base-ui/react/input\";\nimport {\n inputVariants,\n KUMO_INPUT_VARIANTS,\n type KumoInputSize,\n type KumoInputVariant,\n} from \"../input/input\";\nimport { Field, type FieldErrorMatch } from \"../field/field\";\n\nexport const KUMO_SENSITIVE_INPUT_VARIANTS = KUMO_INPUT_VARIANTS;\n\nexport const KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS = {\n size: \"base\",\n variant: \"default\",\n} as const;\n\ntype Mode = \"masked\" | \"revealed\" | \"empty\";\n\n/**\n * SensitiveInput component props.\n *\n * @example\n * ```tsx\n * <SensitiveInput label=\"API Key\" defaultValue=\"sk_live_abc123xyz789\" />\n * <SensitiveInput label=\"Secret\" value={secret} onValueChange={setSecret} />\n * ```\n */\nexport interface SensitiveInputProps\n extends Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"size\" | \"type\" | \"value\" | \"defaultValue\"\n > {\n /** Controlled value */\n value?: string;\n /** Uncontrolled default value */\n defaultValue?: string;\n /** Simplified change handler receiving just the value */\n onValueChange?: (value: string) => void;\n /** Callback fired after value is copied to clipboard */\n onCopy?: () => void;\n /**\n * Size of the input.\n * - `\"xs\"` — Extra small for compact UIs\n * - `\"sm\"` — Small for secondary fields\n * - `\"base\"` — Default input size\n * - `\"lg\"` — Large for prominent fields\n * @default \"base\"\n */\n size?: KumoInputSize;\n /**\n * Style variant of the input.\n * - `\"default\"` — Default input appearance\n * - `\"error\"` — Error state for validation failures\n * @default \"default\"\n */\n variant?: KumoInputVariant;\n /** Label content for the input (enables Field wrapper and sets masked state label) - can be a string or any React node */\n label?: ReactNode;\n /** Tooltip content to display next to the label via an info icon */\n labelTooltip?: ReactNode;\n /** Helper text displayed below the input */\n description?: ReactNode;\n /** Error message or validation error object */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n}\n\n/**\n * Password/secret input that masks its value by default and reveals on click.\n * Includes a built-in copy-to-clipboard button on hover.\n *\n * @example\n * ```tsx\n * <SensitiveInput label=\"API Key\" defaultValue=\"sk_live_abc123xyz789\" />\n * ```\n */\nexport const SensitiveInput = forwardRef<HTMLInputElement, SensitiveInputProps>(\n (\n {\n value: controlledValue,\n defaultValue = \"\",\n onChange,\n onValueChange,\n onCopy,\n size = KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS.size,\n variant = KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS.variant,\n disabled = false,\n readOnly = false,\n id,\n autoComplete = \"off\",\n className,\n label,\n labelTooltip,\n description,\n error,\n required,\n ...inputProps\n },\n ref,\n ) => {\n // For aria-label, only use string labels (ReactNode labels can't be used for aria-label)\n const ariaLabelFallback =\n typeof label === \"string\" ? label : \"Sensitive value\";\n const isControlled = controlledValue !== undefined;\n const [internalValue, setInternalValue] = useState(defaultValue);\n const value = isControlled ? controlledValue : internalValue;\n const hasValue = value.length > 0;\n\n const [mode, setMode] = useState<Mode>(() =>\n hasValue ? \"masked\" : \"empty\",\n );\n\n const [copied, setCopied] = useState(false);\n\n const inputRef = useRef<HTMLInputElement | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const liveRegionId = useId();\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const maskedInstructionId = useId();\n\n const mergedRef = useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n },\n [ref],\n );\n\n // Reset copied state after 2 seconds\n useEffect(() => {\n if (copied) {\n const timeoutId = setTimeout(() => setCopied(false), 2000);\n return () => clearTimeout(timeoutId);\n }\n }, [copied]);\n\n const copyToClipboard = useCallback(\n async (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n try {\n if (\n typeof navigator !== \"undefined\" &&\n navigator.clipboard &&\n typeof navigator.clipboard.writeText === \"function\"\n ) {\n await navigator.clipboard.writeText(value);\n setCopied(true);\n onCopy?.();\n return;\n }\n } catch {\n // Fall through to manual fallback\n }\n\n if (typeof document !== \"undefined\") {\n const textarea = document.createElement(\"textarea\");\n textarea.value = value;\n textarea.setAttribute(\"readonly\", \"\");\n textarea.style.position = \"absolute\";\n textarea.style.left = \"-9999px\";\n document.body.appendChild(textarea);\n const selection = document.getSelection();\n const previousRange = selection?.rangeCount\n ? selection.getRangeAt(0)\n : null;\n textarea.select();\n try {\n document.execCommand(\"copy\");\n setCopied(true);\n onCopy?.();\n } catch (error) {\n console.warn(\"Clipboard copy failed\", error);\n } finally {\n document.body.removeChild(textarea);\n if (previousRange) {\n selection?.removeAllRanges();\n selection?.addRange(previousRange);\n }\n }\n }\n },\n [value, onCopy],\n );\n\n // Sync mode when value changes externally\n const prevHasValueRef = useRef(hasValue);\n if (prevHasValueRef.current !== hasValue) {\n prevHasValueRef.current = hasValue;\n if (!hasValue && mode === \"masked\") {\n setMode(\"empty\");\n }\n }\n\n const handleContainerClick = useCallback(\n (e: React.MouseEvent) => {\n if (disabled) return;\n // Ignore clicks that originated from outside (e.g., label click focusing input)\n // Label clicks trigger a click on the input, but the click coordinates are outside the container\n if (containerRef.current) {\n const rect = containerRef.current.getBoundingClientRect();\n const isClickInsideContainer =\n e.clientX >= rect.left &&\n e.clientX <= rect.right &&\n e.clientY >= rect.top &&\n e.clientY <= rect.bottom;\n if (!isClickInsideContainer) return;\n }\n if (mode === \"masked\" && hasValue) {\n setMode(\"revealed\");\n if (!readOnly) {\n setTimeout(() => inputRef.current?.focus(), 0);\n }\n }\n },\n [mode, hasValue, disabled, readOnly],\n );\n\n const handleToggleVisibility = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n if (mode === \"revealed\") {\n setMode(\"masked\");\n } else if (mode === \"empty\" && hasValue) {\n setMode(\"revealed\");\n }\n },\n [mode, hasValue],\n );\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n if (!isControlled) {\n setInternalValue(newValue);\n }\n onChange?.(e);\n onValueChange?.(newValue);\n },\n [isControlled, onChange, onValueChange],\n );\n\n const handleBlur = useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n // Don't mask if focus is moving to a button inside the container (copy/eye buttons)\n if (\n containerRef.current &&\n e.relatedTarget instanceof Node &&\n containerRef.current.contains(e.relatedTarget)\n ) {\n return;\n }\n if (hasValue) {\n setMode(\"masked\");\n }\n },\n [hasValue],\n );\n\n const handleContainerKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (disabled) return;\n if (mode === \"masked\" && hasValue) {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n setMode(\"revealed\");\n if (!readOnly) {\n setTimeout(() => inputRef.current?.focus(), 0);\n }\n }\n }\n },\n [mode, hasValue, disabled, readOnly],\n );\n\n const handleInputKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (mode === \"revealed\" && e.key === \"Escape\") {\n setMode(\"masked\");\n // Move focus to container to avoid focus trap (input becomes tabIndex={-1})\n setTimeout(() => containerRef.current?.focus(), 0);\n }\n },\n [mode],\n );\n\n const isMaskedWithValue = mode === \"masked\" && hasValue;\n const showEyeButton =\n !disabled && (mode === \"revealed\" || (mode === \"empty\" && hasValue));\n\n // Icon sizes matching input sizes\n const iconSize = size === \"xs\" || size === \"sm\" ? \"size-3\" : \"size-4\";\n\n const containerClassName = cn(\n inputVariants({ size, variant, parentFocusIndicator: true }),\n \"group/container relative flex w-full items-center\",\n isMaskedWithValue && !disabled && \"cursor-pointer\",\n disabled && \"cursor-not-allowed\",\n className,\n );\n\n const containerContent = (\n <>\n {/* Input - defines the width, always rendered */}\n <BaseInput\n ref={mergedRef}\n id={inputId}\n type={mode === \"revealed\" ? \"text\" : \"password\"}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleInputKeyDown}\n disabled={disabled}\n readOnly={readOnly || isMaskedWithValue}\n autoComplete={autoComplete}\n tabIndex={isMaskedWithValue ? -1 : 0}\n className={cn(\n \"w-full border-0 bg-transparent p-0 text-kumo-default ring-0 outline-none placeholder:text-kumo-subtle disabled:cursor-not-allowed disabled:text-kumo-subtle\",\n size === \"xs\" && \"pr-5\",\n size === \"sm\" && \"pr-6\",\n size === \"base\" && \"pr-8\",\n size === \"lg\" && \"pr-10\",\n isMaskedWithValue && \"pointer-events-none text-transparent\",\n )}\n aria-hidden={isMaskedWithValue}\n {...inputProps}\n />\n\n {/* Mask overlay - absolutely positioned, doesn't affect layout */}\n <span\n className={cn(\n \"pointer-events-none absolute inset-y-0 left-0 flex items-center overflow-hidden select-none\",\n // Match input pr padding (space for icon)\n size === \"xs\" && \"right-5\",\n size === \"sm\" && \"right-6\",\n size === \"base\" && \"right-8\",\n size === \"lg\" && \"right-10\",\n // Match the padding from inputVariants\n size === \"xs\" && \"px-1.5\",\n size === \"sm\" && \"px-2\",\n size === \"base\" && \"px-3\",\n size === \"lg\" && \"px-4\",\n // Hidden when not masked\n !isMaskedWithValue && \"invisible\",\n // When masked: enable pointer events\n isMaskedWithValue && \"pointer-events-auto\",\n // Text color - use text-kumo-default to contrast with bg-kumo-control input background\n \"text-kumo-default\",\n // Hover state - pure CSS, no React state (group for children)\n \"group/mask\",\n )}\n aria-hidden=\"true\"\n >\n {/* Both texts rendered, stacked. Visibility toggled on hover to prevent layout shift */}\n <span className=\"relative\">\n <span\n className={cn(\n isMaskedWithValue &&\n !disabled &&\n \"group-focus-within/container:invisible group-hover/mask:invisible\",\n )}\n >\n ••••••••\n </span>\n {isMaskedWithValue && !disabled && (\n <span className=\"invisible absolute left-0 top-0 whitespace-nowrap text-kumo-subtle group-focus-within/container:visible group-hover/mask:visible\">\n Click to reveal\n </span>\n )}\n </span>\n </span>\n\n {/* Eye button - absolutely positioned to the right */}\n <button\n type=\"button\"\n onClick={handleToggleVisibility}\n onKeyDown={(e) => e.stopPropagation()}\n aria-label={mode === \"revealed\" ? \"Hide value\" : \"Reveal value\"}\n tabIndex={showEyeButton ? 0 : -1}\n className={cn(\n \"absolute top-1/2 right-0 -translate-y-1/2 cursor-pointer text-kumo-subtle outline-none hover:text-kumo-default focus:text-kumo-default\",\n // Match right padding from inputVariants\n size === \"xs\" && \"right-1.5\",\n size === \"sm\" && \"right-2\",\n size === \"base\" && \"right-3\",\n size === \"lg\" && \"right-4\",\n iconSize,\n !showEyeButton && \"pointer-events-none opacity-0\",\n )}\n >\n {mode === \"revealed\" ? (\n <EyeSlash className=\"size-full\" />\n ) : (\n <Eye className=\"size-full\" />\n )}\n </button>\n\n {/* Copy tab - appears on hover/focus at top right (hidden when disabled) */}\n {hasValue && !disabled && (\n <button\n type=\"button\"\n onClick={copyToClipboard}\n onKeyDown={(e) => e.stopPropagation()}\n aria-label={copied ? \"Copied\" : \"Copy to clipboard\"}\n className={cn(\n \"absolute -top-px right-2 -translate-y-full cursor-pointer rounded-t-md bg-kumo-brand px-2 py-0.5 text-xs text-white opacity-0 transition-opacity group-focus-within/container:opacity-100 group-hover/container:opacity-100 hover:brightness-120 focus-visible:outline focus-visible:outline-offset-1 focus-visible:outline-kumo-ring\",\n )}\n >\n {copied ? \"Copied\" : \"Copy\"}\n </button>\n )}\n </>\n );\n\n const input = (\n <div>\n {isMaskedWithValue ? (\n <div\n ref={containerRef}\n // Cannot use <button> here because containerContent contains interactive button elements (Copy, Reveal).\n // Using role=\"button\" with proper keyboard handling instead.\n // oxlint-disable-next-line prefer-tag-over-role\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n className={containerClassName}\n onClick={handleContainerClick}\n onKeyDown={handleContainerKeyDown}\n aria-label={`${ariaLabelFallback}, masked.`}\n aria-describedby={`${maskedInstructionId} ${liveRegionId}`}\n aria-disabled={disabled}\n >\n {containerContent}\n </div>\n ) : (\n <div ref={containerRef} className={containerClassName}>\n {containerContent}\n </div>\n )}\n {isMaskedWithValue && (\n <span id={maskedInstructionId} className=\"sr-only\">\n Click or press Enter to reveal.\n </span>\n )}\n <span id={liveRegionId} className=\"sr-only\" aria-live=\"polite\">\n {mode === \"masked\" && hasValue && \"Value hidden\"}\n {copied && \"Copied to clipboard\"}\n </span>\n </div>\n );\n\n // Render with Field wrapper if label is provided\n if (label) {\n return (\n <Field\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n description={description}\n error={\n error\n ? typeof error === \"string\"\n ? { message: error, match: true }\n : error\n : undefined\n }\n >\n {input}\n </Field>\n );\n }\n\n // Render bare input without Field wrapper\n return input;\n },\n);\n\nSensitiveInput.displayName = \"SensitiveInput\";\n"],"names":["KUMO_SENSITIVE_INPUT_VARIANTS","KUMO_INPUT_VARIANTS","KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS","SensitiveInput","forwardRef","controlledValue","defaultValue","onChange","onValueChange","onCopy","size","variant","disabled","readOnly","id","autoComplete","className","label","labelTooltip","description","error","required","inputProps","ref","ariaLabelFallback","isControlled","internalValue","setInternalValue","useState","value","hasValue","mode","setMode","copied","setCopied","inputRef","useRef","containerRef","liveRegionId","useId","generatedId","inputId","maskedInstructionId","mergedRef","useCallback","node","useEffect","timeoutId","copyToClipboard","textarea","selection","previousRange","prevHasValueRef","handleContainerClick","rect","handleToggleVisibility","handleChange","newValue","handleBlur","handleContainerKeyDown","handleInputKeyDown","isMaskedWithValue","showEyeButton","iconSize","containerClassName","cn","inputVariants","containerContent","jsxs","Fragment","jsx","BaseInput","EyeSlash","Eye","input","Field"],"mappings":";;;;;;;;AAqBO,MAAMA,KAAgCC,IAEhCC,IAAwC;AAAA,EACnD,MAAM;AAAA,EACN,SAAS;AACX,GA6DaC,KAAiBC;AAAA,EAC5B,CACE;AAAA,IACE,OAAOC;AAAA,IACP,cAAA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C,WAAWgC;AAAA,YACT;AAAA,UAAA;AAAA,UAGD,cAAS,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IACvB,GAEJ,GAGIS,sBACH,OAAA,EACE,UAAA;AAAA,MAAAb,IACC,gBAAAS;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,KAAKjC;AAAA,UAIL,MAAK;AAAA,UACL,UAAUzB,IAAW,KAAK;AAAA,UAC1B,WAAWoD;AAAA,UACX,SAASX;AAAA,UACT,WAAWM;AAAA,UACX,cAAY,GAAGnC,CAAiB;AAAA,UAChC,oBAAkB,GAAGkB,CAAmB,IAAIJ,CAAY;AAAA,UACxD,iBAAe1B;AAAA,UAEd,UAAAuD;AAAA,QAAA;AAAA,MAAA,IAGH,gBAAAG,EAAC,OAAA,EAAI,KAAKjC,GAAc,WAAW2B,GAChC,UAAAG,GACH;AAAA,MAEDN,KACC,gBAAAS,EAAC,QAAA,EAAK,IAAI5B,GAAqB,WAAU,WAAU,UAAA,mCAEnD;AAAA,wBAED,QAAA,EAAK,IAAIJ,GAAc,WAAU,WAAU,aAAU,UACnD,UAAA;AAAA,QAAAP,MAAS,YAAYD,KAAY;AAAA,QACjCG,KAAU;AAAA,MAAA,EAAA,CACb;AAAA,IAAA,GACF;AAIF,WAAIhB,IAEA,gBAAAqD;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,OAAA1D;AAAA,QACA,UAAAI;AAAA,QACA,cAAAH;AAAA,QACA,aAAAC;AAAA,QACA,OACEC,IACI,OAAOA,KAAU,WACf,EAAE,SAASA,GAAO,OAAO,GAAA,IACzBA,IACF;AAAA,QAGL,UAAAsD;AAAA,MAAA;AAAA,IAAA,IAMAA;AAAA,EACT;AACF;AAEAvE,GAAe,cAAc;"}
|
|
1
|
+
{"version":3,"file":"sensitive-input-BuYT6U6C.js","sources":["../src/components/sensitive-input/sensitive-input.tsx"],"sourcesContent":["import { Eye, EyeSlash } from \"@phosphor-icons/react\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Input as BaseInput } from \"@base-ui/react/input\";\nimport {\n inputVariants,\n KUMO_INPUT_VARIANTS,\n type KumoInputSize,\n type KumoInputVariant,\n} from \"../input/input\";\nimport { Field, type FieldErrorMatch } from \"../field/field\";\n\nexport const KUMO_SENSITIVE_INPUT_VARIANTS = KUMO_INPUT_VARIANTS;\n\nexport const KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS = {\n size: \"base\",\n variant: \"default\",\n} as const;\n\ntype Mode = \"masked\" | \"revealed\" | \"empty\";\n\n/**\n * SensitiveInput component props.\n *\n * @example\n * ```tsx\n * <SensitiveInput label=\"API Key\" defaultValue=\"sk_live_abc123xyz789\" />\n * <SensitiveInput label=\"Secret\" value={secret} onValueChange={setSecret} />\n * ```\n */\nexport interface SensitiveInputProps\n extends Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"size\" | \"type\" | \"value\" | \"defaultValue\"\n > {\n /** Controlled value */\n value?: string;\n /** Uncontrolled default value */\n defaultValue?: string;\n /** Simplified change handler receiving just the value */\n onValueChange?: (value: string) => void;\n /** Callback fired after value is copied to clipboard */\n onCopy?: () => void;\n /**\n * Size of the input.\n * - `\"xs\"` — Extra small for compact UIs\n * - `\"sm\"` — Small for secondary fields\n * - `\"base\"` — Default input size\n * - `\"lg\"` — Large for prominent fields\n * @default \"base\"\n */\n size?: KumoInputSize;\n /**\n * Style variant of the input.\n * - `\"default\"` — Default input appearance\n * - `\"error\"` — Error state for validation failures\n * @default \"default\"\n */\n variant?: KumoInputVariant;\n /** Label content for the input (enables Field wrapper and sets masked state label) - can be a string or any React node */\n label?: ReactNode;\n /** Tooltip content to display next to the label via an info icon */\n labelTooltip?: ReactNode;\n /** Helper text displayed below the input */\n description?: ReactNode;\n /** Error message or validation error object */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n}\n\n/**\n * Password/secret input that masks its value by default and reveals on click.\n * Includes a built-in copy-to-clipboard button on hover.\n *\n * @example\n * ```tsx\n * <SensitiveInput label=\"API Key\" defaultValue=\"sk_live_abc123xyz789\" />\n * ```\n */\nexport const SensitiveInput = forwardRef<HTMLInputElement, SensitiveInputProps>(\n (\n {\n value: controlledValue,\n defaultValue = \"\",\n onChange,\n onValueChange,\n onCopy,\n size = KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS.size,\n variant = KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS.variant,\n disabled = false,\n readOnly = false,\n id,\n autoComplete = \"off\",\n className,\n label,\n labelTooltip,\n description,\n error,\n required,\n ...inputProps\n },\n ref,\n ) => {\n // For aria-label, only use string labels (ReactNode labels can't be used for aria-label)\n const ariaLabelFallback =\n typeof label === \"string\" ? label : \"Sensitive value\";\n const isControlled = controlledValue !== undefined;\n const [internalValue, setInternalValue] = useState(defaultValue);\n const value = isControlled ? controlledValue : internalValue;\n const hasValue = value.length > 0;\n\n const [mode, setMode] = useState<Mode>(() =>\n hasValue ? \"masked\" : \"empty\",\n );\n\n const [copied, setCopied] = useState(false);\n\n const inputRef = useRef<HTMLInputElement | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const liveRegionId = useId();\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const maskedInstructionId = useId();\n\n const mergedRef = useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n },\n [ref],\n );\n\n // Reset copied state after 2 seconds\n useEffect(() => {\n if (copied) {\n const timeoutId = setTimeout(() => setCopied(false), 2000);\n return () => clearTimeout(timeoutId);\n }\n }, [copied]);\n\n const copyToClipboard = useCallback(\n async (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n try {\n if (\n typeof navigator !== \"undefined\" &&\n navigator.clipboard &&\n typeof navigator.clipboard.writeText === \"function\"\n ) {\n await navigator.clipboard.writeText(value);\n setCopied(true);\n onCopy?.();\n return;\n }\n } catch {\n // Fall through to manual fallback\n }\n\n if (typeof document !== \"undefined\") {\n const textarea = document.createElement(\"textarea\");\n textarea.value = value;\n textarea.setAttribute(\"readonly\", \"\");\n textarea.style.position = \"absolute\";\n textarea.style.left = \"-9999px\";\n document.body.appendChild(textarea);\n const selection = document.getSelection();\n const previousRange = selection?.rangeCount\n ? selection.getRangeAt(0)\n : null;\n textarea.select();\n try {\n document.execCommand(\"copy\");\n setCopied(true);\n onCopy?.();\n } catch (error) {\n console.warn(\"Clipboard copy failed\", error);\n } finally {\n document.body.removeChild(textarea);\n if (previousRange) {\n selection?.removeAllRanges();\n selection?.addRange(previousRange);\n }\n }\n }\n },\n [value, onCopy],\n );\n\n // Sync mode when value changes externally\n const prevHasValueRef = useRef(hasValue);\n if (prevHasValueRef.current !== hasValue) {\n prevHasValueRef.current = hasValue;\n if (!hasValue && mode === \"masked\") {\n setMode(\"empty\");\n }\n }\n\n const handleContainerClick = useCallback(\n (e: React.MouseEvent) => {\n if (disabled) return;\n // Ignore clicks that originated from outside (e.g., label click focusing input)\n // Label clicks trigger a click on the input, but the click coordinates are outside the container\n if (containerRef.current) {\n const rect = containerRef.current.getBoundingClientRect();\n const isClickInsideContainer =\n e.clientX >= rect.left &&\n e.clientX <= rect.right &&\n e.clientY >= rect.top &&\n e.clientY <= rect.bottom;\n if (!isClickInsideContainer) return;\n }\n if (mode === \"masked\" && hasValue) {\n setMode(\"revealed\");\n if (!readOnly) {\n setTimeout(() => inputRef.current?.focus(), 0);\n }\n }\n },\n [mode, hasValue, disabled, readOnly],\n );\n\n const handleToggleVisibility = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n if (mode === \"revealed\") {\n setMode(\"masked\");\n } else if (mode === \"empty\" && hasValue) {\n setMode(\"revealed\");\n }\n },\n [mode, hasValue],\n );\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n if (!isControlled) {\n setInternalValue(newValue);\n }\n onChange?.(e);\n onValueChange?.(newValue);\n },\n [isControlled, onChange, onValueChange],\n );\n\n const handleBlur = useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n // Don't mask if focus is moving to a button inside the container (copy/eye buttons)\n if (\n containerRef.current &&\n e.relatedTarget instanceof Node &&\n containerRef.current.contains(e.relatedTarget)\n ) {\n return;\n }\n if (hasValue) {\n setMode(\"masked\");\n }\n },\n [hasValue],\n );\n\n const handleContainerKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (disabled) return;\n if (mode === \"masked\" && hasValue) {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n setMode(\"revealed\");\n if (!readOnly) {\n setTimeout(() => inputRef.current?.focus(), 0);\n }\n }\n }\n },\n [mode, hasValue, disabled, readOnly],\n );\n\n const handleInputKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (mode === \"revealed\" && e.key === \"Escape\") {\n setMode(\"masked\");\n // Move focus to container to avoid focus trap (input becomes tabIndex={-1})\n setTimeout(() => containerRef.current?.focus(), 0);\n }\n },\n [mode],\n );\n\n const isMaskedWithValue = mode === \"masked\" && hasValue;\n const showEyeButton =\n !disabled && (mode === \"revealed\" || (mode === \"empty\" && hasValue));\n\n // Icon sizes matching input sizes\n const iconSize = size === \"xs\" || size === \"sm\" ? \"size-3\" : \"size-4\";\n\n const containerClassName = cn(\n inputVariants({ size, variant, parentFocusIndicator: true }),\n \"group/container relative flex w-full items-center\",\n isMaskedWithValue && !disabled && \"cursor-pointer\",\n disabled && \"cursor-not-allowed\",\n className,\n );\n\n const containerContent = (\n <>\n {/* Input - defines the width, always rendered */}\n <BaseInput\n ref={mergedRef}\n id={inputId}\n type={mode === \"revealed\" ? \"text\" : \"password\"}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleInputKeyDown}\n disabled={disabled}\n readOnly={readOnly || isMaskedWithValue}\n autoComplete={autoComplete}\n tabIndex={isMaskedWithValue ? -1 : 0}\n className={cn(\n \"w-full border-0 bg-transparent p-0 text-kumo-default ring-0 outline-none placeholder:text-kumo-subtle disabled:cursor-not-allowed disabled:text-kumo-subtle\",\n size === \"xs\" && \"pr-5\",\n size === \"sm\" && \"pr-6\",\n size === \"base\" && \"pr-8\",\n size === \"lg\" && \"pr-10\",\n isMaskedWithValue && \"pointer-events-none text-transparent\",\n )}\n aria-hidden={isMaskedWithValue}\n {...inputProps}\n />\n\n {/* Mask overlay - absolutely positioned, doesn't affect layout */}\n <span\n className={cn(\n \"pointer-events-none absolute inset-y-0 left-0 flex items-center overflow-hidden select-none\",\n // Match input pr padding (space for icon)\n size === \"xs\" && \"right-5\",\n size === \"sm\" && \"right-6\",\n size === \"base\" && \"right-8\",\n size === \"lg\" && \"right-10\",\n // Match the padding from inputVariants\n size === \"xs\" && \"px-1.5\",\n size === \"sm\" && \"px-2\",\n size === \"base\" && \"px-3\",\n size === \"lg\" && \"px-4\",\n // Hidden when not masked\n !isMaskedWithValue && \"invisible\",\n // When masked: enable pointer events\n isMaskedWithValue && \"pointer-events-auto\",\n // Text color - use text-kumo-default to contrast with bg-kumo-control input background\n \"text-kumo-default\",\n // Hover state - pure CSS, no React state (group for children)\n \"group/mask\",\n )}\n aria-hidden=\"true\"\n >\n {/* Both texts rendered, stacked. Visibility toggled on hover to prevent layout shift */}\n <span className=\"relative\">\n <span\n className={cn(\n isMaskedWithValue &&\n !disabled &&\n \"group-focus-within/container:invisible group-hover/mask:invisible\",\n )}\n >\n ••••••••\n </span>\n {isMaskedWithValue && !disabled && (\n <span className=\"invisible absolute left-0 top-0 whitespace-nowrap text-kumo-subtle group-focus-within/container:visible group-hover/mask:visible\">\n Click to reveal\n </span>\n )}\n </span>\n </span>\n\n {/* Eye button - absolutely positioned to the right */}\n <button\n type=\"button\"\n onClick={handleToggleVisibility}\n onKeyDown={(e) => e.stopPropagation()}\n aria-label={mode === \"revealed\" ? \"Hide value\" : \"Reveal value\"}\n tabIndex={showEyeButton ? 0 : -1}\n className={cn(\n \"absolute top-1/2 right-0 -translate-y-1/2 cursor-pointer text-kumo-subtle outline-none hover:text-kumo-default focus:text-kumo-default\",\n // Match right padding from inputVariants\n size === \"xs\" && \"right-1.5\",\n size === \"sm\" && \"right-2\",\n size === \"base\" && \"right-3\",\n size === \"lg\" && \"right-4\",\n iconSize,\n !showEyeButton && \"pointer-events-none opacity-0\",\n )}\n >\n {mode === \"revealed\" ? (\n <EyeSlash className=\"size-full\" />\n ) : (\n <Eye className=\"size-full\" />\n )}\n </button>\n\n {/* Copy tab - appears on hover/focus at top right (hidden when disabled) */}\n {hasValue && !disabled && (\n <button\n type=\"button\"\n onClick={copyToClipboard}\n onKeyDown={(e) => e.stopPropagation()}\n aria-label={copied ? \"Copied\" : \"Copy to clipboard\"}\n className={cn(\n \"absolute -top-px right-2 -translate-y-full cursor-pointer rounded-t-md bg-kumo-brand px-2 py-0.5 text-xs text-white opacity-0 transition-opacity group-focus-within/container:opacity-100 group-hover/container:opacity-100 hover:brightness-120 focus-visible:outline focus-visible:outline-offset-1 focus-visible:outline-kumo-ring\",\n )}\n >\n {copied ? \"Copied\" : \"Copy\"}\n </button>\n )}\n </>\n );\n\n const input = (\n <div>\n {isMaskedWithValue ? (\n <div\n ref={containerRef}\n // Cannot use <button> here because containerContent contains interactive button elements (Copy, Reveal).\n // Using role=\"button\" with proper keyboard handling instead.\n // oxlint-disable-next-line prefer-tag-over-role\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n className={containerClassName}\n onClick={handleContainerClick}\n onKeyDown={handleContainerKeyDown}\n aria-label={`${ariaLabelFallback}, masked.`}\n aria-describedby={`${maskedInstructionId} ${liveRegionId}`}\n aria-disabled={disabled}\n >\n {containerContent}\n </div>\n ) : (\n <div ref={containerRef} className={containerClassName}>\n {containerContent}\n </div>\n )}\n {isMaskedWithValue && (\n <span id={maskedInstructionId} className=\"sr-only\">\n Click or press Enter to reveal.\n </span>\n )}\n <span id={liveRegionId} className=\"sr-only\" aria-live=\"polite\">\n {mode === \"masked\" && hasValue && \"Value hidden\"}\n {copied && \"Copied to clipboard\"}\n </span>\n </div>\n );\n\n // Render with Field wrapper if label is provided\n if (label) {\n return (\n <Field\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n description={description}\n error={\n error\n ? typeof error === \"string\"\n ? { message: error, match: true }\n : error\n : undefined\n }\n >\n {input}\n </Field>\n );\n }\n\n // Render bare input without Field wrapper\n return input;\n },\n);\n\nSensitiveInput.displayName = \"SensitiveInput\";\n"],"names":["KUMO_SENSITIVE_INPUT_VARIANTS","KUMO_INPUT_VARIANTS","KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS","SensitiveInput","forwardRef","controlledValue","defaultValue","onChange","onValueChange","onCopy","size","variant","disabled","readOnly","id","autoComplete","className","label","labelTooltip","description","error","required","inputProps","ref","ariaLabelFallback","isControlled","internalValue","setInternalValue","useState","value","hasValue","mode","setMode","copied","setCopied","inputRef","useRef","containerRef","liveRegionId","useId","generatedId","inputId","maskedInstructionId","mergedRef","useCallback","node","useEffect","timeoutId","copyToClipboard","textarea","selection","previousRange","prevHasValueRef","handleContainerClick","rect","handleToggleVisibility","handleChange","newValue","handleBlur","handleContainerKeyDown","handleInputKeyDown","isMaskedWithValue","showEyeButton","iconSize","containerClassName","cn","inputVariants","containerContent","jsxs","Fragment","jsx","BaseInput","EyeSlash","Eye","input","Field"],"mappings":";;;;;;;;AAqBO,MAAMA,KAAgCC,IAEhCC,IAAwC;AAAA,EACnD,MAAM;AAAA,EACN,SAAS;AACX,GA6DaC,KAAiBC;AAAA,EAC5B,CACE;AAAA,IACE,OAAOC;AAAA,IACP,cAAAC,IAAe;AAAA,IACf,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC,IAAOR,EAAsC;AAAA,IAC7C,SAAAS,IAAUT,EAAsC;AAAA,IAChD,UAAAU,IAAW;AAAA,IACX,UAAAC,IAA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AAA;AAAA,UACC,KAAKjC;AAAA,UAIL,MAAK;AAAA,UACL,UAAUzB,IAAW,KAAK;AAAA,UAC1B,WAAWoD;AAAA,UACX,SAASX;AAAA,UACT,WAAWM;AAAA,UACX,cAAY,GAAGnC,CAAiB;AAAA,UAChC,oBAAkB,GAAGkB,CAAmB,IAAIJ,CAAY;AAAA,UACxD,iBAAe1B;AAAA,UAEd,UAAAuD;AAAA,QAAA;AAAA,MAAA,IAGH,gBAAAG,EAAC,OAAA,EAAI,KAAKjC,GAAc,WAAW2B,GAChC,UAAAG,GACH;AAAA,MAEDN,KACC,gBAAAS,EAAC,QAAA,EAAK,IAAI5B,GAAqB,WAAU,WAAU,UAAA,mCAEnD;AAAA,wBAED,QAAA,EAAK,IAAIJ,GAAc,WAAU,WAAU,aAAU,UACnD,UAAA;AAAA,QAAAP,MAAS,YAAYD,KAAY;AAAA,QACjCG,KAAU;AAAA,MAAA,EAAA,CACb;AAAA,IAAA,GACF;AAIF,WAAIhB,IAEA,gBAAAqD;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,OAAA1D;AAAA,QACA,UAAAI;AAAA,QACA,cAAAH;AAAA,QACA,aAAAC;AAAA,QACA,OACEC,IACI,OAAOA,KAAU,WACf,EAAE,SAASA,GAAO,OAAO,GAAA,IACzBA,IACF;AAAA,QAGL,UAAAsD;AAAA,MAAA;AAAA,IAAA,IAMAA;AAAA,EACT;AACF;AAEAvE,GAAe,cAAc;"}
|
|
@@ -117,14 +117,17 @@ export declare function buttonVariants({ variant, size, shape, }?: KumoButtonVar
|
|
|
117
117
|
/**
|
|
118
118
|
* Button component props.
|
|
119
119
|
*
|
|
120
|
+
* Uses a discriminated union on `shape` so that icon-only buttons
|
|
121
|
+
* (`shape="square"` or `shape="circle"`) require an `aria-label`.
|
|
122
|
+
*
|
|
120
123
|
* @example
|
|
121
124
|
* ```tsx
|
|
122
125
|
* <Button variant="primary">Save</Button>
|
|
123
|
-
* <Button variant="secondary" shape="square" icon={PlusIcon} />
|
|
126
|
+
* <Button variant="secondary" shape="square" icon={PlusIcon} aria-label="Add" />
|
|
124
127
|
* <Button variant="destructive" loading>Deleting...</Button>
|
|
125
128
|
* ```
|
|
126
129
|
*/
|
|
127
|
-
|
|
130
|
+
type ButtonBaseProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
128
131
|
/** Content rendered inside the button. */
|
|
129
132
|
children?: React.ReactNode;
|
|
130
133
|
/** Additional CSS classes merged via `cn()`. */
|
|
@@ -134,6 +137,19 @@ export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & KumoBu
|
|
|
134
137
|
/** Shows a loading spinner and disables interaction. */
|
|
135
138
|
loading?: boolean;
|
|
136
139
|
};
|
|
140
|
+
type ButtonWithTextProps = ButtonBaseProps & {
|
|
141
|
+
shape?: "base";
|
|
142
|
+
size?: KumoButtonSize;
|
|
143
|
+
variant?: KumoButtonVariant;
|
|
144
|
+
};
|
|
145
|
+
type IconOnlyButtonProps = ButtonBaseProps & {
|
|
146
|
+
shape: "square" | "circle";
|
|
147
|
+
size?: KumoButtonSize;
|
|
148
|
+
variant?: KumoButtonVariant;
|
|
149
|
+
/** Required for icon-only buttons to provide accessible label for screen readers */
|
|
150
|
+
"aria-label": string;
|
|
151
|
+
};
|
|
152
|
+
export type ButtonProps = ButtonWithTextProps | IconOnlyButtonProps;
|
|
137
153
|
/**
|
|
138
154
|
* LinkButton component props — renders an anchor styled as a button.
|
|
139
155
|
*
|
|
@@ -163,16 +179,7 @@ export type LinkButtonProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & Ku
|
|
|
163
179
|
* <Button variant="secondary" icon={PlusIcon}>Create Worker</Button>
|
|
164
180
|
* ```
|
|
165
181
|
*/
|
|
166
|
-
export declare const Button: React.ForwardRefExoticComponent<React.
|
|
167
|
-
/** Content rendered inside the button. */
|
|
168
|
-
children?: React.ReactNode;
|
|
169
|
-
/** Additional CSS classes merged via `cn()`. */
|
|
170
|
-
className?: string;
|
|
171
|
-
/** Icon from `@phosphor-icons/react` or a React element. Rendered before children. */
|
|
172
|
-
icon?: Icon | React.ReactNode;
|
|
173
|
-
/** Shows a loading spinner and disables interaction. */
|
|
174
|
-
loading?: boolean;
|
|
175
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
|
182
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
176
183
|
/**
|
|
177
184
|
* Square button with a rotating arrows icon, used to trigger data refresh actions.
|
|
178
185
|
*
|
|
@@ -201,4 +208,5 @@ export declare const LinkButton: React.ForwardRefExoticComponent<React.AnchorHTM
|
|
|
201
208
|
external?: boolean;
|
|
202
209
|
linksExternal?: boolean;
|
|
203
210
|
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
211
|
+
export {};
|
|
204
212
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAmB,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAKnE,mGAAmG;AACnG,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqEvB,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;;CAI/B,CAAC;AAGX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,oBAAoB,CAAC,KAAK,CAAC;AACtE,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,oBAAoB,CAAC,IAAI,CAAC;AACpE,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,oBAAoB,CAAC,OAAO,CAAC;AAE1E,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;;;;;OAOG;IACH,IA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CAAC,SAAS;IAC1B,gDAAgD;gBACpC,MAAM;IAClB,sFAAsF;WAC/E,IAAI,GAAG,KAAK,CAAC,SAAS;IAC7B,wEAAwE;eAC7D,OAAO;oBACF,OAAO;2CA4H1B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { Dialog as DialogBase } from '@base-ui/react/dialog';
|
|
3
3
|
/** Dialog size variant definitions mapping sizes to their minimum widths. */
|
|
4
4
|
export declare const KUMO_DIALOG_VARIANTS: {
|
|
@@ -131,18 +131,59 @@ export type DialogProps = KumoDialogVariantsProps & {
|
|
|
131
131
|
/** Inline styles. */
|
|
132
132
|
style?: CSSProperties;
|
|
133
133
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Modal dialog overlay with backdrop. Compound component with `Dialog.Root`,
|
|
136
|
+
* `Dialog.Trigger`, `Dialog.Title`, `Dialog.Description`, and `Dialog.Close`.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```tsx
|
|
140
|
+
* <Dialog.Root>
|
|
141
|
+
* <Dialog.Trigger render={(p) => <Button {...p}>Delete</Button>} />
|
|
142
|
+
* <Dialog className="p-8">
|
|
143
|
+
* <Dialog.Title>Delete Item</Dialog.Title>
|
|
144
|
+
* <Dialog.Description>This action cannot be undone.</Dialog.Description>
|
|
145
|
+
* <Dialog.Close render={(p) => <Button variant="destructive" {...p}>Delete</Button>} />
|
|
146
|
+
* </Dialog>
|
|
147
|
+
* </Dialog.Root>
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
declare function DialogContent({ className, children, style, size, }: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
151
|
+
type BaseDialogRootProps = ComponentPropsWithoutRef<typeof DialogBase.Root>;
|
|
152
|
+
export type DialogRootProps = BaseDialogRootProps;
|
|
153
|
+
declare function DialogRoot({ children, ...props }: DialogRootProps): import("react/jsx-runtime").JSX.Element;
|
|
154
|
+
declare namespace DialogRoot {
|
|
155
|
+
var displayName: string;
|
|
156
|
+
}
|
|
157
|
+
type BaseDialogTriggerProps = ComponentPropsWithoutRef<typeof DialogBase.Trigger>;
|
|
158
|
+
export type DialogTriggerProps = BaseDialogTriggerProps;
|
|
159
|
+
declare function DialogTrigger({ children, ...props }: DialogTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
160
|
+
declare namespace DialogTrigger {
|
|
161
|
+
var displayName: string;
|
|
162
|
+
}
|
|
163
|
+
type BaseDialogTitleProps = ComponentPropsWithoutRef<typeof DialogBase.Title>;
|
|
164
|
+
export type DialogTitleProps = BaseDialogTitleProps;
|
|
165
|
+
declare function DialogTitle({ className, ...props }: DialogTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
166
|
+
declare namespace DialogTitle {
|
|
167
|
+
var displayName: string;
|
|
168
|
+
}
|
|
169
|
+
type BaseDialogDescriptionProps = ComponentPropsWithoutRef<typeof DialogBase.Description>;
|
|
170
|
+
export type DialogDescriptionProps = BaseDialogDescriptionProps;
|
|
171
|
+
declare function DialogDescription({ className, ...props }: DialogDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
172
|
+
declare namespace DialogDescription {
|
|
173
|
+
var displayName: string;
|
|
174
|
+
}
|
|
175
|
+
type BaseDialogCloseProps = ComponentPropsWithoutRef<typeof DialogBase.Close>;
|
|
176
|
+
export type DialogCloseProps = BaseDialogCloseProps;
|
|
177
|
+
declare function DialogClose({ children, ...props }: DialogCloseProps): import("react/jsx-runtime").JSX.Element;
|
|
178
|
+
declare namespace DialogClose {
|
|
179
|
+
var displayName: string;
|
|
180
|
+
}
|
|
181
|
+
declare const Dialog: typeof DialogContent & {
|
|
182
|
+
Root: typeof DialogRoot;
|
|
183
|
+
Trigger: typeof DialogTrigger;
|
|
184
|
+
Title: typeof DialogTitle;
|
|
185
|
+
Description: typeof DialogDescription;
|
|
186
|
+
Close: typeof DialogClose;
|
|
140
187
|
};
|
|
141
|
-
declare const Dialog: DialogComponent;
|
|
142
|
-
declare const DialogRoot: typeof DialogBase.Root;
|
|
143
|
-
declare const DialogTrigger: DialogBase.Trigger;
|
|
144
|
-
declare const DialogTitle: import('react').ForwardRefExoticComponent<import('@base-ui/react/dialog').DialogTitleProps & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
145
|
-
declare const DialogDescription: import('react').ForwardRefExoticComponent<import('@base-ui/react/dialog').DialogDescriptionProps & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
146
|
-
declare const DialogClose: import('react').ForwardRefExoticComponent<import('@base-ui/react/dialog').DialogCloseProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
147
188
|
export { Dialog, DialogRoot, DialogTrigger, DialogTitle, DialogDescription, DialogClose, };
|
|
148
189
|
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAI7D,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;CAmBvB,CAAC;AAEX,eAAO,MAAM,4BAA4B;;CAE/B,CAAC;AAEX,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDtB,CAAC;AAGX,MAAM,MAAM,cAAc,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;;AAUpB,KAAK,0BAA0B,GAAG,wBAAwB,CACxD,OAAO,UAAU,CAAC,WAAW,CAC9B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,0BAA0B,CAAC;AAEhE,iBAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,2CAEzE;kBAFQ,iBAAiB;;;AAU1B,KAAK,oBAAoB,GAAG,wBAAwB,CAAC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;AAE9E,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAEpD,iBAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAE5D;kBAFQ,WAAW;;;AAUpB,QAAA,MAAM,MAAM;;;;;;CAMV,CAAC;AAEH,OAAO,EACL,MAAM,EACN,UAAU,EACV,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,WAAW,GACZ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Dialog, DialogRoot, DialogTrigger, DialogTitle, DialogDescription, DialogClose, } from './dialog';
|
|
1
|
+
export { Dialog, DialogRoot, DialogTrigger, DialogTitle, DialogDescription, DialogClose, type DialogProps, type DialogRootProps, type DialogTriggerProps, type DialogTitleProps, type DialogDescriptionProps, type DialogCloseProps, } from './dialog';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Input, inputVariants, type InputProps } from './input';
|
|
2
|
-
export { InputArea, type InputAreaProps } from './input-area';
|
|
2
|
+
export { InputArea, Textarea, type InputAreaProps } from './input-area';
|
|
3
3
|
export { InputGroup } from './input-group';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -19,6 +19,25 @@ export declare const InputArea: React.ForwardRefExoticComponent<{
|
|
|
19
19
|
match: FieldErrorMatch;
|
|
20
20
|
};
|
|
21
21
|
} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
22
|
+
/** Alias for InputArea — provided for discoverability when migrating from other libraries */
|
|
23
|
+
export declare const Textarea: React.ForwardRefExoticComponent<{
|
|
24
|
+
onValueChange?: (value: string) => void;
|
|
25
|
+
variant?: "default" | "error";
|
|
26
|
+
size?: "xs" | "sm" | "base" | "lg";
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Label content for the textarea (enables Field wrapper) - can be a string or any React node */
|
|
30
|
+
label?: ReactNode;
|
|
31
|
+
/** Tooltip content to display next to the label via an info icon */
|
|
32
|
+
labelTooltip?: ReactNode;
|
|
33
|
+
/** Helper text displayed below the textarea */
|
|
34
|
+
description?: ReactNode;
|
|
35
|
+
/** Error message or validation error object */
|
|
36
|
+
error?: string | {
|
|
37
|
+
message: ReactNode;
|
|
38
|
+
match: FieldErrorMatch;
|
|
39
|
+
};
|
|
40
|
+
} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
22
41
|
/**
|
|
23
42
|
* InputArea component props
|
|
24
43
|
* @property {ReactNode} [label] - Label content for the textarea (enables Field wrapper)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-area.d.ts","sourceRoot":"","sources":["../../../../src/components/input/input-area.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE1E,eAAO,MAAM,SAAS;
|
|
1
|
+
{"version":3,"file":"input-area.d.ts","sourceRoot":"","sources":["../../../../src/components/input/input-area.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE1E,eAAO,MAAM,SAAS;oBA4EJ,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;cAC7B,SAAS,GAAG,OAAO;WACtB,IAAI,GAAG,IAAI,GAAG,MAA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AAC;CAGjE,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -25,9 +25,11 @@ export interface LabelProps extends KumoLabelVariantsProps {
|
|
|
25
25
|
tooltip?: ReactNode;
|
|
26
26
|
/** Additional CSS classes merged via `cn()`. */
|
|
27
27
|
className?: string;
|
|
28
|
+
/** The id of the form element this label is associated with */
|
|
29
|
+
htmlFor?: string;
|
|
28
30
|
/**
|
|
29
|
-
* When
|
|
30
|
-
* the outer
|
|
31
|
+
* When true, only renders the inline content (indicators, tooltip) without
|
|
32
|
+
* the outer label element with font styling. Useful when composed inside another
|
|
31
33
|
* label element that already provides the text styling.
|
|
32
34
|
* @default false
|
|
33
35
|
*/
|
|
@@ -58,7 +60,7 @@ export interface LabelProps extends KumoLabelVariantsProps {
|
|
|
58
60
|
* <span>Custom label with <strong>bold</strong> text</span>
|
|
59
61
|
* </Label>
|
|
60
62
|
*/
|
|
61
|
-
export declare function Label({ children, showOptional, tooltip, className, asContent, }: LabelProps): import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
export declare function Label({ children, showOptional, tooltip, className, htmlFor, asContent, }: LabelProps): import("react/jsx-runtime").JSX.Element;
|
|
62
64
|
export declare namespace Label {
|
|
63
65
|
var displayName: string;
|
|
64
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../../src/components/label/label.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,IAEtB,CAAC;AAEX,eAAO,MAAM,2BAA2B,IAAc,CAAC;AAGvD,MAAM,WAAW,sBAAsB;CAAG;AAE1C,wBAAgB,aAAa,CAAC,MAAM,GAAE,sBAA2B,UAMhE;AAED,wBAAgB,oBAAoB,WAKnC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAW,SAAQ,sBAAsB;IACxD,6DAA6D;IAC7D,QAAQ,EAAE,SAAS,CAAC;IACpB,iEAAiE;IACjE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oEAAoE;IACpE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,YAAoB,EACpB,OAAO,EACP,SAAS,EACT,SAAiB,GAClB,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../../src/components/label/label.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,IAEtB,CAAC;AAEX,eAAO,MAAM,2BAA2B,IAAc,CAAC;AAGvD,MAAM,WAAW,sBAAsB;CAAG;AAE1C,wBAAgB,aAAa,CAAC,MAAM,GAAE,sBAA2B,UAMhE;AAED,wBAAgB,oBAAoB,WAKnC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAW,SAAQ,sBAAsB;IACxD,6DAA6D;IAC7D,QAAQ,EAAE,SAAS,CAAC;IACpB,iEAAiE;IACjE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oEAAoE;IACpE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,YAAoB,EACpB,OAAO,EACP,SAAS,EACT,OAAO,EACP,SAAiB,GAClB,EAAE,UAAU,2CAkCZ;yBAzCe,KAAK"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Toasty } from './toast';
|
|
1
|
+
export { Toasty, ToastProvider } from './toast';
|
|
2
2
|
export { Toast } from '@base-ui/react/toast';
|
|
3
3
|
export { useKumoToastManager, createKumoToastManager } from './toast';
|
|
4
4
|
export type { KumoToastOptions, KumoToastManagerAddOptions } from './toast';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACtE,YAAY,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -146,5 +146,7 @@ export declare const createKumoToastManager: () => import('@base-ui/react/toast'
|
|
|
146
146
|
* ```
|
|
147
147
|
*/
|
|
148
148
|
export declare function Toasty({ children }: ToastyProps): import("react/jsx-runtime").JSX.Element;
|
|
149
|
+
/** Alias for Toasty — provided for discoverability when migrating from other libraries */
|
|
150
|
+
export declare const ToastProvider: typeof Toasty;
|
|
149
151
|
export {};
|
|
150
152
|
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EACtB,WAAW,EACZ,MA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a,eAAS,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -35,12 +35,12 @@ export { Checkbox, type CheckboxProps } from './components/checkbox';
|
|
|
35
35
|
export { ClipboardText } from './components/clipboard-text';
|
|
36
36
|
export { Code, CodeBlock } from './components/code';
|
|
37
37
|
export { Combobox } from './components/combobox';
|
|
38
|
-
export { Dialog, DialogRoot, DialogTrigger, DialogTitle, DialogDescription, DialogClose, } from './components/dialog';
|
|
38
|
+
export { Dialog, DialogRoot, DialogTrigger, DialogTitle, DialogDescription, DialogClose, type DialogProps, type DialogRootProps, type DialogTriggerProps, type DialogTitleProps, type DialogDescriptionProps, type DialogCloseProps, } from './components/dialog';
|
|
39
39
|
export { DropdownMenu } from './components/dropdown';
|
|
40
40
|
export { Collapsible } from './components/collapsible';
|
|
41
41
|
export { Field, type FieldProps, type FieldErrorMatch, fieldVariants, KUMO_FIELD_VARIANTS, KUMO_FIELD_DEFAULT_VARIANTS, } from './components/field';
|
|
42
42
|
export { Label, type LabelProps, labelVariants, labelContentVariants, KUMO_LABEL_VARIANTS, KUMO_LABEL_DEFAULT_VARIANTS, } from './components/label';
|
|
43
|
-
export { Input, inputVariants, type InputProps, InputArea, type InputAreaProps, InputGroup, } from './components/input';
|
|
43
|
+
export { Input, inputVariants, type InputProps, InputArea, Textarea, type InputAreaProps, InputGroup, } from './components/input';
|
|
44
44
|
export { LayerCard } from './components/layer-card';
|
|
45
45
|
export { DeleteResource, KUMO_DELETE_RESOURCE_VARIANTS, KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS, type DeleteResourceProps, } from './blocks/delete-resource';
|
|
46
46
|
export { Loader, SkeletonLine } from './components/loader';
|
|
@@ -53,7 +53,7 @@ export { Switch } from './components/switch';
|
|
|
53
53
|
export { Tabs, type TabsProps, type TabsItem } from './components/tabs';
|
|
54
54
|
export { Table } from './components/table';
|
|
55
55
|
export { Text } from './components/text';
|
|
56
|
-
export { Toasty, Toast, useKumoToastManager } from './components/toast';
|
|
56
|
+
export { Toasty, ToastProvider, Toast, useKumoToastManager, } from './components/toast';
|
|
57
57
|
export { Tooltip, TooltipProvider } from './components/tooltip';
|
|
58
58
|
export { Popover, KUMO_POPOVER_VARIANTS, KUMO_POPOVER_DEFAULT_VARIANTS, type PopoverRootProps, type PopoverTriggerProps, type PopoverContentProps, type PopoverTitleProps, type PopoverDescriptionProps, type PopoverCloseProps, } from './components/popover';
|
|
59
59
|
export { SensitiveInput, type SensitiveInputProps, KUMO_SENSITIVE_INPUT_VARIANTS, KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS, } from './components/sensitive-input';
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACL,MAAM,EACN,aAAa,EACb,UAAU,EACV,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,MAAM,EACN,UAAU,EACV,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":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