@mastra/playground-ui 53.0.0-alpha.4 → 53.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{combobox-BNAe7hQL.cjs → combobox-BQrlN0eB.cjs} +12 -4
- package/dist/combobox-BQrlN0eB.cjs.map +1 -0
- package/dist/{combobox-BWMi9Vvm.js → combobox-DeeAlYti.js} +12 -4
- package/dist/combobox-DeeAlYti.js.map +1 -0
- package/dist/components/Combobox.cjs.js +1 -1
- package/dist/components/Combobox.es.js +1 -1
- package/dist/components/PropertyFilter.cjs.js +1 -1
- package/dist/components/PropertyFilter.es.js +1 -1
- package/dist/components/Section.cjs.js +1 -1
- package/dist/components/Section.es.js +1 -1
- package/dist/components/SettingsLayout.cjs.js +52 -0
- package/dist/components/SettingsLayout.cjs.js.map +1 -0
- package/dist/components/SettingsLayout.d.ts +2 -0
- package/dist/components/SettingsLayout.es.js +48 -0
- package/dist/components/SettingsLayout.es.js.map +1 -0
- package/dist/components/SideDialog.cjs.js +1 -1
- package/dist/components/SideDialog.es.js +1 -1
- package/dist/{section-CzPerGGn.cjs → section-5nzZUvtb.cjs} +5 -4
- package/dist/section-5nzZUvtb.cjs.map +1 -0
- package/dist/{section-BXEB4HRl.js → section-BOhQbu5e.js} +5 -4
- package/dist/section-BOhQbu5e.js.map +1 -0
- package/dist/src/ds/components/Combobox/combobox.d.ts +1 -0
- package/dist/src/ds/components/Section/section-header.d.ts +4 -2
- package/dist/src/ds/components/Section/section.stories.d.ts +29 -4
- package/dist/src/ds/components/SettingsLayout/index.d.ts +1 -0
- package/dist/src/ds/components/SettingsLayout/settings-layout.d.ts +8 -0
- package/dist/src/ds/components/SettingsLayout/settings-layout.stories.d.ts +41 -0
- package/dist/style.css +23 -4
- package/package.json +6 -6
- package/dist/combobox-BNAe7hQL.cjs.map +0 -1
- package/dist/combobox-BWMi9Vvm.js.map +0 -1
- package/dist/section-BXEB4HRl.js.map +0 -1
- package/dist/section-CzPerGGn.cjs.map +0 -1
|
@@ -154,9 +154,14 @@ function Combobox(props) {
|
|
|
154
154
|
open,
|
|
155
155
|
onOpenChange,
|
|
156
156
|
container,
|
|
157
|
-
error
|
|
157
|
+
error,
|
|
158
|
+
allowCustomValue = false
|
|
158
159
|
} = props;
|
|
159
160
|
const multiple = isMultipleCombobox(props);
|
|
161
|
+
const [inputValue, setInputValue] = React__namespace.useState("");
|
|
162
|
+
const customValue = inputValue.trim();
|
|
163
|
+
const customOption = !multiple && allowCustomValue && customValue && !options.some((option) => option.value === customValue) ? { label: `Use “${customValue}”`, value: customValue } : void 0;
|
|
164
|
+
const displayedOptions = customOption ? [customOption, ...options] : options;
|
|
160
165
|
const selectedValues = multiple ? props.value ?? EMPTY_VALUES : EMPTY_VALUES;
|
|
161
166
|
const selectedValueSet = React__namespace.useMemo(() => new Set(selectedValues), [selectedValues]);
|
|
162
167
|
const selectedOption = multiple ? null : options.find((option) => option.value === props.value) ?? null;
|
|
@@ -216,7 +221,7 @@ function Combobox(props) {
|
|
|
216
221
|
{
|
|
217
222
|
multiple: true,
|
|
218
223
|
autoHighlight: true,
|
|
219
|
-
items:
|
|
224
|
+
items: displayedOptions,
|
|
220
225
|
value: selectedOptions,
|
|
221
226
|
onValueChange: (items) => props.onValueChange?.((items ?? []).map((item) => item.value)),
|
|
222
227
|
disabled,
|
|
@@ -233,11 +238,14 @@ function Combobox(props) {
|
|
|
233
238
|
combobox.Combobox.Root,
|
|
234
239
|
{
|
|
235
240
|
autoHighlight: true,
|
|
236
|
-
items:
|
|
241
|
+
items: displayedOptions,
|
|
237
242
|
value: selectedOption,
|
|
243
|
+
inputValue,
|
|
244
|
+
onInputValueChange: setInputValue,
|
|
238
245
|
onValueChange: (item) => {
|
|
239
246
|
if (item) {
|
|
240
247
|
props.onValueChange?.(item.value);
|
|
248
|
+
setInputValue("");
|
|
241
249
|
}
|
|
242
250
|
},
|
|
243
251
|
disabled,
|
|
@@ -252,4 +260,4 @@ function Combobox(props) {
|
|
|
252
260
|
|
|
253
261
|
exports.Combobox = Combobox;
|
|
254
262
|
exports.comboboxStyles = comboboxStyles;
|
|
255
|
-
//# sourceMappingURL=combobox-
|
|
263
|
+
//# sourceMappingURL=combobox-BQrlN0eB.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-BQrlN0eB.cjs","sources":["../src/ds/components/Combobox/combobox-styles.ts","../src/ds/components/Combobox/combobox.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport { buttonVariants } from '../Button/Button';\nimport type { TextButtonSize } from '../Button/Button';\nimport { controlTriggerOpenState } from '@/ds/primitives/control-size';\nimport type { ControlTriggerVisualVariant } from '@/ds/primitives/control-size';\nimport { transitions } from '@/ds/primitives/transitions';\nimport { cn } from '@/lib/utils';\n\n/**\n * A combobox is a form field, so it reuses the same button looks as everywhere,\n * mirroring `SelectTrigger`: `default` (the Button's filled default surface —\n * the default here too), `outline` (bordered, transparent) and `ghost`\n * (borderless, for breadcrumbs/inline pickers). Only the high-emphasis `primary`\n * look is intentionally NOT offered (a field is not a call-to-action).\n */\nexport type ComboboxVisualVariant = ControlTriggerVisualVariant;\nexport type ComboboxLegacyVariant = 'link';\nexport type ComboboxVariant = ComboboxVisualVariant | ComboboxLegacyVariant;\n\nfunction normalizeComboboxVariant(variant: ComboboxVariant): ComboboxVisualVariant {\n return variant === 'link' ? 'ghost' : variant;\n}\n\n/**\n * Single source of truth for both the single- and multi-select combobox\n * triggers. A combobox = a button + a trailing chevron, so it reuses the Button\n * recipe (variant colors, size = height/text/padding/radius, unified border\n * focus, disabled) and layers only the combobox-specific extras — exactly like\n * `SelectTrigger`.\n */\nexport function comboboxTriggerClass({\n variant,\n size,\n error,\n className,\n}: {\n variant: ComboboxVariant;\n size: TextButtonSize;\n error?: boolean;\n className?: string;\n}): string {\n const visualVariant = normalizeComboboxVariant(variant);\n\n return cn(\n buttonVariants({ variant: visualVariant, size }),\n // Fill the field and push the value left / chevron right (Button's base\n // centers its content with `justify-center`).\n 'w-full min-w-32 justify-between',\n // Read as \"active\" while the popup is open, per variant (see map above).\n controlTriggerOpenState[visualVariant],\n 'data-[placeholder]:text-neutral3',\n error && 'border-error hover:border-error focus-visible:border-error',\n className,\n );\n}\n\nexport const comboboxItemClass = cva(\n cn(\n 'relative flex cursor-pointer items-center rounded-md select-none',\n 'min-h-8 py-1.5',\n 'text-ui-smd leading-ui-sm text-neutral4',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n 'data-highlighted:bg-surface4 data-highlighted:text-neutral6',\n 'data-selected:text-neutral6',\n ),\n {\n variants: {\n multiple: {\n false: 'gap-2 pr-2 pl-2.5',\n true: 'gap-2 pr-2 pl-2.5',\n },\n },\n defaultVariants: {\n multiple: false,\n },\n },\n);\n\nexport const comboboxStyles = {\n /** Root wrapper */\n root: 'flex flex-col gap-1.5',\n\n /** Chevron icon in trigger — inherits the variant's text color via currentColor. */\n chevron: 'ml-2 h-4 w-4 shrink-0 opacity-60',\n\n /** Placeholder text color */\n placeholder: 'text-neutral3',\n\n /** Popup container — concentric with rounded-xl + p-1 (8px items inside 12px container). */\n popup: cn(\n 'w-max max-w-(--available-width) min-w-(--anchor-width) rounded-xl border border-border1 bg-surface3 text-neutral4',\n 'shadow-dialog',\n 'origin-(--transform-origin)',\n 'transition-[transform,scale,opacity] duration-150 ease-out',\n 'data-starting-style:scale-95 data-starting-style:opacity-0',\n 'data-ending-style:scale-95 data-ending-style:opacity-0',\n ),\n\n /** Positioner */\n positioner: 'z-50 pointer-events-auto',\n\n /** Search input container — borderless top section, hairline divider below. */\n searchContainer: cn('flex items-center border-b border-border1 px-2.5 py-1.5', transitions.colors),\n\n /** Search icon */\n searchIcon: cn('mr-2 size-3.5 shrink-0 text-neutral3', transitions.colors),\n\n /** Search input */\n searchInput: cn(\n 'flex h-7 w-full rounded-md bg-transparent py-1 text-ui-smd leading-ui-sm text-neutral6',\n 'placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n ),\n\n /** Empty state */\n empty: 'not-empty:block hidden py-4 text-center text-ui-smd text-neutral3',\n\n /** Options list */\n list: 'max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1',\n\n /** Option item base — rounded-md sits concentrically inside rounded-xl + p-1. */\n item: comboboxItemClass({ multiple: false }),\n\n /** Multi-select item — same item rhythm with a right-aligned selected check. */\n itemMulti: comboboxItemClass({ multiple: true }),\n\n /** Right-aligned slot grouping end content + selection check. */\n itemRightSlot: 'ml-auto flex items-center gap-2 shrink-0',\n\n /** Check indicator container — inline, fixed 16x16, shown only when item is selected. */\n checkContainer: 'flex h-4 w-4 shrink-0 items-center justify-center text-neutral6',\n\n /** Check icon (single select) */\n checkIcon: 'h-3.5 w-3.5',\n\n /** Option label/description wrapper */\n optionText: 'flex flex-col gap-0.5 min-w-0',\n\n /** Option label */\n optionLabel: 'truncate',\n\n /** Option description */\n optionDescription: 'text-ui-sm text-neutral3 truncate',\n\n /** Option end slot — `ml-auto` makes it push right inside flex containers (used by multi-select). */\n optionEnd: 'ml-auto flex items-center shrink-0',\n\n /** Error message */\n error: 'text-ui-sm text-accent2',\n} as const;\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { Check, ChevronsUpDown, Search } from 'lucide-react';\nimport * as React from 'react';\nimport { comboboxItemClass, comboboxStyles, comboboxTriggerClass } from './combobox-styles';\nimport type { ComboboxVariant } from './combobox-styles';\nimport type { TextButtonSize } from '@/ds/components/Button/Button';\nimport { FLOATING_POSITION_METHOD } from '@/ds/primitives/floating';\nimport { usePortalContainer } from '@/ds/primitives/portal-container';\nimport { cn } from '@/lib/utils';\n\nexport type { ComboboxVariant } from './combobox-styles';\n\nexport type ComboboxOption = {\n label: string;\n value: string;\n description?: string;\n start?: React.ReactNode;\n end?: React.ReactNode;\n};\n\ntype ComboboxSharedProps = {\n options: ComboboxOption[];\n placeholder?: string;\n searchPlaceholder?: string;\n emptyText?: string;\n className?: string;\n disabled?: boolean;\n variant?: ComboboxVariant;\n size?: TextButtonSize;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n container?: HTMLElement | ShadowRoot | null | React.RefObject<HTMLElement | ShadowRoot | null>;\n error?: string;\n allowCustomValue?: boolean;\n};\n\nexport type ComboboxSingleProps = ComboboxSharedProps & {\n multiple?: false;\n value?: string;\n onValueChange?: (value: string) => void;\n};\n\nexport type ComboboxMultipleProps = ComboboxSharedProps & {\n multiple: true;\n value?: readonly string[];\n onValueChange?: (value: string[]) => void;\n};\n\nexport type ComboboxProps = ComboboxSingleProps | ComboboxMultipleProps;\n\nconst EMPTY_VALUES: string[] = [];\nconst EMPTY_OPTIONS: ComboboxOption[] = [];\n\nfunction isMultipleCombobox(props: ComboboxProps): props is ComboboxMultipleProps {\n return props.multiple === true;\n}\n\nfunction ComboboxOptionText({ option }: { option: ComboboxOption }) {\n return (\n <span className={comboboxStyles.optionText}>\n <span className={comboboxStyles.optionLabel}>{option.label}</span>\n {option.description && <span className={comboboxStyles.optionDescription}>{option.description}</span>}\n </span>\n );\n}\n\nexport function Combobox(props: ComboboxProps) {\n const {\n options,\n placeholder = isMultipleCombobox(props) ? 'Select options...' : 'Select option...',\n searchPlaceholder = 'Search...',\n emptyText = 'No option found.',\n className,\n disabled = false,\n variant = 'default',\n size = 'md',\n open,\n onOpenChange,\n container,\n error,\n allowCustomValue = false,\n } = props;\n const multiple = isMultipleCombobox(props);\n const [inputValue, setInputValue] = React.useState('');\n const customValue = inputValue.trim();\n const customOption =\n !multiple && allowCustomValue && customValue && !options.some(option => option.value === customValue)\n ? { label: `Use “${customValue}”`, value: customValue }\n : undefined;\n const displayedOptions = customOption ? [customOption, ...options] : options;\n const selectedValues = multiple ? (props.value ?? EMPTY_VALUES) : EMPTY_VALUES;\n const selectedValueSet = React.useMemo(() => new Set(selectedValues), [selectedValues]);\n const selectedOption = multiple ? null : (options.find(option => option.value === props.value) ?? null);\n const selectedOptions = multiple ? options.filter(option => selectedValueSet.has(option.value)) : EMPTY_OPTIONS;\n const triggerText = selectedOptions.length === 0 ? placeholder : `${selectedOptions.length} selected`;\n // Default to the nearest SideDialog/Drawer popup so the list stays\n // interactive inside a modal drawer; an explicit `container` still wins.\n const resolvedContainer = usePortalContainer(container);\n\n const comboboxContent = (\n <>\n <BaseCombobox.Trigger className={comboboxTriggerClass({ variant, size, error: Boolean(error), className })}>\n {multiple ? (\n <span className={cn('truncate', selectedOptions.length === 0 && comboboxStyles.placeholder)}>\n {triggerText}\n </span>\n ) : (\n // Keep truncation off the outer wrapper so start adornments are not clipped.\n <span className=\"flex min-w-0 flex-1 items-center gap-2\">\n {selectedOption?.start}\n <span className=\"truncate\">\n <BaseCombobox.Value placeholder={placeholder} />\n </span>\n </span>\n )}\n {/* Wrap the chevron in a `<span>` so the svg is one level deep and\n escapes Button's `[&>svg]` adornments — mirrors Select's chevron wrap. */}\n <span className=\"flex shrink-0 items-center\">\n <ChevronsUpDown className={comboboxStyles.chevron} />\n </span>\n </BaseCombobox.Trigger>\n\n <BaseCombobox.Portal container={resolvedContainer}>\n <BaseCombobox.Positioner\n align=\"start\"\n sideOffset={4}\n positionMethod={FLOATING_POSITION_METHOD}\n className={comboboxStyles.positioner}\n >\n <BaseCombobox.Popup className={comboboxStyles.popup}>\n <div className={comboboxStyles.searchContainer}>\n <Search className={comboboxStyles.searchIcon} />\n <BaseCombobox.Input className={comboboxStyles.searchInput} placeholder={searchPlaceholder} />\n </div>\n <BaseCombobox.Empty className={comboboxStyles.empty}>{emptyText}</BaseCombobox.Empty>\n <BaseCombobox.List className={comboboxStyles.list}>\n {(option: ComboboxOption) => {\n const isSelected = selectedValueSet.has(option.value);\n\n return (\n <BaseCombobox.Item key={option.value} value={option} className={comboboxItemClass({ multiple })}>\n {multiple ? (\n <>\n {option.start}\n <ComboboxOptionText option={option} />\n <span className={comboboxStyles.itemRightSlot}>\n {option.end ? <div className={comboboxStyles.optionEnd}>{option.end}</div> : null}\n <span className={comboboxStyles.checkContainer}>\n {isSelected ? <Check className={comboboxStyles.checkIcon} /> : null}\n </span>\n </span>\n </>\n ) : (\n <>\n {option.start}\n <ComboboxOptionText option={option} />\n <span className={comboboxStyles.itemRightSlot}>\n {option.end ? <div className={comboboxStyles.optionEnd}>{option.end}</div> : null}\n <span className={comboboxStyles.checkContainer}>\n <BaseCombobox.ItemIndicator>\n <Check className={comboboxStyles.checkIcon} />\n </BaseCombobox.ItemIndicator>\n </span>\n </span>\n </>\n )}\n </BaseCombobox.Item>\n );\n }}\n </BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </>\n );\n\n if (multiple) {\n return (\n <div className={comboboxStyles.root}>\n <BaseCombobox.Root\n multiple\n autoHighlight\n items={displayedOptions}\n value={selectedOptions}\n onValueChange={items => props.onValueChange?.((items ?? []).map(item => item.value))}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n {comboboxContent}\n </BaseCombobox.Root>\n {error && <span className={comboboxStyles.error}>{error}</span>}\n </div>\n );\n }\n\n return (\n <div className={comboboxStyles.root}>\n <BaseCombobox.Root\n autoHighlight\n items={displayedOptions}\n value={selectedOption}\n inputValue={inputValue}\n onInputValueChange={setInputValue}\n onValueChange={item => {\n if (item) {\n props.onValueChange?.(item.value);\n setInputValue('');\n }\n }}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n {comboboxContent}\n </BaseCombobox.Root>\n {error && <span className={comboboxStyles.error}>{error}</span>}\n </div>\n );\n}\n"],"names":["cn","buttonVariants","controlTriggerOpenState","cva","transitions","jsxs","jsx","React","usePortalContainer","Fragment","BaseCombobox","ChevronsUpDown","FLOATING_POSITION_METHOD","Search","Check"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,SAAS,yBAAyB,OAAA,EAAiD;AACjF,EAAA,OAAO,OAAA,KAAY,SAAS,OAAA,GAAU,OAA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F,CAAA;AAAA,QACA,QAAA;AAAA,QACA,IAAA;AAAA,QACA,YAAA;AAAA,QAEC,QAAA,EAAA;AAAA;AAAA,KACH;AAAA,IACC,yBAASJ,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,cAAA,CAAe,OAAQ,QAAA,EAAA,KAAA,EAAM;AAAA,GAAA,EAC1D,CAAA;AAEJ;;;;;"}
|
|
@@ -133,9 +133,14 @@ function Combobox(props) {
|
|
|
133
133
|
open,
|
|
134
134
|
onOpenChange,
|
|
135
135
|
container,
|
|
136
|
-
error
|
|
136
|
+
error,
|
|
137
|
+
allowCustomValue = false
|
|
137
138
|
} = props;
|
|
138
139
|
const multiple = isMultipleCombobox(props);
|
|
140
|
+
const [inputValue, setInputValue] = React.useState("");
|
|
141
|
+
const customValue = inputValue.trim();
|
|
142
|
+
const customOption = !multiple && allowCustomValue && customValue && !options.some((option) => option.value === customValue) ? { label: `Use “${customValue}”`, value: customValue } : void 0;
|
|
143
|
+
const displayedOptions = customOption ? [customOption, ...options] : options;
|
|
139
144
|
const selectedValues = multiple ? props.value ?? EMPTY_VALUES : EMPTY_VALUES;
|
|
140
145
|
const selectedValueSet = React.useMemo(() => new Set(selectedValues), [selectedValues]);
|
|
141
146
|
const selectedOption = multiple ? null : options.find((option) => option.value === props.value) ?? null;
|
|
@@ -195,7 +200,7 @@ function Combobox(props) {
|
|
|
195
200
|
{
|
|
196
201
|
multiple: true,
|
|
197
202
|
autoHighlight: true,
|
|
198
|
-
items:
|
|
203
|
+
items: displayedOptions,
|
|
199
204
|
value: selectedOptions,
|
|
200
205
|
onValueChange: (items) => props.onValueChange?.((items ?? []).map((item) => item.value)),
|
|
201
206
|
disabled,
|
|
@@ -212,11 +217,14 @@ function Combobox(props) {
|
|
|
212
217
|
Combobox$1.Root,
|
|
213
218
|
{
|
|
214
219
|
autoHighlight: true,
|
|
215
|
-
items:
|
|
220
|
+
items: displayedOptions,
|
|
216
221
|
value: selectedOption,
|
|
222
|
+
inputValue,
|
|
223
|
+
onInputValueChange: setInputValue,
|
|
217
224
|
onValueChange: (item) => {
|
|
218
225
|
if (item) {
|
|
219
226
|
props.onValueChange?.(item.value);
|
|
227
|
+
setInputValue("");
|
|
220
228
|
}
|
|
221
229
|
},
|
|
222
230
|
disabled,
|
|
@@ -230,4 +238,4 @@ function Combobox(props) {
|
|
|
230
238
|
}
|
|
231
239
|
|
|
232
240
|
export { Combobox as C, comboboxStyles as c };
|
|
233
|
-
//# sourceMappingURL=combobox-
|
|
241
|
+
//# sourceMappingURL=combobox-DeeAlYti.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-DeeAlYti.js","sources":["../src/ds/components/Combobox/combobox-styles.ts","../src/ds/components/Combobox/combobox.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport { buttonVariants } from '../Button/Button';\nimport type { TextButtonSize } from '../Button/Button';\nimport { controlTriggerOpenState } from '@/ds/primitives/control-size';\nimport type { ControlTriggerVisualVariant } from '@/ds/primitives/control-size';\nimport { transitions } from '@/ds/primitives/transitions';\nimport { cn } from '@/lib/utils';\n\n/**\n * A combobox is a form field, so it reuses the same button looks as everywhere,\n * mirroring `SelectTrigger`: `default` (the Button's filled default surface —\n * the default here too), `outline` (bordered, transparent) and `ghost`\n * (borderless, for breadcrumbs/inline pickers). Only the high-emphasis `primary`\n * look is intentionally NOT offered (a field is not a call-to-action).\n */\nexport type ComboboxVisualVariant = ControlTriggerVisualVariant;\nexport type ComboboxLegacyVariant = 'link';\nexport type ComboboxVariant = ComboboxVisualVariant | ComboboxLegacyVariant;\n\nfunction normalizeComboboxVariant(variant: ComboboxVariant): ComboboxVisualVariant {\n return variant === 'link' ? 'ghost' : variant;\n}\n\n/**\n * Single source of truth for both the single- and multi-select combobox\n * triggers. A combobox = a button + a trailing chevron, so it reuses the Button\n * recipe (variant colors, size = height/text/padding/radius, unified border\n * focus, disabled) and layers only the combobox-specific extras — exactly like\n * `SelectTrigger`.\n */\nexport function comboboxTriggerClass({\n variant,\n size,\n error,\n className,\n}: {\n variant: ComboboxVariant;\n size: TextButtonSize;\n error?: boolean;\n className?: string;\n}): string {\n const visualVariant = normalizeComboboxVariant(variant);\n\n return cn(\n buttonVariants({ variant: visualVariant, size }),\n // Fill the field and push the value left / chevron right (Button's base\n // centers its content with `justify-center`).\n 'w-full min-w-32 justify-between',\n // Read as \"active\" while the popup is open, per variant (see map above).\n controlTriggerOpenState[visualVariant],\n 'data-[placeholder]:text-neutral3',\n error && 'border-error hover:border-error focus-visible:border-error',\n className,\n );\n}\n\nexport const comboboxItemClass = cva(\n cn(\n 'relative flex cursor-pointer items-center rounded-md select-none',\n 'min-h-8 py-1.5',\n 'text-ui-smd leading-ui-sm text-neutral4',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n 'data-highlighted:bg-surface4 data-highlighted:text-neutral6',\n 'data-selected:text-neutral6',\n ),\n {\n variants: {\n multiple: {\n false: 'gap-2 pr-2 pl-2.5',\n true: 'gap-2 pr-2 pl-2.5',\n },\n },\n defaultVariants: {\n multiple: false,\n },\n },\n);\n\nexport const comboboxStyles = {\n /** Root wrapper */\n root: 'flex flex-col gap-1.5',\n\n /** Chevron icon in trigger — inherits the variant's text color via currentColor. */\n chevron: 'ml-2 h-4 w-4 shrink-0 opacity-60',\n\n /** Placeholder text color */\n placeholder: 'text-neutral3',\n\n /** Popup container — concentric with rounded-xl + p-1 (8px items inside 12px container). */\n popup: cn(\n 'w-max max-w-(--available-width) min-w-(--anchor-width) rounded-xl border border-border1 bg-surface3 text-neutral4',\n 'shadow-dialog',\n 'origin-(--transform-origin)',\n 'transition-[transform,scale,opacity] duration-150 ease-out',\n 'data-starting-style:scale-95 data-starting-style:opacity-0',\n 'data-ending-style:scale-95 data-ending-style:opacity-0',\n ),\n\n /** Positioner */\n positioner: 'z-50 pointer-events-auto',\n\n /** Search input container — borderless top section, hairline divider below. */\n searchContainer: cn('flex items-center border-b border-border1 px-2.5 py-1.5', transitions.colors),\n\n /** Search icon */\n searchIcon: cn('mr-2 size-3.5 shrink-0 text-neutral3', transitions.colors),\n\n /** Search input */\n searchInput: cn(\n 'flex h-7 w-full rounded-md bg-transparent py-1 text-ui-smd leading-ui-sm text-neutral6',\n 'placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n ),\n\n /** Empty state */\n empty: 'not-empty:block hidden py-4 text-center text-ui-smd text-neutral3',\n\n /** Options list */\n list: 'max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1',\n\n /** Option item base — rounded-md sits concentrically inside rounded-xl + p-1. */\n item: comboboxItemClass({ multiple: false }),\n\n /** Multi-select item — same item rhythm with a right-aligned selected check. */\n itemMulti: comboboxItemClass({ multiple: true }),\n\n /** Right-aligned slot grouping end content + selection check. */\n itemRightSlot: 'ml-auto flex items-center gap-2 shrink-0',\n\n /** Check indicator container — inline, fixed 16x16, shown only when item is selected. */\n checkContainer: 'flex h-4 w-4 shrink-0 items-center justify-center text-neutral6',\n\n /** Check icon (single select) */\n checkIcon: 'h-3.5 w-3.5',\n\n /** Option label/description wrapper */\n optionText: 'flex flex-col gap-0.5 min-w-0',\n\n /** Option label */\n optionLabel: 'truncate',\n\n /** Option description */\n optionDescription: 'text-ui-sm text-neutral3 truncate',\n\n /** Option end slot — `ml-auto` makes it push right inside flex containers (used by multi-select). */\n optionEnd: 'ml-auto flex items-center shrink-0',\n\n /** Error message */\n error: 'text-ui-sm text-accent2',\n} as const;\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { Check, ChevronsUpDown, Search } from 'lucide-react';\nimport * as React from 'react';\nimport { comboboxItemClass, comboboxStyles, comboboxTriggerClass } from './combobox-styles';\nimport type { ComboboxVariant } from './combobox-styles';\nimport type { TextButtonSize } from '@/ds/components/Button/Button';\nimport { FLOATING_POSITION_METHOD } from '@/ds/primitives/floating';\nimport { usePortalContainer } from '@/ds/primitives/portal-container';\nimport { cn } from '@/lib/utils';\n\nexport type { ComboboxVariant } from './combobox-styles';\n\nexport type ComboboxOption = {\n label: string;\n value: string;\n description?: string;\n start?: React.ReactNode;\n end?: React.ReactNode;\n};\n\ntype ComboboxSharedProps = {\n options: ComboboxOption[];\n placeholder?: string;\n searchPlaceholder?: string;\n emptyText?: string;\n className?: string;\n disabled?: boolean;\n variant?: ComboboxVariant;\n size?: TextButtonSize;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n container?: HTMLElement | ShadowRoot | null | React.RefObject<HTMLElement | ShadowRoot | null>;\n error?: string;\n allowCustomValue?: boolean;\n};\n\nexport type ComboboxSingleProps = ComboboxSharedProps & {\n multiple?: false;\n value?: string;\n onValueChange?: (value: string) => void;\n};\n\nexport type ComboboxMultipleProps = ComboboxSharedProps & {\n multiple: true;\n value?: readonly string[];\n onValueChange?: (value: string[]) => void;\n};\n\nexport type ComboboxProps = ComboboxSingleProps | ComboboxMultipleProps;\n\nconst EMPTY_VALUES: string[] = [];\nconst EMPTY_OPTIONS: ComboboxOption[] = [];\n\nfunction isMultipleCombobox(props: ComboboxProps): props is ComboboxMultipleProps {\n return props.multiple === true;\n}\n\nfunction ComboboxOptionText({ option }: { option: ComboboxOption }) {\n return (\n <span className={comboboxStyles.optionText}>\n <span className={comboboxStyles.optionLabel}>{option.label}</span>\n {option.description && <span className={comboboxStyles.optionDescription}>{option.description}</span>}\n </span>\n );\n}\n\nexport function Combobox(props: ComboboxProps) {\n const {\n options,\n placeholder = isMultipleCombobox(props) ? 'Select options...' : 'Select option...',\n searchPlaceholder = 'Search...',\n emptyText = 'No option found.',\n className,\n disabled = false,\n variant = 'default',\n size = 'md',\n open,\n onOpenChange,\n container,\n error,\n allowCustomValue = false,\n } = props;\n const multiple = isMultipleCombobox(props);\n const [inputValue, setInputValue] = React.useState('');\n const customValue = inputValue.trim();\n const customOption =\n !multiple && allowCustomValue && customValue && !options.some(option => option.value === customValue)\n ? { label: `Use “${customValue}”`, value: customValue }\n : undefined;\n const displayedOptions = customOption ? [customOption, ...options] : options;\n const selectedValues = multiple ? (props.value ?? EMPTY_VALUES) : EMPTY_VALUES;\n const selectedValueSet = React.useMemo(() => new Set(selectedValues), [selectedValues]);\n const selectedOption = multiple ? null : (options.find(option => option.value === props.value) ?? null);\n const selectedOptions = multiple ? options.filter(option => selectedValueSet.has(option.value)) : EMPTY_OPTIONS;\n const triggerText = selectedOptions.length === 0 ? placeholder : `${selectedOptions.length} selected`;\n // Default to the nearest SideDialog/Drawer popup so the list stays\n // interactive inside a modal drawer; an explicit `container` still wins.\n const resolvedContainer = usePortalContainer(container);\n\n const comboboxContent = (\n <>\n <BaseCombobox.Trigger className={comboboxTriggerClass({ variant, size, error: Boolean(error), className })}>\n {multiple ? (\n <span className={cn('truncate', selectedOptions.length === 0 && comboboxStyles.placeholder)}>\n {triggerText}\n </span>\n ) : (\n // Keep truncation off the outer wrapper so start adornments are not clipped.\n <span className=\"flex min-w-0 flex-1 items-center gap-2\">\n {selectedOption?.start}\n <span className=\"truncate\">\n <BaseCombobox.Value placeholder={placeholder} />\n </span>\n </span>\n )}\n {/* Wrap the chevron in a `<span>` so the svg is one level deep and\n escapes Button's `[&>svg]` adornments — mirrors Select's chevron wrap. */}\n <span className=\"flex shrink-0 items-center\">\n <ChevronsUpDown className={comboboxStyles.chevron} />\n </span>\n </BaseCombobox.Trigger>\n\n <BaseCombobox.Portal container={resolvedContainer}>\n <BaseCombobox.Positioner\n align=\"start\"\n sideOffset={4}\n positionMethod={FLOATING_POSITION_METHOD}\n className={comboboxStyles.positioner}\n >\n <BaseCombobox.Popup className={comboboxStyles.popup}>\n <div className={comboboxStyles.searchContainer}>\n <Search className={comboboxStyles.searchIcon} />\n <BaseCombobox.Input className={comboboxStyles.searchInput} placeholder={searchPlaceholder} />\n </div>\n <BaseCombobox.Empty className={comboboxStyles.empty}>{emptyText}</BaseCombobox.Empty>\n <BaseCombobox.List className={comboboxStyles.list}>\n {(option: ComboboxOption) => {\n const isSelected = selectedValueSet.has(option.value);\n\n return (\n <BaseCombobox.Item key={option.value} value={option} className={comboboxItemClass({ multiple })}>\n {multiple ? (\n <>\n {option.start}\n <ComboboxOptionText option={option} />\n <span className={comboboxStyles.itemRightSlot}>\n {option.end ? <div className={comboboxStyles.optionEnd}>{option.end}</div> : null}\n <span className={comboboxStyles.checkContainer}>\n {isSelected ? <Check className={comboboxStyles.checkIcon} /> : null}\n </span>\n </span>\n </>\n ) : (\n <>\n {option.start}\n <ComboboxOptionText option={option} />\n <span className={comboboxStyles.itemRightSlot}>\n {option.end ? <div className={comboboxStyles.optionEnd}>{option.end}</div> : null}\n <span className={comboboxStyles.checkContainer}>\n <BaseCombobox.ItemIndicator>\n <Check className={comboboxStyles.checkIcon} />\n </BaseCombobox.ItemIndicator>\n </span>\n </span>\n </>\n )}\n </BaseCombobox.Item>\n );\n }}\n </BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </>\n );\n\n if (multiple) {\n return (\n <div className={comboboxStyles.root}>\n <BaseCombobox.Root\n multiple\n autoHighlight\n items={displayedOptions}\n value={selectedOptions}\n onValueChange={items => props.onValueChange?.((items ?? []).map(item => item.value))}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n {comboboxContent}\n </BaseCombobox.Root>\n {error && <span className={comboboxStyles.error}>{error}</span>}\n </div>\n );\n }\n\n return (\n <div className={comboboxStyles.root}>\n <BaseCombobox.Root\n autoHighlight\n items={displayedOptions}\n value={selectedOption}\n inputValue={inputValue}\n onInputValueChange={setInputValue}\n onValueChange={item => {\n if (item) {\n props.onValueChange?.(item.value);\n setInputValue('');\n }\n }}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n {comboboxContent}\n </BaseCombobox.Root>\n {error && <span className={comboboxStyles.error}>{error}</span>}\n </div>\n );\n}\n"],"names":["BaseCombobox"],"mappings":";;;;;;;;;;;;AAmBA,SAAS,yBAAyB,OAAA,EAAi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QACA,YAAA;AAAA,QAEC,QAAA,EAAA;AAAA;AAAA,KACH;AAAA,IACC,yBAAS,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,cAAA,CAAe,OAAQ,QAAA,EAAA,KAAA,EAAM;AAAA,GAAA,EAC1D,CAAA;AAEJ;;;;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { C as Combobox, c as comboboxStyles } from '../combobox-
|
|
1
|
+
export { C as Combobox, c as comboboxStyles } from '../combobox-DeeAlYti.js';
|
|
2
2
|
export { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox';
|
|
3
3
|
//# sourceMappingURL=Combobox.es.js.map
|
|
@@ -7,7 +7,7 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
const lucideReact = require('lucide-react');
|
|
8
8
|
const React = require('react');
|
|
9
9
|
const Button = require('../Button-D10WB4vc.cjs');
|
|
10
|
-
const combobox = require('../combobox-
|
|
10
|
+
const combobox = require('../combobox-BQrlN0eB.cjs');
|
|
11
11
|
const popover = require('../popover-BPvIo79r.cjs');
|
|
12
12
|
const utils_cn = require('../cn-DCPcv4xv.cjs');
|
|
13
13
|
|
|
@@ -4,7 +4,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { ListFilterPlusIcon, ArrowLeftIcon, FilterIcon, PlusIcon, ChevronRightIcon } from 'lucide-react';
|
|
5
5
|
import { useMemo, useState, useRef, useCallback, useEffect } from 'react';
|
|
6
6
|
import { B as Button } from '../Button-BsfLQEC6.js';
|
|
7
|
-
import { C as Combobox } from '../combobox-
|
|
7
|
+
import { C as Combobox } from '../combobox-DeeAlYti.js';
|
|
8
8
|
import { P as Popover, b as PopoverTrigger, a as PopoverContent } from '../popover-Be-ufAIL.js';
|
|
9
9
|
import { c as cn } from '../cn-B4oPhFx9.js';
|
|
10
10
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { S as Section, a as SectionRoot, b as SubSectionRoot } from '../section-
|
|
1
|
+
export { S as Section, a as SectionRoot, b as SubSectionRoot } from '../section-BOhQbu5e.js';
|
|
2
2
|
//# sourceMappingURL=Section.es.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const Txt = require('../Txt-D5Y_H2a0.cjs');
|
|
7
|
+
const utils_cn = require('../cn-DCPcv4xv.cjs');
|
|
8
|
+
|
|
9
|
+
function SettingsLayout({ title, action, inset = false, children }) {
|
|
10
|
+
if (title === void 0 || title === null) {
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
"data-slot": "settings-layout-content",
|
|
15
|
+
className: "mx-auto w-full max-w-5xl min-w-0 overflow-x-hidden px-4 py-6 sm:px-6 sm:py-8",
|
|
16
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 space-y-14", children })
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
21
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
"data-slot": "settings-page-header",
|
|
25
|
+
className: "mx-auto w-full max-w-5xl min-w-0 overflow-x-clip px-4 pt-6 pb-0 sm:px-6 sm:pt-12",
|
|
26
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils_cn.cn("flex min-w-0 flex-wrap items-center justify-between gap-4", inset && "pl-4"), children: [
|
|
27
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
28
|
+
Txt.Txt,
|
|
29
|
+
{
|
|
30
|
+
as: "h1",
|
|
31
|
+
variant: "header-md",
|
|
32
|
+
className: utils_cn.cn("min-w-0 truncate", "font-sans font-medium tracking-normal text-neutral4"),
|
|
33
|
+
children: title
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
action ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: action }) : null
|
|
37
|
+
] })
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
"data-slot": "settings-layout-content",
|
|
44
|
+
className: "mx-auto w-full max-w-5xl min-w-0 overflow-x-hidden px-4 py-6 sm:px-6 sm:py-8",
|
|
45
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 space-y-8", children })
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
] });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
exports.SettingsLayout = SettingsLayout;
|
|
52
|
+
//# sourceMappingURL=SettingsLayout.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsLayout.cjs.js","sources":["../../src/ds/components/SettingsLayout/settings-layout.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { Txt } from '../Txt';\nimport { cn } from '@/lib/utils';\n\nexport interface SettingsLayoutProps {\n title?: ReactNode;\n action?: ReactNode;\n inset?: boolean;\n children: ReactNode;\n}\n\nexport function SettingsLayout({ title, action, inset = false, children }: SettingsLayoutProps) {\n if (title === undefined || title === null) {\n return (\n <div\n data-slot=\"settings-layout-content\"\n className=\"mx-auto w-full max-w-5xl min-w-0 overflow-x-hidden px-4 py-6 sm:px-6 sm:py-8\"\n >\n <div className=\"min-w-0 space-y-14\">{children}</div>\n </div>\n );\n }\n\n return (\n <>\n <div\n data-slot=\"settings-page-header\"\n className=\"mx-auto w-full max-w-5xl min-w-0 overflow-x-clip px-4 pt-6 pb-0 sm:px-6 sm:pt-12\"\n >\n <div className={cn('flex min-w-0 flex-wrap items-center justify-between gap-4', inset && 'pl-4')}>\n <Txt\n as=\"h1\"\n variant=\"header-md\"\n className={cn('min-w-0 truncate', 'font-sans font-medium tracking-normal text-neutral4')}\n >\n {title}\n </Txt>\n {action ? <div className=\"shrink-0\">{action}</div> : null}\n </div>\n </div>\n <div\n data-slot=\"settings-layout-content\"\n className=\"mx-auto w-full max-w-5xl min-w-0 overflow-x-hidden px-4 py-6 sm:px-6 sm:py-8\"\n >\n <div className=\"min-w-0 space-y-8\">{children}</div>\n </div>\n </>\n );\n}\n"],"names":["jsx","jsxs","Fragment","cn","Txt"],"mappings":";;;;;;;;AAWO,SAAS,eAAe,EAAE,KAAA,EAAO,QAAQ,KAAA,GAAQ,KAAA,EAAO,UAAS,EAAwB;AAC9F,EAAA,IAAI,KAAA,KAAU,MAAA,IAAa,KAAA,KAAU,IAAA,EAAM;AACzC,IAAA,uBACEA,cAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,WAAA,EAAU,yBAAA;AAAA,QACV,SAAA,EAAU,8EAAA;AAAA,QAEV,QAAA,kBAAAA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,oBAAA,EAAsB,QAAA,EAAS;AAAA;AAAA,KAChD;AAAA,EAEJ;AAEA,EAAA,uBACEC,eAAA,CAAAC,mBAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAAF,cAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,WAAA,EAAU,sBAAA;AAAA,QACV,SAAA,EAAU,kFAAA;AAAA,QAEV,0CAAC,KAAA,EAAA,EAAI,SAAA,EAAWG,YAAG,2DAAA,EAA6D,KAAA,IAAS,MAAM,CAAA,EAC7F,QAAA,EAAA;AAAA,0BAAAH,cAAA;AAAA,YAACI,OAAA;AAAA,YAAA;AAAA,cACC,EAAA,EAAG,IAAA;AAAA,cACH,OAAA,EAAQ,WAAA;AAAA,cACR,SAAA,EAAWD,WAAA,CAAG,kBAAA,EAAoB,qDAAqD,CAAA;AAAA,cAEtF,QAAA,EAAA;AAAA;AAAA,WACH;AAAA,UACC,yBAASH,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,UAAA,EAAY,kBAAO,CAAA,GAAS;AAAA,SAAA,EACvD;AAAA;AAAA,KACF;AAAA,oBACAA,cAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,WAAA,EAAU,yBAAA;AAAA,QACV,SAAA,EAAU,8EAAA;AAAA,QAEV,QAAA,kBAAAA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,mBAAA,EAAqB,QAAA,EAAS;AAAA;AAAA;AAC/C,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { T as Txt } from '../Txt-ByUf-9Ic.js';
|
|
3
|
+
import { c as cn } from '../cn-B4oPhFx9.js';
|
|
4
|
+
|
|
5
|
+
function SettingsLayout({ title, action, inset = false, children }) {
|
|
6
|
+
if (title === void 0 || title === null) {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
"data-slot": "settings-layout-content",
|
|
11
|
+
className: "mx-auto w-full max-w-5xl min-w-0 overflow-x-hidden px-4 py-6 sm:px-6 sm:py-8",
|
|
12
|
+
children: /* @__PURE__ */ jsx("div", { className: "min-w-0 space-y-14", children })
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
+
/* @__PURE__ */ jsx(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "settings-page-header",
|
|
21
|
+
className: "mx-auto w-full max-w-5xl min-w-0 overflow-x-clip px-4 pt-6 pb-0 sm:px-6 sm:pt-12",
|
|
22
|
+
children: /* @__PURE__ */ jsxs("div", { className: cn("flex min-w-0 flex-wrap items-center justify-between gap-4", inset && "pl-4"), children: [
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
Txt,
|
|
25
|
+
{
|
|
26
|
+
as: "h1",
|
|
27
|
+
variant: "header-md",
|
|
28
|
+
className: cn("min-w-0 truncate", "font-sans font-medium tracking-normal text-neutral4"),
|
|
29
|
+
children: title
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
action ? /* @__PURE__ */ jsx("div", { className: "shrink-0", children: action }) : null
|
|
33
|
+
] })
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ jsx(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
"data-slot": "settings-layout-content",
|
|
40
|
+
className: "mx-auto w-full max-w-5xl min-w-0 overflow-x-hidden px-4 py-6 sm:px-6 sm:py-8",
|
|
41
|
+
children: /* @__PURE__ */ jsx("div", { className: "min-w-0 space-y-8", children })
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { SettingsLayout };
|
|
48
|
+
//# sourceMappingURL=SettingsLayout.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsLayout.es.js","sources":["../../src/ds/components/SettingsLayout/settings-layout.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { Txt } from '../Txt';\nimport { cn } from '@/lib/utils';\n\nexport interface SettingsLayoutProps {\n title?: ReactNode;\n action?: ReactNode;\n inset?: boolean;\n children: ReactNode;\n}\n\nexport function SettingsLayout({ title, action, inset = false, children }: SettingsLayoutProps) {\n if (title === undefined || title === null) {\n return (\n <div\n data-slot=\"settings-layout-content\"\n className=\"mx-auto w-full max-w-5xl min-w-0 overflow-x-hidden px-4 py-6 sm:px-6 sm:py-8\"\n >\n <div className=\"min-w-0 space-y-14\">{children}</div>\n </div>\n );\n }\n\n return (\n <>\n <div\n data-slot=\"settings-page-header\"\n className=\"mx-auto w-full max-w-5xl min-w-0 overflow-x-clip px-4 pt-6 pb-0 sm:px-6 sm:pt-12\"\n >\n <div className={cn('flex min-w-0 flex-wrap items-center justify-between gap-4', inset && 'pl-4')}>\n <Txt\n as=\"h1\"\n variant=\"header-md\"\n className={cn('min-w-0 truncate', 'font-sans font-medium tracking-normal text-neutral4')}\n >\n {title}\n </Txt>\n {action ? <div className=\"shrink-0\">{action}</div> : null}\n </div>\n </div>\n <div\n data-slot=\"settings-layout-content\"\n className=\"mx-auto w-full max-w-5xl min-w-0 overflow-x-hidden px-4 py-6 sm:px-6 sm:py-8\"\n >\n <div className=\"min-w-0 space-y-8\">{children}</div>\n </div>\n </>\n );\n}\n"],"names":[],"mappings":";;;;AAWO,SAAS,eAAe,EAAE,KAAA,EAAO,QAAQ,KAAA,GAAQ,KAAA,EAAO,UAAS,EAAwB;AAC9F,EAAA,IAAI,KAAA,KAAU,MAAA,IAAa,KAAA,KAAU,IAAA,EAAM;AACzC,IAAA,uBACE,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,WAAA,EAAU,yBAAA;AAAA,QACV,SAAA,EAAU,8EAAA;AAAA,QAEV,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,oBAAA,EAAsB,QAAA,EAAS;AAAA;AAAA,KAChD;AAAA,EAEJ;AAEA,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,WAAA,EAAU,sBAAA;AAAA,QACV,SAAA,EAAU,kFAAA;AAAA,QAEV,+BAAC,KAAA,EAAA,EAAI,SAAA,EAAW,GAAG,2DAAA,EAA6D,KAAA,IAAS,MAAM,CAAA,EAC7F,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,GAAA;AAAA,YAAA;AAAA,cACC,EAAA,EAAG,IAAA;AAAA,cACH,OAAA,EAAQ,WAAA;AAAA,cACR,SAAA,EAAW,EAAA,CAAG,kBAAA,EAAoB,qDAAqD,CAAA;AAAA,cAEtF,QAAA,EAAA;AAAA;AAAA,WACH;AAAA,UACC,yBAAS,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,UAAA,EAAY,kBAAO,CAAA,GAAS;AAAA,SAAA,EACvD;AAAA;AAAA,KACF;AAAA,oBACA,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,WAAA,EAAU,yBAAA;AAAA,QACV,SAAA,EAAU,8EAAA;AAAA,QAEV,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,mBAAA,EAAqB,QAAA,EAAS;AAAA;AAAA;AAC/C,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -14,7 +14,7 @@ const React = require('react');
|
|
|
14
14
|
const Button = require('../Button-D10WB4vc.cjs');
|
|
15
15
|
const buttonsGroup = require('../buttons-group-Cn36DWYX.cjs');
|
|
16
16
|
const copyButton = require('../copy-button-BtnbaMvl.cjs');
|
|
17
|
-
const section = require('../section-
|
|
17
|
+
const section = require('../section-5nzZUvtb.cjs');
|
|
18
18
|
const themeProvider = require('../theme-provider-aO5-jZVp.cjs');
|
|
19
19
|
const drawer = require('../drawer-mE9CCzMI.cjs');
|
|
20
20
|
const utils_cn = require('../cn-DCPcv4xv.cjs');
|
|
@@ -11,7 +11,7 @@ import { useState, useMemo } from 'react';
|
|
|
11
11
|
import { B as Button } from '../Button-BsfLQEC6.js';
|
|
12
12
|
import { B as ButtonsGroup } from '../buttons-group-BjM12HPx.js';
|
|
13
13
|
import { C as CopyButton } from '../copy-button-BHmcGzIz.js';
|
|
14
|
-
import { S as Section } from '../section-
|
|
14
|
+
import { S as Section } from '../section-BOhQbu5e.js';
|
|
15
15
|
import { u as useTheme } from '../theme-provider-C9ih9jSS.js';
|
|
16
16
|
import { j as DrawerInteractive, D as Drawer, l as DrawerPortal, a as DrawerBackdrop, q as DrawerViewport, k as DrawerPopup, o as DrawerTitle, e as DrawerDescription, c as DrawerClose } from '../drawer-4U7L_dHA.js';
|
|
17
17
|
import { c as cn } from '../cn-B4oPhFx9.js';
|
|
@@ -34,15 +34,16 @@ function SectionDivider({ className, ...props }) {
|
|
|
34
34
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "separator", "aria-orientation": "horizontal", className: utils_cn.cn("h-px bg-border1", className), ...props });
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
function SectionHeader({ children, className, ...props }) {
|
|
37
|
+
function SectionHeader({ children, className, inset = false, ...props }) {
|
|
38
38
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
39
|
"header",
|
|
40
40
|
{
|
|
41
41
|
"data-slot": "section-header",
|
|
42
42
|
className: utils_cn.cn(
|
|
43
43
|
"group-data-[variant=default]/section:grid group-data-[variant=default]/section:grid-cols-[1fr_auto] group-data-[variant=default]/section:items-center",
|
|
44
|
-
"group-data-[variant=flat]/section:flex group-data-[variant=flat]/section:min-w-0 group-data-[variant=flat]/section:flex-col group-data-[variant=flat]/section:gap-4 group-data-[variant=flat]/section:
|
|
45
|
-
"group-data-[variant=factory]/section:flex group-data-[variant=factory]/section:min-w-0 group-data-[variant=factory]/section:flex-col group-data-[variant=factory]/section:gap-2
|
|
44
|
+
"group-data-[variant=flat]/section:flex group-data-[variant=flat]/section:min-w-0 group-data-[variant=flat]/section:flex-col group-data-[variant=flat]/section:gap-4 group-data-[variant=flat]/section:pb-4 sm:group-data-[variant=flat]/section:flex-row sm:group-data-[variant=flat]/section:items-start sm:group-data-[variant=flat]/section:justify-between sm:group-data-[variant=flat]/section:gap-6",
|
|
45
|
+
"group-data-[variant=factory]/section:flex group-data-[variant=factory]/section:min-w-0 group-data-[variant=factory]/section:flex-col group-data-[variant=factory]/section:gap-2 sm:group-data-[variant=factory]/section:flex-row sm:group-data-[variant=factory]/section:items-start sm:group-data-[variant=factory]/section:justify-between sm:group-data-[variant=factory]/section:gap-4",
|
|
46
|
+
inset && "px-4",
|
|
46
47
|
className
|
|
47
48
|
),
|
|
48
49
|
...props,
|
|
@@ -172,4 +173,4 @@ Section.Divider = SectionDivider;
|
|
|
172
173
|
exports.Section = Section;
|
|
173
174
|
exports.SectionRoot = SectionRoot;
|
|
174
175
|
exports.SubSectionRoot = SubSectionRoot;
|
|
175
|
-
//# sourceMappingURL=section-
|
|
176
|
+
//# sourceMappingURL=section-5nzZUvtb.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-5nzZUvtb.cjs","sources":["../src/ds/components/Section/section-content.tsx","../src/ds/components/Section/section-description.tsx","../src/ds/components/Section/section-divider.tsx","../src/ds/components/Section/section-header.tsx","../src/ds/components/Section/section-header-text.tsx","../src/ds/components/Section/section-heading.tsx","../src/ds/components/Section/section-root.tsx","../src/ds/components/Section/section-row.tsx","../src/ds/components/Section/section.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionContentProps = ComponentProps<'div'>;\n\nexport function SectionContent({ className, ...props }: SectionContentProps) {\n return (\n <div\n data-slot=\"section-content\"\n className={cn(\n 'group-data-[variant=factory]/section:overflow-hidden group-data-[variant=factory]/section:rounded-xl group-data-[variant=factory]/section:border group-data-[variant=factory]/section:border-border1 group-data-[variant=factory]/section:bg-surface3',\n className,\n )}\n {...props}\n />\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionDescriptionProps = ComponentProps<'p'>;\n\nexport function SectionDescription({ className, ...props }: SectionDescriptionProps) {\n return (\n <p\n data-slot=\"section-description\"\n className={cn('max-w-[62ch] text-ui-md leading-ui-md text-pretty text-neutral3', className)}\n {...props}\n />\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionDividerProps = ComponentProps<'div'>;\n\nexport function SectionDivider({ className, ...props }: SectionDividerProps) {\n return <div role=\"separator\" aria-orientation=\"horizontal\" className={cn('h-px bg-border1', className)} {...props} />;\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionHeaderProps = ComponentProps<'header'> & {\n inset?: boolean;\n};\n\nexport function SectionHeader({ children, className, inset = false, ...props }: SectionHeaderProps) {\n return (\n <header\n data-slot=\"section-header\"\n className={cn(\n 'group-data-[variant=default]/section:grid group-data-[variant=default]/section:grid-cols-[1fr_auto] group-data-[variant=default]/section:items-center',\n 'group-data-[variant=flat]/section:flex group-data-[variant=flat]/section:min-w-0 group-data-[variant=flat]/section:flex-col group-data-[variant=flat]/section:gap-4 group-data-[variant=flat]/section:pb-4 sm:group-data-[variant=flat]/section:flex-row sm:group-data-[variant=flat]/section:items-start sm:group-data-[variant=flat]/section:justify-between sm:group-data-[variant=flat]/section:gap-6',\n 'group-data-[variant=factory]/section:flex group-data-[variant=factory]/section:min-w-0 group-data-[variant=factory]/section:flex-col group-data-[variant=factory]/section:gap-2 sm:group-data-[variant=factory]/section:flex-row sm:group-data-[variant=factory]/section:items-start sm:group-data-[variant=factory]/section:justify-between sm:group-data-[variant=factory]/section:gap-4',\n inset && 'px-4',\n className,\n )}\n {...props}\n >\n {children}\n </header>\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionHeaderTextProps = ComponentProps<'div'>;\n\nexport function SectionHeaderText({ className, ...props }: SectionHeaderTextProps) {\n return <div data-slot=\"section-header-text\" className={cn('flex min-w-0 flex-col gap-1.5', className)} {...props} />;\n}\n","import type { ComponentProps, ElementType } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionHeadingProps = ComponentProps<'h2'> & {\n headingLevel?: 'h2' | 'h3' | 'h4';\n};\n\nexport function SectionHeading({ headingLevel = 'h2', children, className, ...props }: SectionHeadingProps) {\n const HeadingTag: ElementType = headingLevel;\n\n return (\n <HeadingTag\n data-slot=\"section-heading\"\n className={cn(\n 'group-data-[variant=default]/section:flex group-data-[variant=default]/section:items-center group-data-[variant=default]/section:gap-2 group-data-[variant=default]/section:text-ui-lg group-data-[variant=default]/section:font-bold group-data-[variant=default]/section:text-neutral4 group-data-[variant=default]/section:[&>svg]:size-[1.2em] group-data-[variant=default]/section:[&>svg]:opacity-50',\n 'group-data-[variant=flat]/section:text-ui-lg group-data-[variant=flat]/section:leading-ui-lg group-data-[variant=flat]/section:font-medium group-data-[variant=flat]/section:text-balance group-data-[variant=flat]/section:text-neutral5',\n 'group-data-[variant=factory]/section:text-ui-lg group-data-[variant=factory]/section:leading-ui-lg group-data-[variant=factory]/section:font-medium group-data-[variant=factory]/section:text-balance group-data-[variant=factory]/section:text-neutral5',\n className,\n )}\n {...props}\n >\n {children}\n </HeadingTag>\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionVariant = 'default' | 'flat' | 'factory';\n\nexport type SectionRootProps = ComponentProps<'section'> & {\n variant?: SectionVariant;\n};\n\nexport function SectionRoot({ variant = 'default', children, className, ...props }: SectionRootProps) {\n return (\n <section\n data-slot=\"section\"\n data-variant={variant}\n className={cn(\n 'group/section',\n variant === 'default' && 'grid gap-4',\n variant === 'flat' && 'w-full min-w-0',\n variant === 'factory' && 'flex w-full min-w-0 flex-col gap-2',\n className,\n )}\n {...props}\n >\n {children}\n </section>\n );\n}\n\nexport function SubSectionRoot({ children, className, ...props }: ComponentProps<'section'>) {\n return (\n <section className={cn('grid gap-2', className)} {...props}>\n {children}\n </section>\n );\n}\n","import { LockKeyholeIcon } from 'lucide-react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport { Label } from '@/ds/components/Label/label';\nimport { cn } from '@/lib/utils';\n\nexport type SectionRowProps = Omit<ComponentProps<'div'>, 'children'> & {\n label: ReactNode;\n description?: ReactNode;\n htmlFor?: string;\n children?: ReactNode;\n};\n\nexport type SectionViewOnlyRowProps = Omit<SectionRowProps, 'children'> & {\n children: ReactNode;\n};\n\nexport type SectionDestructiveRowProps = Omit<SectionRowProps, 'children'> & {\n children: ReactNode;\n};\n\ntype SectionRowLayoutProps = SectionRowProps & {\n tone?: 'default' | 'destructive';\n viewOnly?: boolean;\n};\n\nfunction SectionRowLayout({\n label,\n description,\n htmlFor,\n children,\n className,\n tone = 'default',\n viewOnly = false,\n ...props\n}: SectionRowLayoutProps) {\n const destructive = tone === 'destructive';\n const labelClassName = cn(\n 'text-ui-md leading-ui-md',\n destructive ? 'text-accent2' : viewOnly ? 'text-neutral3' : 'text-neutral5',\n 'group-data-[variant=factory]/section:font-medium group-data-[variant=flat]/section:font-medium',\n );\n\n return (\n <div\n data-slot=\"section-row\"\n className={cn(\n 'grid min-w-0 gap-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center',\n 'sm:group-data-[variant=default]/section:gap-4',\n 'group-data-[variant=flat]/section:p-4 sm:group-data-[variant=flat]/section:gap-8',\n 'group-data-[variant=factory]/section:px-4 group-data-[variant=factory]/section:py-3 sm:group-data-[variant=factory]/section:gap-4',\n className,\n )}\n {...props}\n >\n <div className=\"min-w-0\">\n {htmlFor ? (\n <Label htmlFor={htmlFor} className={labelClassName}>\n {label}\n </Label>\n ) : (\n <p className={labelClassName}>{label}</p>\n )}\n {description != null ? (\n <p className=\"text-ui-md leading-ui-md text-neutral3 mt-1 max-w-[62ch] text-pretty\">{description}</p>\n ) : null}\n </div>\n {children != null ? (\n <div\n data-slot=\"section-control\"\n className={cn('min-w-0 sm:justify-self-end', viewOnly && 'flex items-center gap-2 text-ui-md text-neutral3')}\n >\n {viewOnly ? (\n <>\n <LockKeyholeIcon className=\"size-4 shrink-0\" aria-hidden />\n <span className=\"sr-only\">View only: </span>\n </>\n ) : null}\n {children}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function SectionRow(props: SectionRowProps) {\n return <SectionRowLayout {...props} />;\n}\n\nexport function SectionViewOnlyRow(props: SectionViewOnlyRowProps) {\n return <SectionRowLayout viewOnly {...props} />;\n}\n\nexport function SectionDestructiveRow(props: SectionDestructiveRowProps) {\n return <SectionRowLayout tone=\"destructive\" {...props} />;\n}\n","import { SectionContent } from './section-content';\nimport { SectionDescription } from './section-description';\nimport { SectionDivider } from './section-divider';\nimport { SectionHeader } from './section-header';\nimport { SectionHeaderText } from './section-header-text';\nimport { SectionHeading } from './section-heading';\nimport { SectionRoot, type SectionRootProps } from './section-root';\nimport { SectionDestructiveRow, SectionRow, SectionViewOnlyRow } from './section-row';\n\nexport { type SectionContentProps } from './section-content';\nexport { type SectionDescriptionProps } from './section-description';\nexport { type SectionDividerProps } from './section-divider';\nexport { type SectionHeaderProps } from './section-header';\nexport { type SectionHeaderTextProps } from './section-header-text';\nexport { type SectionHeadingProps } from './section-heading';\nexport { type SectionRootProps as SectionProps, type SectionVariant } from './section-root';\nexport { type SectionDestructiveRowProps, type SectionRowProps, type SectionViewOnlyRowProps } from './section-row';\n\nexport function Section(props: SectionRootProps) {\n return <SectionRoot {...props} />;\n}\n\nSection.Header = SectionHeader;\nSection.HeaderText = SectionHeaderText;\nSection.Heading = SectionHeading;\nSection.Description = SectionDescription;\nSection.Content = SectionContent;\nSection.Row = SectionRow;\nSection.ViewOnlyRow = SectionViewOnlyRow;\nSection.DestructiveRow = SectionDestructiveRow;\nSection.Divider = SectionDivider;\n"],"names":["jsx","cn","label","jsxs","Label","Fragment","LockKeyholeIcon"],"mappings":";;;;;;;AAKO,SAAS,cAAA,CAAe,EAAE,SAAA,EAAW,GAAG,OAAM,EAAwB;AAC3E,EAAA,uBACEA,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,iBAAA;AAAA,MACV,SAAA,EAAWC,WAAA;AAAA,QACT,uPAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;;ACXO,SAAS,kBAAA,CAAmB,EAAE,SAAA,EAAW,GAAG,OAAM,EAA4B;AACnF,EAAA,uBACED,cAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAWC,WAAA,CAAG,iE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,mBAAmB,KAAA,EAAgC;AACjE,EAAA,uBAAOA,cAAA,CAAC,gBAAA,EAAA,EAAiB,QAAA,EAAQ,IAAA,EAAE,GAAG,KAAA,EAAO,CAAA;AAC/C;AAEO,SAAS,sBAAsB,KAAA,EAAmC;AACvE,EAAA,uBAAOA,cAAA,CAAC,gBAAA,EAAA,EAAiB,IAAA,EAAK,aAAA,EAAe,GAAG,KAAA,EAAO,CAAA;AACzD;;AC5EO,SAAS,QAAQ,KAAA,EAAyB;AAC/C,EAAA,uBAAOA,cAAA,CAAC,WAAA,EAAA,EAAa,GAAG,KAAA,EAAO,CAAA;AACjC;AAEA,OAAA,CAAQ,MAAA,GAAS,aAAA;AACjB,OAAA,CAAQ,UAAA,GAAa,iBAAA;AACrB,OAAA,CAAQ,OAAA,GAAU,cAAA;AAClB,OAAA,CAAQ,WAAA,GAAc,kBAAA;AACtB,OAAA,CAAQ,OAAA,GAAU,cAAA;AAClB,OAAA,CAAQ,GAAA,GAAM,UAAA;AACd,OAAA,CAAQ,WAAA,GAAc,kBAAA;AACtB,OAAA,CAAQ,cAAA,GAAiB,qBAAA;AACzB,OAAA,CAAQ,OAAA,GAAU,cAAA;;;;;;"}
|
|
@@ -32,15 +32,16 @@ function SectionDivider({ className, ...props }) {
|
|
|
32
32
|
return /* @__PURE__ */ jsx("div", { role: "separator", "aria-orientation": "horizontal", className: cn("h-px bg-border1", className), ...props });
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
function SectionHeader({ children, className, ...props }) {
|
|
35
|
+
function SectionHeader({ children, className, inset = false, ...props }) {
|
|
36
36
|
return /* @__PURE__ */ jsx(
|
|
37
37
|
"header",
|
|
38
38
|
{
|
|
39
39
|
"data-slot": "section-header",
|
|
40
40
|
className: cn(
|
|
41
41
|
"group-data-[variant=default]/section:grid group-data-[variant=default]/section:grid-cols-[1fr_auto] group-data-[variant=default]/section:items-center",
|
|
42
|
-
"group-data-[variant=flat]/section:flex group-data-[variant=flat]/section:min-w-0 group-data-[variant=flat]/section:flex-col group-data-[variant=flat]/section:gap-4 group-data-[variant=flat]/section:
|
|
43
|
-
"group-data-[variant=factory]/section:flex group-data-[variant=factory]/section:min-w-0 group-data-[variant=factory]/section:flex-col group-data-[variant=factory]/section:gap-2
|
|
42
|
+
"group-data-[variant=flat]/section:flex group-data-[variant=flat]/section:min-w-0 group-data-[variant=flat]/section:flex-col group-data-[variant=flat]/section:gap-4 group-data-[variant=flat]/section:pb-4 sm:group-data-[variant=flat]/section:flex-row sm:group-data-[variant=flat]/section:items-start sm:group-data-[variant=flat]/section:justify-between sm:group-data-[variant=flat]/section:gap-6",
|
|
43
|
+
"group-data-[variant=factory]/section:flex group-data-[variant=factory]/section:min-w-0 group-data-[variant=factory]/section:flex-col group-data-[variant=factory]/section:gap-2 sm:group-data-[variant=factory]/section:flex-row sm:group-data-[variant=factory]/section:items-start sm:group-data-[variant=factory]/section:justify-between sm:group-data-[variant=factory]/section:gap-4",
|
|
44
|
+
inset && "px-4",
|
|
44
45
|
className
|
|
45
46
|
),
|
|
46
47
|
...props,
|
|
@@ -168,4 +169,4 @@ Section.DestructiveRow = SectionDestructiveRow;
|
|
|
168
169
|
Section.Divider = SectionDivider;
|
|
169
170
|
|
|
170
171
|
export { Section as S, SectionRoot as a, SubSectionRoot as b };
|
|
171
|
-
//# sourceMappingURL=section-
|
|
172
|
+
//# sourceMappingURL=section-BOhQbu5e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-BOhQbu5e.js","sources":["../src/ds/components/Section/section-content.tsx","../src/ds/components/Section/section-description.tsx","../src/ds/components/Section/section-divider.tsx","../src/ds/components/Section/section-header.tsx","../src/ds/components/Section/section-header-text.tsx","../src/ds/components/Section/section-heading.tsx","../src/ds/components/Section/section-root.tsx","../src/ds/components/Section/section-row.tsx","../src/ds/components/Section/section.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionContentProps = ComponentProps<'div'>;\n\nexport function SectionContent({ className, ...props }: SectionContentProps) {\n return (\n <div\n data-slot=\"section-content\"\n className={cn(\n 'group-data-[variant=factory]/section:overflow-hidden group-data-[variant=factory]/section:rounded-xl group-data-[variant=factory]/section:border group-data-[variant=factory]/section:border-border1 group-data-[variant=factory]/section:bg-surface3',\n className,\n )}\n {...props}\n />\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionDescriptionProps = ComponentProps<'p'>;\n\nexport function SectionDescription({ className, ...props }: SectionDescriptionProps) {\n return (\n <p\n data-slot=\"section-description\"\n className={cn('max-w-[62ch] text-ui-md leading-ui-md text-pretty text-neutral3', className)}\n {...props}\n />\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionDividerProps = ComponentProps<'div'>;\n\nexport function SectionDivider({ className, ...props }: SectionDividerProps) {\n return <div role=\"separator\" aria-orientation=\"horizontal\" className={cn('h-px bg-border1', className)} {...props} />;\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionHeaderProps = ComponentProps<'header'> & {\n inset?: boolean;\n};\n\nexport function SectionHeader({ children, className, inset = false, ...props }: SectionHeaderProps) {\n return (\n <header\n data-slot=\"section-header\"\n className={cn(\n 'group-data-[variant=default]/section:grid group-data-[variant=default]/section:grid-cols-[1fr_auto] group-data-[variant=default]/section:items-center',\n 'group-data-[variant=flat]/section:flex group-data-[variant=flat]/section:min-w-0 group-data-[variant=flat]/section:flex-col group-data-[variant=flat]/section:gap-4 group-data-[variant=flat]/section:pb-4 sm:group-data-[variant=flat]/section:flex-row sm:group-data-[variant=flat]/section:items-start sm:group-data-[variant=flat]/section:justify-between sm:group-data-[variant=flat]/section:gap-6',\n 'group-data-[variant=factory]/section:flex group-data-[variant=factory]/section:min-w-0 group-data-[variant=factory]/section:flex-col group-data-[variant=factory]/section:gap-2 sm:group-data-[variant=factory]/section:flex-row sm:group-data-[variant=factory]/section:items-start sm:group-data-[variant=factory]/section:justify-between sm:group-data-[variant=factory]/section:gap-4',\n inset && 'px-4',\n className,\n )}\n {...props}\n >\n {children}\n </header>\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionHeaderTextProps = ComponentProps<'div'>;\n\nexport function SectionHeaderText({ className, ...props }: SectionHeaderTextProps) {\n return <div data-slot=\"section-header-text\" className={cn('flex min-w-0 flex-col gap-1.5', className)} {...props} />;\n}\n","import type { ComponentProps, ElementType } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionHeadingProps = ComponentProps<'h2'> & {\n headingLevel?: 'h2' | 'h3' | 'h4';\n};\n\nexport function SectionHeading({ headingLevel = 'h2', children, className, ...props }: SectionHeadingProps) {\n const HeadingTag: ElementType = headingLevel;\n\n return (\n <HeadingTag\n data-slot=\"section-heading\"\n className={cn(\n 'group-data-[variant=default]/section:flex group-data-[variant=default]/section:items-center group-data-[variant=default]/section:gap-2 group-data-[variant=default]/section:text-ui-lg group-data-[variant=default]/section:font-bold group-data-[variant=default]/section:text-neutral4 group-data-[variant=default]/section:[&>svg]:size-[1.2em] group-data-[variant=default]/section:[&>svg]:opacity-50',\n 'group-data-[variant=flat]/section:text-ui-lg group-data-[variant=flat]/section:leading-ui-lg group-data-[variant=flat]/section:font-medium group-data-[variant=flat]/section:text-balance group-data-[variant=flat]/section:text-neutral5',\n 'group-data-[variant=factory]/section:text-ui-lg group-data-[variant=factory]/section:leading-ui-lg group-data-[variant=factory]/section:font-medium group-data-[variant=factory]/section:text-balance group-data-[variant=factory]/section:text-neutral5',\n className,\n )}\n {...props}\n >\n {children}\n </HeadingTag>\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionVariant = 'default' | 'flat' | 'factory';\n\nexport type SectionRootProps = ComponentProps<'section'> & {\n variant?: SectionVariant;\n};\n\nexport function SectionRoot({ variant = 'default', children, className, ...props }: SectionRootProps) {\n return (\n <section\n data-slot=\"section\"\n data-variant={variant}\n className={cn(\n 'group/section',\n variant === 'default' && 'grid gap-4',\n variant === 'flat' && 'w-full min-w-0',\n variant === 'factory' && 'flex w-full min-w-0 flex-col gap-2',\n className,\n )}\n {...props}\n >\n {children}\n </section>\n );\n}\n\nexport function SubSectionRoot({ children, className, ...props }: ComponentProps<'section'>) {\n return (\n <section className={cn('grid gap-2', className)} {...props}>\n {children}\n </section>\n );\n}\n","import { LockKeyholeIcon } from 'lucide-react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport { Label } from '@/ds/components/Label/label';\nimport { cn } from '@/lib/utils';\n\nexport type SectionRowProps = Omit<ComponentProps<'div'>, 'children'> & {\n label: ReactNode;\n description?: ReactNode;\n htmlFor?: string;\n children?: ReactNode;\n};\n\nexport type SectionViewOnlyRowProps = Omit<SectionRowProps, 'children'> & {\n children: ReactNode;\n};\n\nexport type SectionDestructiveRowProps = Omit<SectionRowProps, 'children'> & {\n children: ReactNode;\n};\n\ntype SectionRowLayoutProps = SectionRowProps & {\n tone?: 'default' | 'destructive';\n viewOnly?: boolean;\n};\n\nfunction SectionRowLayout({\n label,\n description,\n htmlFor,\n children,\n className,\n tone = 'default',\n viewOnly = false,\n ...props\n}: SectionRowLayoutProps) {\n const destructive = tone === 'destructive';\n const labelClassName = cn(\n 'text-ui-md leading-ui-md',\n destructive ? 'text-accent2' : viewOnly ? 'text-neutral3' : 'text-neutral5',\n 'group-data-[variant=factory]/section:font-medium group-data-[variant=flat]/section:font-medium',\n );\n\n return (\n <div\n data-slot=\"section-row\"\n className={cn(\n 'grid min-w-0 gap-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center',\n 'sm:group-data-[variant=default]/section:gap-4',\n 'group-data-[variant=flat]/section:p-4 sm:group-data-[variant=flat]/section:gap-8',\n 'group-data-[variant=factory]/section:px-4 group-data-[variant=factory]/section:py-3 sm:group-data-[variant=factory]/section:gap-4',\n className,\n )}\n {...props}\n >\n <div className=\"min-w-0\">\n {htmlFor ? (\n <Label htmlFor={htmlFor} className={labelClassName}>\n {label}\n </Label>\n ) : (\n <p className={labelClassName}>{label}</p>\n )}\n {description != null ? (\n <p className=\"text-ui-md leading-ui-md text-neutral3 mt-1 max-w-[62ch] text-pretty\">{description}</p>\n ) : null}\n </div>\n {children != null ? (\n <div\n data-slot=\"section-control\"\n className={cn('min-w-0 sm:justify-self-end', viewOnly && 'flex items-center gap-2 text-ui-md text-neutral3')}\n >\n {viewOnly ? (\n <>\n <LockKeyholeIcon className=\"size-4 shrink-0\" aria-hidden />\n <span className=\"sr-only\">View only: </span>\n </>\n ) : null}\n {children}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function SectionRow(props: SectionRowProps) {\n return <SectionRowLayout {...props} />;\n}\n\nexport function SectionViewOnlyRow(props: SectionViewOnlyRowProps) {\n return <SectionRowLayout viewOnly {...props} />;\n}\n\nexport function SectionDestructiveRow(props: SectionDestructiveRowProps) {\n return <SectionRowLayout tone=\"destructive\" {...props} />;\n}\n","import { SectionContent } from './section-content';\nimport { SectionDescription } from './section-description';\nimport { SectionDivider } from './section-divider';\nimport { SectionHeader } from './section-header';\nimport { SectionHeaderText } from './section-header-text';\nimport { SectionHeading } from './section-heading';\nimport { SectionRoot, type SectionRootProps } from './section-root';\nimport { SectionDestructiveRow, SectionRow, SectionViewOnlyRow } from './section-row';\n\nexport { type SectionContentProps } from './section-content';\nexport { type SectionDescriptionProps } from './section-description';\nexport { type SectionDividerProps } from './section-divider';\nexport { type SectionHeaderProps } from './section-header';\nexport { type SectionHeaderTextProps } from './section-header-text';\nexport { type SectionHeadingProps } from './section-heading';\nexport { type SectionRootProps as SectionProps, type SectionVariant } from './section-root';\nexport { type SectionDestructiveRowProps, type SectionRowProps, type SectionViewOnlyRowProps } from './section-row';\n\nexport function Section(props: SectionRootProps) {\n return <SectionRoot {...props} />;\n}\n\nSection.Header = SectionHeader;\nSection.HeaderText = SectionHeaderText;\nSection.Heading = SectionHeading;\nSection.Description = SectionDescription;\nSection.Content = SectionContent;\nSection.Row = SectionRow;\nSection.ViewOnlyRow = SectionViewOnlyRow;\nSection.DestructiveRow = SectionDestructiveRow;\nSection.Divider = SectionDivider;\n"],"names":[],"mappings":";;;;;AAKO,SAAS,cAAA,CAAe,EAAE,SAAA,EAAW,GAAG,OAAM,EAAwB;AAC3E,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,iBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,uPAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;;ACXO,SAAS,kBAAA,CAAmB,EAAE,SAAA,EAAW,GAAG,OAAM,EAA4B;AACnF,EAAA,uBACE,GAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,iEAAA,EAAmE,SAAS,CAAA;AAAA,MACzF,GAAG;AAAA;AAAA,GACN;AAEJ;;ACRO,SAAS,cAAA,CAAe,EAAE,SAAA,EAAW,GAAG,OAAM,EAAwB;AAC3E,EAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAI,IAAA,EAAK,WAAA,EAAY,kBAAA,EAAiB,YAAA,EAAa,SAAA,EAAW,EAAA,CAAG,iBAAA,EAAmB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AACrH;;ACAO,SAAS,aAAA,CAAc,EAAE,QAAA,EAAU,SAAA,EAAW,QAAQ,KAAA,EAAO,GAAG,OAAM,EAAuB;AAClG,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,gBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,uJAAA;AAAA,QACA,2YAAA;AAAA,QACA,4XAAA;AAAA,QACA,KAAA,IAAS,MAAA;AAAA,QACT;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MA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zB,OAAA,CAAQ,OAAA,GAAU,cAAA;;;;"}
|
|
@@ -22,6 +22,7 @@ type ComboboxSharedProps = {
|
|
|
22
22
|
onOpenChange?: (open: boolean) => void;
|
|
23
23
|
container?: HTMLElement | ShadowRoot | null | React.RefObject<HTMLElement | ShadowRoot | null>;
|
|
24
24
|
error?: string;
|
|
25
|
+
allowCustomValue?: boolean;
|
|
25
26
|
};
|
|
26
27
|
export type ComboboxSingleProps = ComboboxSharedProps & {
|
|
27
28
|
multiple?: false;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
-
export type SectionHeaderProps = ComponentProps<'header'
|
|
3
|
-
|
|
2
|
+
export type SectionHeaderProps = ComponentProps<'header'> & {
|
|
3
|
+
inset?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare function SectionHeader({ children, className, inset, ...props }: SectionHeaderProps): import("react").JSX.Element;
|
|
@@ -1,8 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { SectionVariant } from './section';
|
|
3
|
+
type SectionPlaygroundProps = {
|
|
4
|
+
variant: SectionVariant;
|
|
5
|
+
inset: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function SectionPlayground({ variant, inset }: SectionPlaygroundProps): import("react").JSX.Element;
|
|
8
|
+
declare const meta: {
|
|
9
|
+
title: string;
|
|
10
|
+
component: typeof SectionPlayground;
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: string;
|
|
13
|
+
};
|
|
14
|
+
args: {
|
|
15
|
+
variant: "factory";
|
|
16
|
+
inset: false;
|
|
17
|
+
};
|
|
18
|
+
argTypes: {
|
|
19
|
+
variant: {
|
|
20
|
+
control: "select";
|
|
21
|
+
options: string[];
|
|
22
|
+
};
|
|
23
|
+
inset: {
|
|
24
|
+
control: "boolean";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
4
28
|
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof
|
|
29
|
+
type Story = StoryObj<typeof meta>;
|
|
30
|
+
export declare const Playground: Story;
|
|
6
31
|
export declare const Default: Story;
|
|
7
32
|
export declare const WithAction: Story;
|
|
8
33
|
export declare const ConfigurationSection: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SettingsLayout, type SettingsLayoutProps } from './settings-layout';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SettingsLayoutProps {
|
|
3
|
+
title?: ReactNode;
|
|
4
|
+
action?: ReactNode;
|
|
5
|
+
inset?: boolean;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function SettingsLayout({ title, action, inset, children }: SettingsLayoutProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { SectionVariant } from '../Section';
|
|
3
|
+
type SettingsLayoutStoryProps = {
|
|
4
|
+
title: string;
|
|
5
|
+
inset: boolean;
|
|
6
|
+
sectionVariant: SectionVariant;
|
|
7
|
+
showAction: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare function SettingsLayoutStory({ title, inset, sectionVariant, showAction }: SettingsLayoutStoryProps): import("react").JSX.Element;
|
|
10
|
+
declare const meta: {
|
|
11
|
+
title: string;
|
|
12
|
+
component: typeof SettingsLayoutStory;
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: string;
|
|
15
|
+
};
|
|
16
|
+
args: {
|
|
17
|
+
title: string;
|
|
18
|
+
inset: false;
|
|
19
|
+
sectionVariant: "factory";
|
|
20
|
+
showAction: false;
|
|
21
|
+
};
|
|
22
|
+
argTypes: {
|
|
23
|
+
title: {
|
|
24
|
+
control: "text";
|
|
25
|
+
};
|
|
26
|
+
inset: {
|
|
27
|
+
control: "boolean";
|
|
28
|
+
};
|
|
29
|
+
sectionVariant: {
|
|
30
|
+
control: "select";
|
|
31
|
+
options: string[];
|
|
32
|
+
};
|
|
33
|
+
showAction: {
|
|
34
|
+
control: "boolean";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export default meta;
|
|
39
|
+
type Story = StoryObj<typeof meta>;
|
|
40
|
+
export declare const Default: Story;
|
|
41
|
+
export declare const InsetWithAction: Story;
|
package/dist/style.css
CHANGED
|
@@ -155,6 +155,7 @@
|
|
|
155
155
|
--container-xl: 36rem;
|
|
156
156
|
--container-2xl: 42rem;
|
|
157
157
|
--container-3xl: 48rem;
|
|
158
|
+
--container-5xl: 64rem;
|
|
158
159
|
--container-6xl: 72rem;
|
|
159
160
|
--container-7xl: 80rem;
|
|
160
161
|
--text-xs: .75rem;
|
|
@@ -2681,6 +2682,10 @@
|
|
|
2681
2682
|
max-width: var(--spacing-4);
|
|
2682
2683
|
}
|
|
2683
2684
|
|
|
2685
|
+
.max-w-5xl {
|
|
2686
|
+
max-width: var(--container-5xl);
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2684
2689
|
.max-w-6xl {
|
|
2685
2690
|
max-width: var(--container-6xl);
|
|
2686
2691
|
}
|
|
@@ -3537,6 +3542,12 @@
|
|
|
3537
3542
|
margin-block-end: calc(var(--spacing-8) * calc(1 - var(--tw-space-y-reverse)));
|
|
3538
3543
|
}
|
|
3539
3544
|
|
|
3545
|
+
:where(.space-y-14 > :not(:last-child)) {
|
|
3546
|
+
--tw-space-y-reverse: 0;
|
|
3547
|
+
margin-block-start: calc(var(--spacing-14) * var(--tw-space-y-reverse));
|
|
3548
|
+
margin-block-end: calc(var(--spacing-14) * calc(1 - var(--tw-space-y-reverse)));
|
|
3549
|
+
}
|
|
3550
|
+
|
|
3540
3551
|
.gap-x-3 {
|
|
3541
3552
|
column-gap: var(--spacing-3);
|
|
3542
3553
|
}
|
|
@@ -7001,10 +7012,6 @@
|
|
|
7001
7012
|
padding: var(--spacing-4);
|
|
7002
7013
|
}
|
|
7003
7014
|
|
|
7004
|
-
.group-data-\[variant\=flat\]\/section\:px-4:is(:where(.group\/section)[data-variant="flat"] *) {
|
|
7005
|
-
padding-inline: var(--spacing-4);
|
|
7006
|
-
}
|
|
7007
|
-
|
|
7008
7015
|
.group-data-\[variant\=flat\]\/section\:pb-4:is(:where(.group\/section)[data-variant="flat"] *) {
|
|
7009
7016
|
padding-bottom: var(--spacing-4);
|
|
7010
7017
|
}
|
|
@@ -9361,6 +9368,14 @@
|
|
|
9361
9368
|
padding-inline: var(--spacing-4);
|
|
9362
9369
|
}
|
|
9363
9370
|
|
|
9371
|
+
.sm\:px-6 {
|
|
9372
|
+
padding-inline: var(--spacing-6);
|
|
9373
|
+
}
|
|
9374
|
+
|
|
9375
|
+
.sm\:py-8 {
|
|
9376
|
+
padding-block: var(--spacing-8);
|
|
9377
|
+
}
|
|
9378
|
+
|
|
9364
9379
|
.sm\:pt-5 {
|
|
9365
9380
|
padding-top: var(--spacing-5);
|
|
9366
9381
|
}
|
|
@@ -9369,6 +9384,10 @@
|
|
|
9369
9384
|
padding-top: var(--spacing-7);
|
|
9370
9385
|
}
|
|
9371
9386
|
|
|
9387
|
+
.sm\:pt-12 {
|
|
9388
|
+
padding-top: var(--spacing-12);
|
|
9389
|
+
}
|
|
9390
|
+
|
|
9372
9391
|
.sm\:pb-3 {
|
|
9373
9392
|
padding-bottom: var(--spacing-3);
|
|
9374
9393
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/playground-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "53.0.0-alpha.
|
|
4
|
+
"version": "53.0.0-alpha.5",
|
|
5
5
|
"description": "Mastra Playground components",
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.css"
|
|
@@ -160,8 +160,8 @@
|
|
|
160
160
|
"react": ">=19.0.0",
|
|
161
161
|
"react-dom": ">=19.0.0",
|
|
162
162
|
"tailwindcss": "^4.0.0",
|
|
163
|
-
"@mastra/client-js": "^1.44.0-alpha.
|
|
164
|
-
"@mastra/react": "1.4.11-alpha.
|
|
163
|
+
"@mastra/client-js": "^1.44.0-alpha.5",
|
|
164
|
+
"@mastra/react": "1.4.11-alpha.5"
|
|
165
165
|
},
|
|
166
166
|
"devDependencies": {
|
|
167
167
|
"@storybook/addon-a11y": "^10.4.1",
|
|
@@ -203,10 +203,10 @@
|
|
|
203
203
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
204
204
|
"vitest": "4.1.10",
|
|
205
205
|
"@internal/lint": "0.0.130",
|
|
206
|
-
"@mastra/
|
|
206
|
+
"@mastra/core": "1.65.0-alpha.5",
|
|
207
|
+
"@mastra/react": "1.4.11-alpha.5",
|
|
207
208
|
"@mastra/memory": "1.28.3-alpha.2",
|
|
208
|
-
"@mastra/
|
|
209
|
-
"@mastra/core": "1.65.0-alpha.4"
|
|
209
|
+
"@mastra/client-js": "^1.44.0-alpha.5"
|
|
210
210
|
},
|
|
211
211
|
"homepage": "https://mastra.ai",
|
|
212
212
|
"repository": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-BNAe7hQL.cjs","sources":["../src/ds/components/Combobox/combobox-styles.ts","../src/ds/components/Combobox/combobox.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport { buttonVariants } from '../Button/Button';\nimport type { TextButtonSize } from '../Button/Button';\nimport { controlTriggerOpenState } from '@/ds/primitives/control-size';\nimport type { ControlTriggerVisualVariant } from '@/ds/primitives/control-size';\nimport { transitions } from '@/ds/primitives/transitions';\nimport { cn } from '@/lib/utils';\n\n/**\n * A combobox is a form field, so it reuses the same button looks as everywhere,\n * mirroring `SelectTrigger`: `default` (the Button's filled default surface —\n * the default here too), `outline` (bordered, transparent) and `ghost`\n * (borderless, for breadcrumbs/inline pickers). Only the high-emphasis `primary`\n * look is intentionally NOT offered (a field is not a call-to-action).\n */\nexport type ComboboxVisualVariant = ControlTriggerVisualVariant;\nexport type ComboboxLegacyVariant = 'link';\nexport type ComboboxVariant = ComboboxVisualVariant | ComboboxLegacyVariant;\n\nfunction normalizeComboboxVariant(variant: ComboboxVariant): ComboboxVisualVariant {\n return variant === 'link' ? 'ghost' : variant;\n}\n\n/**\n * Single source of truth for both the single- and multi-select combobox\n * triggers. A combobox = a button + a trailing chevron, so it reuses the Button\n * recipe (variant colors, size = height/text/padding/radius, unified border\n * focus, disabled) and layers only the combobox-specific extras — exactly like\n * `SelectTrigger`.\n */\nexport function comboboxTriggerClass({\n variant,\n size,\n error,\n className,\n}: {\n variant: ComboboxVariant;\n size: TextButtonSize;\n error?: boolean;\n className?: string;\n}): string {\n const visualVariant = normalizeComboboxVariant(variant);\n\n return cn(\n buttonVariants({ variant: visualVariant, size }),\n // Fill the field and push the value left / chevron right (Button's base\n // centers its content with `justify-center`).\n 'w-full min-w-32 justify-between',\n // Read as \"active\" while the popup is open, per variant (see map above).\n controlTriggerOpenState[visualVariant],\n 'data-[placeholder]:text-neutral3',\n error && 'border-error hover:border-error focus-visible:border-error',\n className,\n );\n}\n\nexport const comboboxItemClass = cva(\n cn(\n 'relative flex cursor-pointer items-center rounded-md select-none',\n 'min-h-8 py-1.5',\n 'text-ui-smd leading-ui-sm text-neutral4',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n 'data-highlighted:bg-surface4 data-highlighted:text-neutral6',\n 'data-selected:text-neutral6',\n ),\n {\n variants: {\n multiple: {\n false: 'gap-2 pr-2 pl-2.5',\n true: 'gap-2 pr-2 pl-2.5',\n },\n },\n defaultVariants: {\n multiple: false,\n },\n },\n);\n\nexport const comboboxStyles = {\n /** Root wrapper */\n root: 'flex flex-col gap-1.5',\n\n /** Chevron icon in trigger — inherits the variant's text color via currentColor. */\n chevron: 'ml-2 h-4 w-4 shrink-0 opacity-60',\n\n /** Placeholder text color */\n placeholder: 'text-neutral3',\n\n /** Popup container — concentric with rounded-xl + p-1 (8px items inside 12px container). */\n popup: cn(\n 'w-max max-w-(--available-width) min-w-(--anchor-width) rounded-xl border border-border1 bg-surface3 text-neutral4',\n 'shadow-dialog',\n 'origin-(--transform-origin)',\n 'transition-[transform,scale,opacity] duration-150 ease-out',\n 'data-starting-style:scale-95 data-starting-style:opacity-0',\n 'data-ending-style:scale-95 data-ending-style:opacity-0',\n ),\n\n /** Positioner */\n positioner: 'z-50 pointer-events-auto',\n\n /** Search input container — borderless top section, hairline divider below. */\n searchContainer: cn('flex items-center border-b border-border1 px-2.5 py-1.5', transitions.colors),\n\n /** Search icon */\n searchIcon: cn('mr-2 size-3.5 shrink-0 text-neutral3', transitions.colors),\n\n /** Search input */\n searchInput: cn(\n 'flex h-7 w-full rounded-md bg-transparent py-1 text-ui-smd leading-ui-sm text-neutral6',\n 'placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n ),\n\n /** Empty state */\n empty: 'not-empty:block hidden py-4 text-center text-ui-smd text-neutral3',\n\n /** Options list */\n list: 'max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1',\n\n /** Option item base — rounded-md sits concentrically inside rounded-xl + p-1. */\n item: comboboxItemClass({ multiple: false }),\n\n /** Multi-select item — same item rhythm with a right-aligned selected check. */\n itemMulti: comboboxItemClass({ multiple: true }),\n\n /** Right-aligned slot grouping end content + selection check. */\n itemRightSlot: 'ml-auto flex items-center gap-2 shrink-0',\n\n /** Check indicator container — inline, fixed 16x16, shown only when item is selected. */\n checkContainer: 'flex h-4 w-4 shrink-0 items-center justify-center text-neutral6',\n\n /** Check icon (single select) */\n checkIcon: 'h-3.5 w-3.5',\n\n /** Option label/description wrapper */\n optionText: 'flex flex-col gap-0.5 min-w-0',\n\n /** Option label */\n optionLabel: 'truncate',\n\n /** Option description */\n optionDescription: 'text-ui-sm text-neutral3 truncate',\n\n /** Option end slot — `ml-auto` makes it push right inside flex containers (used by multi-select). */\n optionEnd: 'ml-auto flex items-center shrink-0',\n\n /** Error message */\n error: 'text-ui-sm text-accent2',\n} as const;\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { Check, ChevronsUpDown, Search } from 'lucide-react';\nimport * as React from 'react';\nimport { comboboxItemClass, comboboxStyles, comboboxTriggerClass } from './combobox-styles';\nimport type { ComboboxVariant } from './combobox-styles';\nimport type { TextButtonSize } from '@/ds/components/Button/Button';\nimport { FLOATING_POSITION_METHOD } from '@/ds/primitives/floating';\nimport { usePortalContainer } from '@/ds/primitives/portal-container';\nimport { cn } from '@/lib/utils';\n\nexport type { ComboboxVariant } from './combobox-styles';\n\nexport type ComboboxOption = {\n label: string;\n value: string;\n description?: string;\n start?: React.ReactNode;\n end?: React.ReactNode;\n};\n\ntype ComboboxSharedProps = {\n options: ComboboxOption[];\n placeholder?: string;\n searchPlaceholder?: string;\n emptyText?: string;\n className?: string;\n disabled?: boolean;\n variant?: ComboboxVariant;\n size?: TextButtonSize;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n container?: HTMLElement | ShadowRoot | null | React.RefObject<HTMLElement | ShadowRoot | null>;\n error?: string;\n};\n\nexport type ComboboxSingleProps = ComboboxSharedProps & {\n multiple?: false;\n value?: string;\n onValueChange?: (value: string) => void;\n};\n\nexport type ComboboxMultipleProps = ComboboxSharedProps & {\n multiple: true;\n value?: readonly string[];\n onValueChange?: (value: string[]) => void;\n};\n\nexport type ComboboxProps = ComboboxSingleProps | ComboboxMultipleProps;\n\nconst EMPTY_VALUES: string[] = [];\nconst EMPTY_OPTIONS: ComboboxOption[] = [];\n\nfunction isMultipleCombobox(props: ComboboxProps): props is ComboboxMultipleProps {\n return props.multiple === true;\n}\n\nfunction ComboboxOptionText({ option }: { option: ComboboxOption }) {\n return (\n <span className={comboboxStyles.optionText}>\n <span className={comboboxStyles.optionLabel}>{option.label}</span>\n {option.description && <span className={comboboxStyles.optionDescription}>{option.description}</span>}\n </span>\n );\n}\n\nexport function Combobox(props: ComboboxProps) {\n const {\n options,\n placeholder = isMultipleCombobox(props) ? 'Select options...' : 'Select option...',\n searchPlaceholder = 'Search...',\n emptyText = 'No option found.',\n className,\n disabled = false,\n variant = 'default',\n size = 'md',\n open,\n onOpenChange,\n container,\n error,\n } = props;\n const multiple = isMultipleCombobox(props);\n const selectedValues = multiple ? (props.value ?? EMPTY_VALUES) : EMPTY_VALUES;\n const selectedValueSet = React.useMemo(() => new Set(selectedValues), [selectedValues]);\n const selectedOption = multiple ? null : (options.find(option => option.value === props.value) ?? null);\n const selectedOptions = multiple ? options.filter(option => selectedValueSet.has(option.value)) : EMPTY_OPTIONS;\n const triggerText = selectedOptions.length === 0 ? placeholder : `${selectedOptions.length} selected`;\n // Default to the nearest SideDialog/Drawer popup so the list stays\n // interactive inside a modal drawer; an explicit `container` still wins.\n const resolvedContainer = usePortalContainer(container);\n\n const comboboxContent = (\n <>\n <BaseCombobox.Trigger className={comboboxTriggerClass({ variant, size, error: Boolean(error), className })}>\n {multiple ? (\n <span className={cn('truncate', selectedOptions.length === 0 && comboboxStyles.placeholder)}>\n {triggerText}\n </span>\n ) : (\n // Keep truncation off the outer wrapper so start adornments are not clipped.\n <span className=\"flex min-w-0 flex-1 items-center gap-2\">\n {selectedOption?.start}\n <span className=\"truncate\">\n <BaseCombobox.Value placeholder={placeholder} />\n </span>\n </span>\n )}\n {/* Wrap the chevron in a `<span>` so the svg is one level deep and\n escapes Button's `[&>svg]` adornments — mirrors Select's chevron wrap. */}\n <span className=\"flex shrink-0 items-center\">\n <ChevronsUpDown className={comboboxStyles.chevron} />\n </span>\n </BaseCombobox.Trigger>\n\n <BaseCombobox.Portal container={resolvedContainer}>\n <BaseCombobox.Positioner\n align=\"start\"\n sideOffset={4}\n positionMethod={FLOATING_POSITION_METHOD}\n className={comboboxStyles.positioner}\n >\n <BaseCombobox.Popup className={comboboxStyles.popup}>\n <div className={comboboxStyles.searchContainer}>\n <Search className={comboboxStyles.searchIcon} />\n <BaseCombobox.Input className={comboboxStyles.searchInput} placeholder={searchPlaceholder} />\n </div>\n <BaseCombobox.Empty className={comboboxStyles.empty}>{emptyText}</BaseCombobox.Empty>\n <BaseCombobox.List className={comboboxStyles.list}>\n {(option: ComboboxOption) => {\n const isSelected = selectedValueSet.has(option.value);\n\n return (\n <BaseCombobox.Item key={option.value} value={option} className={comboboxItemClass({ multiple })}>\n {multiple ? (\n <>\n {option.start}\n <ComboboxOptionText option={option} />\n <span className={comboboxStyles.itemRightSlot}>\n {option.end ? <div className={comboboxStyles.optionEnd}>{option.end}</div> : null}\n <span className={comboboxStyles.checkContainer}>\n {isSelected ? <Check className={comboboxStyles.checkIcon} /> : null}\n </span>\n </span>\n </>\n ) : (\n <>\n {option.start}\n <ComboboxOptionText option={option} />\n <span className={comboboxStyles.itemRightSlot}>\n {option.end ? <div className={comboboxStyles.optionEnd}>{option.end}</div> : null}\n <span className={comboboxStyles.checkContainer}>\n <BaseCombobox.ItemIndicator>\n <Check className={comboboxStyles.checkIcon} />\n </BaseCombobox.ItemIndicator>\n </span>\n </span>\n </>\n )}\n </BaseCombobox.Item>\n );\n }}\n </BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </>\n );\n\n if (multiple) {\n return (\n <div className={comboboxStyles.root}>\n <BaseCombobox.Root\n multiple\n autoHighlight\n items={options}\n value={selectedOptions}\n onValueChange={items => props.onValueChange?.((items ?? []).map(item => item.value))}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n {comboboxContent}\n </BaseCombobox.Root>\n {error && <span className={comboboxStyles.error}>{error}</span>}\n </div>\n );\n }\n\n return (\n <div className={comboboxStyles.root}>\n <BaseCombobox.Root\n autoHighlight\n items={options}\n value={selectedOption}\n onValueChange={item => {\n if (item) {\n props.onValueChange?.(item.value);\n }\n }}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n {comboboxContent}\n </BaseCombobox.Root>\n {error && <span className={comboboxStyles.error}>{error}</span>}\n </div>\n );\n}\n"],"names":["cn","buttonVariants","controlTriggerOpenState","cva","transitions","jsxs","jsx","React","usePortalContainer","Fragment","BaseCombobox","ChevronsUpDown","FLOATING_POSITION_METHOD","Search","Check"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,SAAS,yBAAyB,OAAA,EAAiD;AACjF,EAAA,OAAO,OAAA,KAAY,SAAS,OAAA,GAAU,OAAA;AACxC;AASO,SAAS,oBAAA,CAAqB;AAAA,EACnC,OAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,EAKW;AACT,EAAA,MAAM,aAAA,GAAgB,yBAAyB,OAAO,CAAA;AAEtD,EAAA,OAAOA,WAAA;AAAA,IACLC,qBAAA,CAAe,EAAE,OAAA,EAAS,aAAA,EAAe,MAAM,CAAA;AAAA;AAAA;AAAA,IAG/C,iCAAA;AAAA;AAAA,IAEAC,+CAAwB,aAAa,CAAA;AAAA,IACrC,kCAAA;AAAA,IACA,KAAA,IAAS,4DAAA;AAAA,IACT;AAAA,GACF;AACF;AAEO,MAAM,iBAAA,GAAoBC,SAAA;AAAA,EAC/BH,WAAA;AAAA,IACE,kEAAA;AAAA,IACA,gBAAA;AAAA,IACA,yCAAA;AAAA,IACA,4DAAA;AAAA,IACAI,kCAAA,CAAY,MAAA;AAAA,IACZ,6DAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,QAAA,EAAU;AAAA,QACR,KAAA,EAAO,mBAAA;AAAA,QACP,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,QAAA,EAAU;AAAA;AACZ;AAEJ,CAAA;AAEO,MAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,IAAA,EAAM,uBAAA;AAAA;AAAA,EAGN,OAAA,EAAS,kCAAA;AAAA;AAAA,EAGT,WAAA,EAAa,eAAA;AAAA;AAAA,EAGb,KAAA,EAAOJ,WAAA;AAAA,IACL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.ts","../src/ds/components/Combobox/combobox.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport { buttonVariants } from '../Button/Button';\nimport type { TextButtonSize } from '../Button/Button';\nimport { controlTriggerOpenState } from '@/ds/primitives/control-size';\nimport type { ControlTriggerVisualVariant } from '@/ds/primitives/control-size';\nimport { transitions } from '@/ds/primitives/transitions';\nimport { cn } from '@/lib/utils';\n\n/**\n * A combobox is a form field, so it reuses the same button looks as everywhere,\n * mirroring `SelectTrigger`: `default` (the Button's filled default surface —\n * the default here too), `outline` (bordered, transparent) and `ghost`\n * (borderless, for breadcrumbs/inline pickers). Only the high-emphasis `primary`\n * look is intentionally NOT offered (a field is not a call-to-action).\n */\nexport type ComboboxVisualVariant = ControlTriggerVisualVariant;\nexport type ComboboxLegacyVariant = 'link';\nexport type ComboboxVariant = ComboboxVisualVariant | ComboboxLegacyVariant;\n\nfunction normalizeComboboxVariant(variant: ComboboxVariant): ComboboxVisualVariant {\n return variant === 'link' ? 'ghost' : variant;\n}\n\n/**\n * Single source of truth for both the single- and multi-select combobox\n * triggers. A combobox = a button + a trailing chevron, so it reuses the Button\n * recipe (variant colors, size = height/text/padding/radius, unified border\n * focus, disabled) and layers only the combobox-specific extras — exactly like\n * `SelectTrigger`.\n */\nexport function comboboxTriggerClass({\n variant,\n size,\n error,\n className,\n}: {\n variant: ComboboxVariant;\n size: TextButtonSize;\n error?: boolean;\n className?: string;\n}): string {\n const visualVariant = normalizeComboboxVariant(variant);\n\n return cn(\n buttonVariants({ variant: visualVariant, size }),\n // Fill the field and push the value left / chevron right (Button's base\n // centers its content with `justify-center`).\n 'w-full min-w-32 justify-between',\n // Read as \"active\" while the popup is open, per variant (see map above).\n controlTriggerOpenState[visualVariant],\n 'data-[placeholder]:text-neutral3',\n error && 'border-error hover:border-error focus-visible:border-error',\n className,\n );\n}\n\nexport const comboboxItemClass = cva(\n cn(\n 'relative flex cursor-pointer items-center rounded-md select-none',\n 'min-h-8 py-1.5',\n 'text-ui-smd leading-ui-sm text-neutral4',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n 'data-highlighted:bg-surface4 data-highlighted:text-neutral6',\n 'data-selected:text-neutral6',\n ),\n {\n variants: {\n multiple: {\n false: 'gap-2 pr-2 pl-2.5',\n true: 'gap-2 pr-2 pl-2.5',\n },\n },\n defaultVariants: {\n multiple: false,\n },\n },\n);\n\nexport const comboboxStyles = {\n /** Root wrapper */\n root: 'flex flex-col gap-1.5',\n\n /** Chevron icon in trigger — inherits the variant's text color via currentColor. */\n chevron: 'ml-2 h-4 w-4 shrink-0 opacity-60',\n\n /** Placeholder text color */\n placeholder: 'text-neutral3',\n\n /** Popup container — concentric with rounded-xl + p-1 (8px items inside 12px container). */\n popup: cn(\n 'w-max max-w-(--available-width) min-w-(--anchor-width) rounded-xl border border-border1 bg-surface3 text-neutral4',\n 'shadow-dialog',\n 'origin-(--transform-origin)',\n 'transition-[transform,scale,opacity] duration-150 ease-out',\n 'data-starting-style:scale-95 data-starting-style:opacity-0',\n 'data-ending-style:scale-95 data-ending-style:opacity-0',\n ),\n\n /** Positioner */\n positioner: 'z-50 pointer-events-auto',\n\n /** Search input container — borderless top section, hairline divider below. */\n searchContainer: cn('flex items-center border-b border-border1 px-2.5 py-1.5', transitions.colors),\n\n /** Search icon */\n searchIcon: cn('mr-2 size-3.5 shrink-0 text-neutral3', transitions.colors),\n\n /** Search input */\n searchInput: cn(\n 'flex h-7 w-full rounded-md bg-transparent py-1 text-ui-smd leading-ui-sm text-neutral6',\n 'placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50',\n 'outline-none focus:outline-none focus-visible:outline-none',\n transitions.colors,\n ),\n\n /** Empty state */\n empty: 'not-empty:block hidden py-4 text-center text-ui-smd text-neutral3',\n\n /** Options list */\n list: 'max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1',\n\n /** Option item base — rounded-md sits concentrically inside rounded-xl + p-1. */\n item: comboboxItemClass({ multiple: false }),\n\n /** Multi-select item — same item rhythm with a right-aligned selected check. */\n itemMulti: comboboxItemClass({ multiple: true }),\n\n /** Right-aligned slot grouping end content + selection check. */\n itemRightSlot: 'ml-auto flex items-center gap-2 shrink-0',\n\n /** Check indicator container — inline, fixed 16x16, shown only when item is selected. */\n checkContainer: 'flex h-4 w-4 shrink-0 items-center justify-center text-neutral6',\n\n /** Check icon (single select) */\n checkIcon: 'h-3.5 w-3.5',\n\n /** Option label/description wrapper */\n optionText: 'flex flex-col gap-0.5 min-w-0',\n\n /** Option label */\n optionLabel: 'truncate',\n\n /** Option description */\n optionDescription: 'text-ui-sm text-neutral3 truncate',\n\n /** Option end slot — `ml-auto` makes it push right inside flex containers (used by multi-select). */\n optionEnd: 'ml-auto flex items-center shrink-0',\n\n /** Error message */\n error: 'text-ui-sm text-accent2',\n} as const;\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { Check, ChevronsUpDown, Search } from 'lucide-react';\nimport * as React from 'react';\nimport { comboboxItemClass, comboboxStyles, comboboxTriggerClass } from './combobox-styles';\nimport type { ComboboxVariant } from './combobox-styles';\nimport type { TextButtonSize } from '@/ds/components/Button/Button';\nimport { FLOATING_POSITION_METHOD } from '@/ds/primitives/floating';\nimport { usePortalContainer } from '@/ds/primitives/portal-container';\nimport { cn } from '@/lib/utils';\n\nexport type { ComboboxVariant } from './combobox-styles';\n\nexport type ComboboxOption = {\n label: string;\n value: string;\n description?: string;\n start?: React.ReactNode;\n end?: React.ReactNode;\n};\n\ntype ComboboxSharedProps = {\n options: ComboboxOption[];\n placeholder?: string;\n searchPlaceholder?: string;\n emptyText?: string;\n className?: string;\n disabled?: boolean;\n variant?: ComboboxVariant;\n size?: TextButtonSize;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n container?: HTMLElement | ShadowRoot | null | React.RefObject<HTMLElement | ShadowRoot | null>;\n error?: string;\n};\n\nexport type ComboboxSingleProps = ComboboxSharedProps & {\n multiple?: false;\n value?: string;\n onValueChange?: (value: string) => void;\n};\n\nexport type ComboboxMultipleProps = ComboboxSharedProps & {\n multiple: true;\n value?: readonly string[];\n onValueChange?: (value: string[]) => void;\n};\n\nexport type ComboboxProps = ComboboxSingleProps | ComboboxMultipleProps;\n\nconst EMPTY_VALUES: string[] = [];\nconst EMPTY_OPTIONS: ComboboxOption[] = [];\n\nfunction isMultipleCombobox(props: ComboboxProps): props is ComboboxMultipleProps {\n return props.multiple === true;\n}\n\nfunction ComboboxOptionText({ option }: { option: ComboboxOption }) {\n return (\n <span className={comboboxStyles.optionText}>\n <span className={comboboxStyles.optionLabel}>{option.label}</span>\n {option.description && <span className={comboboxStyles.optionDescription}>{option.description}</span>}\n </span>\n );\n}\n\nexport function Combobox(props: ComboboxProps) {\n const {\n options,\n placeholder = isMultipleCombobox(props) ? 'Select options...' : 'Select option...',\n searchPlaceholder = 'Search...',\n emptyText = 'No option found.',\n className,\n disabled = false,\n variant = 'default',\n size = 'md',\n open,\n onOpenChange,\n container,\n error,\n } = props;\n const multiple = isMultipleCombobox(props);\n const selectedValues = multiple ? (props.value ?? EMPTY_VALUES) : EMPTY_VALUES;\n const selectedValueSet = React.useMemo(() => new Set(selectedValues), [selectedValues]);\n const selectedOption = multiple ? null : (options.find(option => option.value === props.value) ?? null);\n const selectedOptions = multiple ? options.filter(option => selectedValueSet.has(option.value)) : EMPTY_OPTIONS;\n const triggerText = selectedOptions.length === 0 ? placeholder : `${selectedOptions.length} selected`;\n // Default to the nearest SideDialog/Drawer popup so the list stays\n // interactive inside a modal drawer; an explicit `container` still wins.\n const resolvedContainer = usePortalContainer(container);\n\n const comboboxContent = (\n <>\n <BaseCombobox.Trigger className={comboboxTriggerClass({ variant, size, error: Boolean(error), className })}>\n {multiple ? (\n <span className={cn('truncate', selectedOptions.length === 0 && comboboxStyles.placeholder)}>\n {triggerText}\n </span>\n ) : (\n // Keep truncation off the outer wrapper so start adornments are not clipped.\n <span className=\"flex min-w-0 flex-1 items-center gap-2\">\n {selectedOption?.start}\n <span className=\"truncate\">\n <BaseCombobox.Value placeholder={placeholder} />\n </span>\n </span>\n )}\n {/* Wrap the chevron in a `<span>` so the svg is one level deep and\n escapes Button's `[&>svg]` adornments — mirrors Select's chevron wrap. */}\n <span className=\"flex shrink-0 items-center\">\n <ChevronsUpDown className={comboboxStyles.chevron} />\n </span>\n </BaseCombobox.Trigger>\n\n <BaseCombobox.Portal container={resolvedContainer}>\n <BaseCombobox.Positioner\n align=\"start\"\n sideOffset={4}\n positionMethod={FLOATING_POSITION_METHOD}\n className={comboboxStyles.positioner}\n >\n <BaseCombobox.Popup className={comboboxStyles.popup}>\n <div className={comboboxStyles.searchContainer}>\n <Search className={comboboxStyles.searchIcon} />\n <BaseCombobox.Input className={comboboxStyles.searchInput} placeholder={searchPlaceholder} />\n </div>\n <BaseCombobox.Empty className={comboboxStyles.empty}>{emptyText}</BaseCombobox.Empty>\n <BaseCombobox.List className={comboboxStyles.list}>\n {(option: ComboboxOption) => {\n const isSelected = selectedValueSet.has(option.value);\n\n return (\n <BaseCombobox.Item key={option.value} value={option} className={comboboxItemClass({ multiple })}>\n {multiple ? (\n <>\n {option.start}\n <ComboboxOptionText option={option} />\n <span className={comboboxStyles.itemRightSlot}>\n {option.end ? <div className={comboboxStyles.optionEnd}>{option.end}</div> : null}\n <span className={comboboxStyles.checkContainer}>\n {isSelected ? <Check className={comboboxStyles.checkIcon} /> : null}\n </span>\n </span>\n </>\n ) : (\n <>\n {option.start}\n <ComboboxOptionText option={option} />\n <span className={comboboxStyles.itemRightSlot}>\n {option.end ? <div className={comboboxStyles.optionEnd}>{option.end}</div> : null}\n <span className={comboboxStyles.checkContainer}>\n <BaseCombobox.ItemIndicator>\n <Check className={comboboxStyles.checkIcon} />\n </BaseCombobox.ItemIndicator>\n </span>\n </span>\n </>\n )}\n </BaseCombobox.Item>\n );\n }}\n </BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </>\n );\n\n if (multiple) {\n return (\n <div className={comboboxStyles.root}>\n <BaseCombobox.Root\n multiple\n autoHighlight\n items={options}\n value={selectedOptions}\n onValueChange={items => props.onValueChange?.((items ?? []).map(item => item.value))}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n {comboboxContent}\n </BaseCombobox.Root>\n {error && <span className={comboboxStyles.error}>{error}</span>}\n </div>\n );\n }\n\n return (\n <div className={comboboxStyles.root}>\n <BaseCombobox.Root\n autoHighlight\n items={options}\n value={selectedOption}\n onValueChange={item => {\n if (item) {\n props.onValueChange?.(item.value);\n }\n }}\n disabled={disabled}\n open={open}\n onOpenChange={onOpenChange}\n >\n {comboboxContent}\n </BaseCombobox.Root>\n {error && <span className={comboboxStyles.error}>{error}</span>}\n </div>\n );\n}\n"],"names":["BaseCombobox"],"mappings":";;;;;;;;;;;;AAmBA,SAAS,yBAAyB,OAAA,EAAiD;AACjF,EAAA,OAAO,OAAA,KAAY,SAAS,OAAA,GAAU,OAAA;AACxC;AASO,SAAS,oBAAA,CAAqB;AAAA,EACnC,OAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,EAKW;AACT,EAAA,MAAM,aAAA,GAAgB,yBAAyB,OAAO,CAAA;AAEtD,EAAA,OAAO,EAAA;AAAA,IACL,cAAA,CAAe,EAAE,OAAA,EAAS,aAAA,EAAe,MAAM,CAAA;AAAA;AAAA;AAAA,IAG/C,iCAAA;AAAA;AAAA,IAEA,wBAAwB,aAAa,CAAA;AAAA,IACrC,kCAAA;AAAA,IACA,KAAA,IAAS,4DAAA;AAAA,IACT;AAAA,GACF;AACF;AAEO,MAAM,iBAAA,GAAoB,GAAA;AAAA,EAC/B,EAAA;AAAA,IACE,kEAAA;AAAA,IACA,gBAAA;AAAA,IACA,yCAAA;AAAA,IACA,4DAAA;AAAA,IACA,WAAA,CAAY,MAAA;AAAA,IACZ,6DAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,QAAA,EAA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AA,IACC,yBAAS,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,cAAA,CAAe,OAAQ,QAAA,EAAA,KAAA,EAAM;AAAA,GAAA,EAC1D,CAAA;AAEJ;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"section-BXEB4HRl.js","sources":["../src/ds/components/Section/section-content.tsx","../src/ds/components/Section/section-description.tsx","../src/ds/components/Section/section-divider.tsx","../src/ds/components/Section/section-header.tsx","../src/ds/components/Section/section-header-text.tsx","../src/ds/components/Section/section-heading.tsx","../src/ds/components/Section/section-root.tsx","../src/ds/components/Section/section-row.tsx","../src/ds/components/Section/section.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionContentProps = ComponentProps<'div'>;\n\nexport function SectionContent({ className, ...props }: SectionContentProps) {\n return (\n <div\n data-slot=\"section-content\"\n className={cn(\n 'group-data-[variant=factory]/section:overflow-hidden group-data-[variant=factory]/section:rounded-xl group-data-[variant=factory]/section:border group-data-[variant=factory]/section:border-border1 group-data-[variant=factory]/section:bg-surface3',\n className,\n )}\n {...props}\n />\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionDescriptionProps = ComponentProps<'p'>;\n\nexport function SectionDescription({ className, ...props }: SectionDescriptionProps) {\n return (\n <p\n data-slot=\"section-description\"\n className={cn('max-w-[62ch] text-ui-md leading-ui-md text-pretty text-neutral3', className)}\n {...props}\n />\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionDividerProps = ComponentProps<'div'>;\n\nexport function SectionDivider({ className, ...props }: SectionDividerProps) {\n return <div role=\"separator\" aria-orientation=\"horizontal\" className={cn('h-px bg-border1', className)} {...props} />;\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionHeaderProps = ComponentProps<'header'>;\n\nexport function SectionHeader({ children, className, ...props }: SectionHeaderProps) {\n return (\n <header\n data-slot=\"section-header\"\n className={cn(\n 'group-data-[variant=default]/section:grid group-data-[variant=default]/section:grid-cols-[1fr_auto] group-data-[variant=default]/section:items-center',\n 'group-data-[variant=flat]/section:flex group-data-[variant=flat]/section:min-w-0 group-data-[variant=flat]/section:flex-col group-data-[variant=flat]/section:gap-4 group-data-[variant=flat]/section:px-4 group-data-[variant=flat]/section:pb-4 sm:group-data-[variant=flat]/section:flex-row sm:group-data-[variant=flat]/section:items-start sm:group-data-[variant=flat]/section:justify-between sm:group-data-[variant=flat]/section:gap-6',\n 'group-data-[variant=factory]/section:flex group-data-[variant=factory]/section:min-w-0 group-data-[variant=factory]/section:flex-col group-data-[variant=factory]/section:gap-2 group-data-[variant=factory]/section:px-4 sm:group-data-[variant=factory]/section:flex-row sm:group-data-[variant=factory]/section:items-start sm:group-data-[variant=factory]/section:justify-between sm:group-data-[variant=factory]/section:gap-4',\n className,\n )}\n {...props}\n >\n {children}\n </header>\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionHeaderTextProps = ComponentProps<'div'>;\n\nexport function SectionHeaderText({ className, ...props }: SectionHeaderTextProps) {\n return <div data-slot=\"section-header-text\" className={cn('flex min-w-0 flex-col gap-1.5', className)} {...props} />;\n}\n","import type { ComponentProps, ElementType } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionHeadingProps = ComponentProps<'h2'> & {\n headingLevel?: 'h2' | 'h3' | 'h4';\n};\n\nexport function SectionHeading({ headingLevel = 'h2', children, className, ...props }: SectionHeadingProps) {\n const HeadingTag: ElementType = headingLevel;\n\n return (\n <HeadingTag\n data-slot=\"section-heading\"\n className={cn(\n 'group-data-[variant=default]/section:flex group-data-[variant=default]/section:items-center group-data-[variant=default]/section:gap-2 group-data-[variant=default]/section:text-ui-lg group-data-[variant=default]/section:font-bold group-data-[variant=default]/section:text-neutral4 group-data-[variant=default]/section:[&>svg]:size-[1.2em] group-data-[variant=default]/section:[&>svg]:opacity-50',\n 'group-data-[variant=flat]/section:text-ui-lg group-data-[variant=flat]/section:leading-ui-lg group-data-[variant=flat]/section:font-medium group-data-[variant=flat]/section:text-balance group-data-[variant=flat]/section:text-neutral5',\n 'group-data-[variant=factory]/section:text-ui-lg group-data-[variant=factory]/section:leading-ui-lg group-data-[variant=factory]/section:font-medium group-data-[variant=factory]/section:text-balance group-data-[variant=factory]/section:text-neutral5',\n className,\n )}\n {...props}\n >\n {children}\n </HeadingTag>\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionVariant = 'default' | 'flat' | 'factory';\n\nexport type SectionRootProps = ComponentProps<'section'> & {\n variant?: SectionVariant;\n};\n\nexport function SectionRoot({ variant = 'default', children, className, ...props }: SectionRootProps) {\n return (\n <section\n data-slot=\"section\"\n data-variant={variant}\n className={cn(\n 'group/section',\n variant === 'default' && 'grid gap-4',\n variant === 'flat' && 'w-full min-w-0',\n variant === 'factory' && 'flex w-full min-w-0 flex-col gap-2',\n className,\n )}\n {...props}\n >\n {children}\n </section>\n );\n}\n\nexport function SubSectionRoot({ children, className, ...props }: ComponentProps<'section'>) {\n return (\n <section className={cn('grid gap-2', className)} {...props}>\n {children}\n </section>\n );\n}\n","import { LockKeyholeIcon } from 'lucide-react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport { Label } from '@/ds/components/Label/label';\nimport { cn } from '@/lib/utils';\n\nexport type SectionRowProps = Omit<ComponentProps<'div'>, 'children'> & {\n label: ReactNode;\n description?: ReactNode;\n htmlFor?: string;\n children?: ReactNode;\n};\n\nexport type SectionViewOnlyRowProps = Omit<SectionRowProps, 'children'> & {\n children: ReactNode;\n};\n\nexport type SectionDestructiveRowProps = Omit<SectionRowProps, 'children'> & {\n children: ReactNode;\n};\n\ntype SectionRowLayoutProps = SectionRowProps & {\n tone?: 'default' | 'destructive';\n viewOnly?: boolean;\n};\n\nfunction SectionRowLayout({\n label,\n description,\n htmlFor,\n children,\n className,\n tone = 'default',\n viewOnly = false,\n ...props\n}: SectionRowLayoutProps) {\n const destructive = tone === 'destructive';\n const labelClassName = cn(\n 'text-ui-md leading-ui-md',\n destructive ? 'text-accent2' : viewOnly ? 'text-neutral3' : 'text-neutral5',\n 'group-data-[variant=factory]/section:font-medium group-data-[variant=flat]/section:font-medium',\n );\n\n return (\n <div\n data-slot=\"section-row\"\n className={cn(\n 'grid min-w-0 gap-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center',\n 'sm:group-data-[variant=default]/section:gap-4',\n 'group-data-[variant=flat]/section:p-4 sm:group-data-[variant=flat]/section:gap-8',\n 'group-data-[variant=factory]/section:px-4 group-data-[variant=factory]/section:py-3 sm:group-data-[variant=factory]/section:gap-4',\n className,\n )}\n {...props}\n >\n <div className=\"min-w-0\">\n {htmlFor ? (\n <Label htmlFor={htmlFor} className={labelClassName}>\n {label}\n </Label>\n ) : (\n <p className={labelClassName}>{label}</p>\n )}\n {description != null ? (\n <p className=\"text-ui-md leading-ui-md text-neutral3 mt-1 max-w-[62ch] text-pretty\">{description}</p>\n ) : null}\n </div>\n {children != null ? (\n <div\n data-slot=\"section-control\"\n className={cn('min-w-0 sm:justify-self-end', viewOnly && 'flex items-center gap-2 text-ui-md text-neutral3')}\n >\n {viewOnly ? (\n <>\n <LockKeyholeIcon className=\"size-4 shrink-0\" aria-hidden />\n <span className=\"sr-only\">View only: </span>\n </>\n ) : null}\n {children}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function SectionRow(props: SectionRowProps) {\n return <SectionRowLayout {...props} />;\n}\n\nexport function SectionViewOnlyRow(props: SectionViewOnlyRowProps) {\n return <SectionRowLayout viewOnly {...props} />;\n}\n\nexport function SectionDestructiveRow(props: SectionDestructiveRowProps) {\n return <SectionRowLayout tone=\"destructive\" {...props} />;\n}\n","import { SectionContent } from './section-content';\nimport { SectionDescription } from './section-description';\nimport { SectionDivider } from './section-divider';\nimport { SectionHeader } from './section-header';\nimport { SectionHeaderText } from './section-header-text';\nimport { SectionHeading } from './section-heading';\nimport { SectionRoot, type SectionRootProps } from './section-root';\nimport { SectionDestructiveRow, SectionRow, SectionViewOnlyRow } from './section-row';\n\nexport { type SectionContentProps } from './section-content';\nexport { type SectionDescriptionProps } from './section-description';\nexport { type SectionDividerProps } from './section-divider';\nexport { type SectionHeaderProps } from './section-header';\nexport { type SectionHeaderTextProps } from './section-header-text';\nexport { type SectionHeadingProps } from './section-heading';\nexport { type SectionRootProps as SectionProps, type SectionVariant } from './section-root';\nexport { type SectionDestructiveRowProps, type SectionRowProps, type SectionViewOnlyRowProps } from './section-row';\n\nexport function Section(props: SectionRootProps) {\n return <SectionRoot {...props} />;\n}\n\nSection.Header = SectionHeader;\nSection.HeaderText = SectionHeaderText;\nSection.Heading = SectionHeading;\nSection.Description = SectionDescription;\nSection.Content = SectionContent;\nSection.Row = SectionRow;\nSection.ViewOnlyRow = SectionViewOnlyRow;\nSection.DestructiveRow = SectionDestructiveRow;\nSection.Divider = SectionDivider;\n"],"names":[],"mappings":";;;;;AAKO,SAAS,cAAA,CAAe,EAAE,SAAA,EAAW,GAAG,OAAM,EAAwB;AAC3E,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,iBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,uPAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;;ACXO,SAAS,kBAAA,CAAmB,EAAE,SAAA,EAAW,GAAG,OAAM,EAA4B;AACnF,EAAA,uBACE,GAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,iEAAA,EAAmE,SAAS,CAAA;AAAA,MACzF,GAAG;AAAA;AAAA,GACN;AAEJ;;ACRO,SAAS,cAAA,CAAe,EAAE,SAAA,EAAW,GAAG,OAAM,EAAwB;AAC3E,EAAA,uBAAO,GA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,GAAG,KAAA,EAAO,CAAA;AACzD;;AC5EO,SAAS,QAAQ,KAAA,EAAyB;AAC/C,EAAA,uBAAO,GAAA,CAAC,WAAA,EAAA,EAAa,GAAG,KAAA,EAAO,CAAA;AACjC;AAEA,OAAA,CAAQ,MAAA,GAAS,aAAA;AACjB,OAAA,CAAQ,UAAA,GAAa,iBAAA;AACrB,OAAA,CAAQ,OAAA,GAAU,cAAA;AAClB,OAAA,CAAQ,WAAA,GAAc,kBAAA;AACtB,OAAA,CAAQ,OAAA,GAAU,cAAA;AAClB,OAAA,CAAQ,GAAA,GAAM,UAAA;AACd,OAAA,CAAQ,WAAA,GAAc,kBAAA;AACtB,OAAA,CAAQ,cAAA,GAAiB,qBAAA;AACzB,OAAA,CAAQ,OAAA,GAAU,cAAA;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"section-CzPerGGn.cjs","sources":["../src/ds/components/Section/section-content.tsx","../src/ds/components/Section/section-description.tsx","../src/ds/components/Section/section-divider.tsx","../src/ds/components/Section/section-header.tsx","../src/ds/components/Section/section-header-text.tsx","../src/ds/components/Section/section-heading.tsx","../src/ds/components/Section/section-root.tsx","../src/ds/components/Section/section-row.tsx","../src/ds/components/Section/section.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionContentProps = ComponentProps<'div'>;\n\nexport function SectionContent({ className, ...props }: SectionContentProps) {\n return (\n <div\n data-slot=\"section-content\"\n className={cn(\n 'group-data-[variant=factory]/section:overflow-hidden group-data-[variant=factory]/section:rounded-xl group-data-[variant=factory]/section:border group-data-[variant=factory]/section:border-border1 group-data-[variant=factory]/section:bg-surface3',\n className,\n )}\n {...props}\n />\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionDescriptionProps = ComponentProps<'p'>;\n\nexport function SectionDescription({ className, ...props }: SectionDescriptionProps) {\n return (\n <p\n data-slot=\"section-description\"\n className={cn('max-w-[62ch] text-ui-md leading-ui-md text-pretty text-neutral3', className)}\n {...props}\n />\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionDividerProps = ComponentProps<'div'>;\n\nexport function SectionDivider({ className, ...props }: SectionDividerProps) {\n return <div role=\"separator\" aria-orientation=\"horizontal\" className={cn('h-px bg-border1', className)} {...props} />;\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionHeaderProps = ComponentProps<'header'>;\n\nexport function SectionHeader({ children, className, ...props }: SectionHeaderProps) {\n return (\n <header\n data-slot=\"section-header\"\n className={cn(\n 'group-data-[variant=default]/section:grid group-data-[variant=default]/section:grid-cols-[1fr_auto] group-data-[variant=default]/section:items-center',\n 'group-data-[variant=flat]/section:flex group-data-[variant=flat]/section:min-w-0 group-data-[variant=flat]/section:flex-col group-data-[variant=flat]/section:gap-4 group-data-[variant=flat]/section:px-4 group-data-[variant=flat]/section:pb-4 sm:group-data-[variant=flat]/section:flex-row sm:group-data-[variant=flat]/section:items-start sm:group-data-[variant=flat]/section:justify-between sm:group-data-[variant=flat]/section:gap-6',\n 'group-data-[variant=factory]/section:flex group-data-[variant=factory]/section:min-w-0 group-data-[variant=factory]/section:flex-col group-data-[variant=factory]/section:gap-2 group-data-[variant=factory]/section:px-4 sm:group-data-[variant=factory]/section:flex-row sm:group-data-[variant=factory]/section:items-start sm:group-data-[variant=factory]/section:justify-between sm:group-data-[variant=factory]/section:gap-4',\n className,\n )}\n {...props}\n >\n {children}\n </header>\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionHeaderTextProps = ComponentProps<'div'>;\n\nexport function SectionHeaderText({ className, ...props }: SectionHeaderTextProps) {\n return <div data-slot=\"section-header-text\" className={cn('flex min-w-0 flex-col gap-1.5', className)} {...props} />;\n}\n","import type { ComponentProps, ElementType } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionHeadingProps = ComponentProps<'h2'> & {\n headingLevel?: 'h2' | 'h3' | 'h4';\n};\n\nexport function SectionHeading({ headingLevel = 'h2', children, className, ...props }: SectionHeadingProps) {\n const HeadingTag: ElementType = headingLevel;\n\n return (\n <HeadingTag\n data-slot=\"section-heading\"\n className={cn(\n 'group-data-[variant=default]/section:flex group-data-[variant=default]/section:items-center group-data-[variant=default]/section:gap-2 group-data-[variant=default]/section:text-ui-lg group-data-[variant=default]/section:font-bold group-data-[variant=default]/section:text-neutral4 group-data-[variant=default]/section:[&>svg]:size-[1.2em] group-data-[variant=default]/section:[&>svg]:opacity-50',\n 'group-data-[variant=flat]/section:text-ui-lg group-data-[variant=flat]/section:leading-ui-lg group-data-[variant=flat]/section:font-medium group-data-[variant=flat]/section:text-balance group-data-[variant=flat]/section:text-neutral5',\n 'group-data-[variant=factory]/section:text-ui-lg group-data-[variant=factory]/section:leading-ui-lg group-data-[variant=factory]/section:font-medium group-data-[variant=factory]/section:text-balance group-data-[variant=factory]/section:text-neutral5',\n className,\n )}\n {...props}\n >\n {children}\n </HeadingTag>\n );\n}\n","import type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport type SectionVariant = 'default' | 'flat' | 'factory';\n\nexport type SectionRootProps = ComponentProps<'section'> & {\n variant?: SectionVariant;\n};\n\nexport function SectionRoot({ variant = 'default', children, className, ...props }: SectionRootProps) {\n return (\n <section\n data-slot=\"section\"\n data-variant={variant}\n className={cn(\n 'group/section',\n variant === 'default' && 'grid gap-4',\n variant === 'flat' && 'w-full min-w-0',\n variant === 'factory' && 'flex w-full min-w-0 flex-col gap-2',\n className,\n )}\n {...props}\n >\n {children}\n </section>\n );\n}\n\nexport function SubSectionRoot({ children, className, ...props }: ComponentProps<'section'>) {\n return (\n <section className={cn('grid gap-2', className)} {...props}>\n {children}\n </section>\n );\n}\n","import { LockKeyholeIcon } from 'lucide-react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport { Label } from '@/ds/components/Label/label';\nimport { cn } from '@/lib/utils';\n\nexport type SectionRowProps = Omit<ComponentProps<'div'>, 'children'> & {\n label: ReactNode;\n description?: ReactNode;\n htmlFor?: string;\n children?: ReactNode;\n};\n\nexport type SectionViewOnlyRowProps = Omit<SectionRowProps, 'children'> & {\n children: ReactNode;\n};\n\nexport type SectionDestructiveRowProps = Omit<SectionRowProps, 'children'> & {\n children: ReactNode;\n};\n\ntype SectionRowLayoutProps = SectionRowProps & {\n tone?: 'default' | 'destructive';\n viewOnly?: boolean;\n};\n\nfunction SectionRowLayout({\n label,\n description,\n htmlFor,\n children,\n className,\n tone = 'default',\n viewOnly = false,\n ...props\n}: SectionRowLayoutProps) {\n const destructive = tone === 'destructive';\n const labelClassName = cn(\n 'text-ui-md leading-ui-md',\n destructive ? 'text-accent2' : viewOnly ? 'text-neutral3' : 'text-neutral5',\n 'group-data-[variant=factory]/section:font-medium group-data-[variant=flat]/section:font-medium',\n );\n\n return (\n <div\n data-slot=\"section-row\"\n className={cn(\n 'grid min-w-0 gap-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center',\n 'sm:group-data-[variant=default]/section:gap-4',\n 'group-data-[variant=flat]/section:p-4 sm:group-data-[variant=flat]/section:gap-8',\n 'group-data-[variant=factory]/section:px-4 group-data-[variant=factory]/section:py-3 sm:group-data-[variant=factory]/section:gap-4',\n className,\n )}\n {...props}\n >\n <div className=\"min-w-0\">\n {htmlFor ? (\n <Label htmlFor={htmlFor} className={labelClassName}>\n {label}\n </Label>\n ) : (\n <p className={labelClassName}>{label}</p>\n )}\n {description != null ? (\n <p className=\"text-ui-md leading-ui-md text-neutral3 mt-1 max-w-[62ch] text-pretty\">{description}</p>\n ) : null}\n </div>\n {children != null ? (\n <div\n data-slot=\"section-control\"\n className={cn('min-w-0 sm:justify-self-end', viewOnly && 'flex items-center gap-2 text-ui-md text-neutral3')}\n >\n {viewOnly ? (\n <>\n <LockKeyholeIcon className=\"size-4 shrink-0\" aria-hidden />\n <span className=\"sr-only\">View only: </span>\n </>\n ) : null}\n {children}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function SectionRow(props: SectionRowProps) {\n return <SectionRowLayout {...props} />;\n}\n\nexport function SectionViewOnlyRow(props: SectionViewOnlyRowProps) {\n return <SectionRowLayout viewOnly {...props} />;\n}\n\nexport function SectionDestructiveRow(props: SectionDestructiveRowProps) {\n return <SectionRowLayout tone=\"destructive\" {...props} />;\n}\n","import { SectionContent } from './section-content';\nimport { SectionDescription } from './section-description';\nimport { SectionDivider } from './section-divider';\nimport { SectionHeader } from './section-header';\nimport { SectionHeaderText } from './section-header-text';\nimport { SectionHeading } from './section-heading';\nimport { SectionRoot, type SectionRootProps } from './section-root';\nimport { SectionDestructiveRow, SectionRow, SectionViewOnlyRow } from './section-row';\n\nexport { type SectionContentProps } from './section-content';\nexport { type SectionDescriptionProps } from './section-description';\nexport { type SectionDividerProps } from './section-divider';\nexport { type SectionHeaderProps } from './section-header';\nexport { type SectionHeaderTextProps } from './section-header-text';\nexport { type SectionHeadingProps } from './section-heading';\nexport { type SectionRootProps as SectionProps, type SectionVariant } from './section-root';\nexport { type SectionDestructiveRowProps, type SectionRowProps, type SectionViewOnlyRowProps } from './section-row';\n\nexport function Section(props: SectionRootProps) {\n return <SectionRoot {...props} />;\n}\n\nSection.Header = SectionHeader;\nSection.HeaderText = SectionHeaderText;\nSection.Heading = SectionHeading;\nSection.Description = SectionDescription;\nSection.Content = SectionContent;\nSection.Row = SectionRow;\nSection.ViewOnlyRow = SectionViewOnlyRow;\nSection.DestructiveRow = SectionDestructiveRow;\nSection.Divider = SectionDivider;\n"],"names":["jsx","cn","label","jsxs","Label","Fragment","LockKeyholeIcon"],"mappings":";;;;;;;AAKO,SAAS,cAAA,CAAe,EAAE,SAAA,EAAW,GAAG,OAAM,EAAwB;AAC3E,EAAA,uBACEA,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,iBAAA;AAAA,MACV,SAAA,EAAWC,WAAA;AAAA,QACT,uPAAA;A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