@persona/design-system 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/AdvancedFilterRuleRow.d.mts +2 -2
- package/dist/AdvancedFilterRulesPopover.d.mts +2 -2
- package/dist/ArrayValueControl.d.mts +1 -1
- package/dist/BooleanValueControl.d.mts +1 -1
- package/dist/{Calendar-DAfQCLOJ.d.mts → Calendar-CkjYG7Mj.d.mts} +1 -1
- package/dist/Calendar.d.mts +1 -1
- package/dist/{CheckboxGroupField-BYB4OBlW.d.mts → CheckboxGroupField-4dc7YXJY.d.mts} +2 -2
- package/dist/CheckboxGroupField.d.mts +1 -1
- package/dist/ChoicesValueControl.d.mts +1 -1
- package/dist/{Combobox-DH5ycYlG.d.mts → Combobox-Bm2eSg56.d.mts} +3 -3
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-BQQSKUBU.d.mts → ComboboxBase-B7ZcqU9p.d.mts} +2 -2
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-Da3Gv1k5.d.mts → ComboboxMultiSelect-BkdRrH6K.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-BUDovONU.d.mts → ComboboxSingleSelect-DIBRZmvS.d.mts} +3 -3
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/{CompactBar-D12R7Nm2.d.mts → CompactBar-CfrrZ69k.d.mts} +1 -1
- package/dist/CompactBar.d.mts +1 -1
- package/dist/{DataTable-fZ7SNbIH.d.mts → DataTable--_f1Obhj.d.mts} +7 -5
- package/dist/{DataTable-95ZxiPlV.mjs → DataTable-BoAAKhVH.mjs} +3 -3
- package/dist/DataTable-BoAAKhVH.mjs.map +1 -0
- package/dist/DataTable.d.mts +1 -1
- package/dist/{DateField-DLz13Ksl.d.mts → DateField-CwSq77Ri.d.mts} +1 -1
- package/dist/DateField.d.mts +1 -1
- package/dist/{DatePicker-DYVWmbrb.d.mts → DatePicker-DRhY_0st.d.mts} +1 -1
- package/dist/DatePicker.d.mts +1 -1
- package/dist/{DateRangePicker-Be8TYtjz.d.mts → DateRangePicker-CLuBLF1q.d.mts} +2 -2
- package/dist/DateRangePicker.d.mts +1 -1
- package/dist/DateRangeValueControl.d.mts +2 -2
- package/dist/DateValueControl.d.mts +1 -1
- package/dist/DropdownButton.d.mts +1 -1
- package/dist/{DropdownMenu-DAa2kNrt.d.mts → DropdownMenu-Bie2cWjb.d.mts} +2 -2
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{FieldRegistry-d5tGpSch.d.mts → FieldRegistry-B5E-GN91.d.mts} +2 -2
- package/dist/FieldRegistry.d.mts +1 -1
- package/dist/{FilterBar-Bh18VyOK.d.mts → FilterBar-BQWpTi2b.d.mts} +4 -4
- package/dist/FilterBar.d.mts +1 -1
- package/dist/FilterPickerMenu.d.mts +2 -2
- package/dist/FilterPill.d.mts +1 -1
- package/dist/FilterPopover.d.mts +1 -1
- package/dist/FloatValueControl.d.mts +1 -1
- package/dist/{FormField-cSG93kuo.mjs → FormField-C4B2qFgh.mjs} +6 -6
- package/dist/{FormField-cSG93kuo.mjs.map → FormField-C4B2qFgh.mjs.map} +1 -1
- package/dist/HighlightedText.d.mts +1 -1
- package/dist/IndexTableLayout.d.mts +3 -3
- package/dist/InlineCombobox.d.mts +1 -1
- package/dist/InlineInput.d.mts +1 -1
- package/dist/IntegerValueControl.d.mts +1 -1
- package/dist/{ListBox-Bj5c626-.d.mts → ListBox-DIk8suJM.d.mts} +2 -2
- package/dist/{ListBox-C80J7DCG.mjs → ListBox-eoyBHtnJ.mjs} +1 -1
- package/dist/{ListBox-C80J7DCG.mjs.map → ListBox-eoyBHtnJ.mjs.map} +1 -1
- package/dist/ListBox.d.mts +1 -1
- package/dist/{ListBoxField-DsJRabgE.d.mts → ListBoxField-DF8rqPsu.d.mts} +4 -4
- package/dist/ListBoxField.d.mts +1 -1
- package/dist/{LogicRow-CcpD-Kk3.d.mts → LogicRow-uxpe1vZ1.d.mts} +2 -2
- package/dist/LogicRow.d.mts +1 -1
- package/dist/MaskedInput.d.mts +1 -1
- package/dist/{Menu-C0FU9WEF.d.mts → Menu-CrThaUX2.d.mts} +2 -2
- package/dist/Menu.d.mts +1 -1
- package/dist/{PillShell-CXROf8gO.d.mts → PillShell-DqglbFHe.d.mts} +2 -2
- package/dist/PillShell.d.mts +1 -1
- package/dist/{Radio-DDT_l8rd.mjs → Radio-BstZg3DI.mjs} +1 -1
- package/dist/{Radio-DDT_l8rd.mjs.map → Radio-BstZg3DI.mjs.map} +1 -1
- package/dist/{RadioGroup-CmD8NFCL.mjs → RadioGroup-erKerwSt.mjs} +2 -2
- package/dist/{RadioGroup-CmD8NFCL.mjs.map → RadioGroup-erKerwSt.mjs.map} +1 -1
- package/dist/{RangeCalendar-cZSYjuOZ.d.mts → RangeCalendar-CK5ArbIQ.d.mts} +2 -2
- package/dist/RangeCalendar.d.mts +1 -1
- package/dist/RangeCalendarPresets.d.mts +1 -1
- package/dist/RuleEditorFields.d.mts +2 -2
- package/dist/RulesPill.d.mts +1 -1
- package/dist/{SegmentedControl-CcKPfxBR.mjs → SegmentedControl-DQjIO6iX.mjs} +1 -1
- package/dist/{SegmentedControl-CcKPfxBR.mjs.map → SegmentedControl-DQjIO6iX.mjs.map} +1 -1
- package/dist/{Select-sBEBrNgo.d.mts → Select-CsxK6A5m.d.mts} +2 -2
- package/dist/Select.d.mts +1 -1
- package/dist/SmartTextInput.d.mts +22 -5
- package/dist/SmartTextInputField.d.mts +2 -2
- package/dist/SmartTextInputFunctionDialog.d.mts +2 -2
- package/dist/SmartTextInputListbox.d.mts +2 -2
- package/dist/SmartTextInputPopover.d.mts +1 -1
- package/dist/StringValueControl.d.mts +1 -1
- package/dist/TableBox.d.mts +1 -1
- package/dist/{TableBoxCell-BRECnVTs.d.mts → TableBoxCell-okcOQ5Ec.d.mts} +4 -4
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/{TableBoxField-Lm_tn73M.d.mts → TableBoxField-DR-SJY9z.d.mts} +5 -5
- package/dist/TableBoxField.d.mts +1 -1
- package/dist/{TableBoxRow-BS8Dc-zw.d.mts → TableBoxRow-DiuAB_rV.d.mts} +2 -2
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-oLMb8XcM.d.mts → TableBoxRowActions-Cm4KJsAD.d.mts} +2 -2
- package/dist/TableBoxRowActions.d.mts +1 -1
- package/dist/{TableControls-UfObf-ZN.d.mts → TableControls-B9bvsNUc.d.mts} +10 -5
- package/dist/{TableControls-DxSFqRwJ.mjs → TableControls-n16XKO9S.mjs} +1298 -1286
- package/dist/TableControls-n16XKO9S.mjs.map +1 -0
- package/dist/TableControls.d.mts +2 -2
- package/dist/{TableControlsContext-Bhtb0cMs.d.mts → TableControlsContext-CZThYoj5.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableViewConfigurationDropdown-BDXe2Q1Y.d.mts → TableViewConfigurationDropdown-CvN7tE98.d.mts} +2 -2
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/{TextArea-CFf0Lspu.mjs → TextArea-CaIEBz8d.mjs} +1 -1
- package/dist/{TextArea-CFf0Lspu.mjs.map → TextArea-CaIEBz8d.mjs.map} +1 -1
- package/dist/{Toggle-BLdemkh_.mjs → Toggle-BsqSNYok.mjs} +1 -1
- package/dist/{Toggle-BLdemkh_.mjs.map → Toggle-BsqSNYok.mjs.map} +1 -1
- package/dist/{chainTypes-BbFZn8a9.d.mts → chainTypes-Cjp0zZ4E.d.mts} +3 -3
- package/dist/{clientFilterUtils-c5xzvoBj.d.mts → clientFilterUtils-BXEpzorX.d.mts} +2 -2
- package/dist/clientFilterUtils.d.mts +1 -1
- package/dist/{codec-DIp7dhcN.d.mts → codec-KAvQRjTW.d.mts} +2 -2
- package/dist/codec.d.mts +1 -1
- package/dist/components/Combobox/index.d.mts +2 -2
- package/dist/components/DataTable/TableControls/index.d.mts +21 -21
- package/dist/components/DataTable/TableControls/index.mjs +1 -1
- package/dist/components/DataTable/index.d.mts +5 -5
- package/dist/components/DataTable/index.mjs +1 -1
- package/dist/components/DataTable/types.d.mts +1 -1
- package/dist/components/DatePicker/index.d.mts +5 -5
- package/dist/components/DropdownMenu/index.d.mts +1 -1
- package/dist/components/FormField/index.d.mts +4 -4
- package/dist/components/FormField/index.mjs +1 -1
- package/dist/components/ListBox/index.d.mts +3 -3
- package/dist/components/ListBox/index.mjs +1 -1
- package/dist/components/Menu/index.d.mts +1 -1
- package/dist/components/Radio/index.mjs +1 -1
- package/dist/components/RadioGroup/index.mjs +1 -1
- package/dist/components/SegmentedControl/index.mjs +1 -1
- package/dist/components/Select/index.d.mts +1 -1
- package/dist/components/SmartTextInput/index.d.mts +2 -2
- package/dist/components/SmartTextInput/index.mjs +12 -3
- package/dist/components/SmartTextInput/index.mjs.map +1 -1
- package/dist/components/TableBox/index.d.mts +1 -1
- package/dist/components/TextArea/index.mjs +1 -1
- package/dist/components/Toggle/index.mjs +1 -1
- package/dist/components/VersionHistory/index.mjs +1 -1
- package/dist/compound-expression.d.mts +1 -1
- package/dist/{date-range-rule-value-D01nn054.d.mts → date-range-rule-value-Dk6pZHnD.d.mts} +2 -2
- package/dist/date-range-rule-value.d.mts +1 -1
- package/dist/{date-rule-intent-B4hQ_APa.d.mts → date-rule-intent-C5C8HB1v.d.mts} +3 -3
- package/dist/date-rule-intent.d.mts +1 -1
- package/dist/display.d.mts +1 -1
- package/dist/fieldPickerOptions.d.mts +2 -2
- package/dist/{filter-size-context-Dj7Idc8j.d.mts → filter-size-context-5xQ3ycnC.d.mts} +2 -2
- package/dist/filter-size-context.d.mts +1 -1
- package/dist/{filters-DDrsgRYy.d.mts → filters-ogUUmLEf.d.mts} +2 -2
- package/dist/filters.d.mts +1 -1
- package/dist/{helpers-D8_2I4ZX.d.mts → helpers-Dqw5PEva.d.mts} +2 -2
- package/dist/helpers.d.mts +1 -1
- package/dist/{index-DsjvDLF8.d.mts → index-Ck939aXd.d.mts} +3 -3
- package/dist/{index-DkXly4xw.d.mts → index-DTAcGzW4.d.mts} +2 -2
- package/dist/index3.d.mts +3 -3
- package/dist/index4.d.mts +1 -1
- package/dist/index5.d.mts +14 -14
- package/dist/{inputFields-DyOZHse2.d.mts → inputFields-DVLg_2wz.d.mts} +4 -4
- package/dist/inputFields.d.mts +1 -1
- package/dist/{jsonSchema-COo0XQLA.d.mts → jsonSchema-DmOA0Lnu.d.mts} +2 -2
- package/dist/lib/PDSProvider.d.mts +8 -0
- package/dist/lib/PDSProvider.mjs +15 -11
- package/dist/lib/PDSProvider.mjs.map +1 -1
- package/dist/lib/chainTypes.d.mts +1 -1
- package/dist/lib/colorMode.d.mts +30 -0
- package/dist/lib/colorMode.mjs +71 -0
- package/dist/lib/colorMode.mjs.map +1 -0
- package/dist/lib/customFunctionSchema.d.mts +1 -1
- package/dist/lib/date-filter/index.d.mts +2 -2
- package/dist/lib/jsonSchema.d.mts +1 -1
- package/dist/lib/jsonSchema.mjs.map +1 -1
- package/dist/lib/jsonSchemaType.d.mts +1 -1
- package/dist/lib/methodChain.d.mts +1 -1
- package/dist/lib/objectSchemaTypes.d.mts +1 -1
- package/dist/lib/platformObject.d.mts +1 -1
- package/dist/lib/schemaOptions.d.mts +2 -2
- package/dist/lib/schemaOptions.mjs +20 -2
- package/dist/lib/schemaOptions.mjs.map +1 -1
- package/dist/lib/useChain.d.mts +1 -1
- package/dist/{listbox-options-D-DyLUdi.d.mts → listbox-options-DCmqWWgy.d.mts} +3 -3
- package/dist/listbox-options.d.mts +1 -1
- package/dist/{methodChain-BAUFBbR9.d.mts → methodChain-DaDvXsHF.d.mts} +2 -2
- package/dist/{operators-DjQXVNVI.d.mts → operators-Seez5p9U.d.mts} +2 -2
- package/dist/operators.d.mts +1 -1
- package/dist/patterns/IndexTableLayout/index.mjs +1 -1
- package/dist/relative-date-label.d.mts +1 -1
- package/dist/{schemaOptions-D536qhSd.d.mts → schemaOptions-BQgLOgtD.d.mts} +8 -3
- package/dist/{types-DHTFd-5t.d.mts → types-39QvBZuZ.d.mts} +1 -1
- package/dist/{types-CjQzH0MM.d.mts → types-BQP14Fng.d.mts} +2 -2
- package/dist/{types-Dx8PgO8a.d.mts → types-Bdi8Y7ll.d.mts} +3 -3
- package/dist/{types-DFU6M0OL.d.mts → types-DWU0Dmy9.d.mts} +3 -3
- package/dist/{types-BMpEizJP.d.mts → types-EodOhsjw.d.mts} +2 -2
- package/dist/{types-BhHdS6QP.d.mts → types-SOkNtcBq.d.mts} +2 -2
- package/dist/types3.d.mts +1 -1
- package/dist/types4.d.mts +2 -2
- package/dist/types5.d.mts +2 -2
- package/dist/types6.d.mts +1 -1
- package/dist/types7.d.mts +1 -1
- package/dist/{url-state-D1muieS7.d.mts → url-state-CwaRVyXR.d.mts} +2 -2
- package/dist/url-state.d.mts +1 -1
- package/dist/{useChain-D5LvupTW.d.mts → useChain-DXkKKe-J.d.mts} +4 -4
- package/dist/useChainAtCursor.d.mts +4 -4
- package/dist/useCodeChainFunctionPanel.d.mts +1 -1
- package/dist/useColumnConfiguration.d.mts +2 -2
- package/dist/useComboboxFooterAction.d.mts +1 -1
- package/dist/{useFilterStateV2-MH3zbQFr.d.mts → useFilterStateV2-Bzo27PR-.d.mts} +3 -3
- package/dist/useFilterStateV2.d.mts +1 -1
- package/dist/{useTableColumns-rLskKJhd.d.mts → useTableColumns-DdU0CLcU.d.mts} +2 -2
- package/dist/useTableColumns.d.mts +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils4.d.mts +2 -2
- package/dist/{validation-Csi2SJxm.d.mts → validation-D6NPueNk.d.mts} +3 -3
- package/dist/validation.d.mts +1 -1
- package/dist/validation2.d.mts +3 -3
- package/dist/{value-control-resolver-BoBFvQ_0.d.mts → value-control-resolver-C-UrXVlB.d.mts} +2 -2
- package/dist/value-control-resolver.d.mts +1 -1
- package/llms.txt +9 -1
- package/package.json +3 -1
- package/skills/ui-authoring/COMPONENTS.md +1 -1
- package/skills/ui-authoring/TOKENS.md +10 -0
- package/dist/DataTable-95ZxiPlV.mjs.map +0 -1
- package/dist/TableControls-DxSFqRwJ.mjs.map +0 -1
- /package/dist/{index-BYd3Btr1.d.mts → index-DztUdPP_.d.mts} +0 -0
- /package/dist/{index-IJ_PXwxI2.d.mts → index-uMNhmxEh.d.mts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBox-C80J7DCG.mjs","names":["ListBox","Button","FormControlContainer","DropdownMenu","MoreIcon","XIcon","Popover","Section","ListBox","BaseListBox"],"sources":["../components/ListBox/ListBox.tsx","../components/ListBox/LogicRow.tsx","../components/ListBox/index.ts"],"sourcesContent":["import { uniqueId } from 'lodash-es';\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type PropsWithChildren,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n DropIndicator,\n type DroppableCollectionReorderEvent,\n GridList,\n GridListItem,\n Header,\n ListBoxSection as Section,\n useDragAndDrop,\n} from 'react-aria-components';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius, Color, Spacing, Typography } from '@persona/design-tokens';\nimport { DragIcon } from '@persona/icons';\nimport { MoreIcon, XIcon } from '@persona/icons/12px';\nimport Button, { type ButtonProps, IconButton } from 'design-system/components/Button';\nimport { FormGroupContext } from 'design-system/components/ConfigFormGroup/useFormGroup';\nimport DropdownMenu from 'design-system/components/DropdownMenu';\nimport { Container as FormControlContainer } from 'design-system/components/FormControl';\nimport { ListItem, MenuHeading, type MenuItemProps } from 'design-system/components/Menu';\nimport Popover from 'design-system/components/Popover/Popover';\nimport Stack from 'design-system/components/Stack';\nimport { opaqueOver, withAlpha } from 'design-system/lib/color';\nimport { HeadlessAriaButton } from 'design-system/lib/HeadlessAriaButton';\nimport { isFocused, isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport { findIndexByKey, moveItemByIndex } from 'design-system/lib/reorderItems';\nimport {\n type MaybeSemanticTheme,\n semanticColor,\n semanticTokens,\n} from 'design-system/lib/semanticColor';\nimport { Z_INDICES } from 'design-system/lib/zindex';\nimport { semanticScrollbar } from 'design-system/mixins/scrollbar';\nimport { paragraphMixins } from 'design-system/mixins/text';\nimport type { PersonaTheme } from 'design-system/theme';\n\nconst selectedHighlight = (theme: PersonaTheme & MaybeSemanticTheme) => {\n const tokens = semanticTokens(theme);\n return tokens\n ? withAlpha(tokens.SurfaceAccent, tokens.Opacity25)\n : theme.color.background.highlight;\n};\n\nconst selectedActionsFill = (theme: PersonaTheme & MaybeSemanticTheme) => {\n const tokens = semanticTokens(theme);\n // Opaque so the strip, painted on top of the row, does not wash the accent a second time.\n return tokens\n ? opaqueOver(tokens.SurfaceAccent, tokens.Opacity25, tokens.SurfacePrimary)\n : theme.color.background.highlight;\n};\n\n// Context for sharing ListBox configuration with child items\ninterface ListBoxContextValue {\n size: 'sm' | 'md';\n listBoxId: string;\n setItemHasActionsOrDelete: (value: boolean) => void;\n}\n\nconst ListBoxContext = createContext<ListBoxContextValue | null>(null);\n\n/**\n * Hook to access ListBox context values (like size) from child components\n */\nexport const useListBoxContext = () => {\n return useContext(ListBoxContext);\n};\n\nexport interface ListBoxProps<T extends object> extends Omit<\n ComponentPropsWithoutRef<typeof GridList<T>>,\n 'slot' | 'autoFocus' | 'orientation' | 'shouldFocusWrap' | 'dragAndDropHooks' | 'layout'\n> {\n /**\n * Called when \"Add\" button is clicked. Only renders \"Add\" button if this prop is present.\n */\n onAdd?: ButtonProps['onClick'];\n\n /**\n * Called when \"Delete\" button is clicked. Only renders \"Delete\" button if this prop is present.\n */\n onDelete?: (selectedKeys: ListBoxProps<T>['selectedKeys']) => void;\n\n /**\n * Whether or not delete button should be disabled.\n */\n deleteDisabled?: boolean;\n\n /**\n * Whether or not the Add/Delete buttons should be shown.\n */\n editable?: boolean;\n\n /**\n * Text to display if no options are available.\n */\n emptyText?: string;\n\n /**\n * Whether or not to expand the box to the full width of the container.\n */\n fullWidth?: boolean;\n\n /**\n * When provided, enables drag and drop functionality.\n */\n reorderConfig?: {\n /**\n * Called when items are reordered via drag and drop. Receives the reordered\n * array of items when an item is dropped.\n */\n onReorder: (reorderedItems: T[]) => void;\n /**\n * The name of the property on the item that was passed as the key to\n * `ListBox.Item`. For exanple, if the item is`{ id: '1', name: 'First Item' }`,\n * and you passed ListBox.Item `key={item.id}`, then the `itemKeyPath`\n * should be `'id'`.\n */\n itemKeyPath: string;\n };\n\n /**\n * Size of the list box.\n */\n size?: 'sm' | 'md';\n\n /**\n * Caps the list height and scrolls vertically inside the bordered container.\n */\n maxHeight?: number | string;\n}\n\nconst StyledListBox = styled(GridList)<{\n fullWidth?: boolean;\n $size?: 'sm' | 'md';\n $maxHeight?: number | string;\n}>`\n ${({ $size }) => ($size === 'sm' ? paragraphMixins.sm : paragraphMixins.md)};\n\n box-sizing: border-box;\n background: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', Color.BackgroundPrimary)};\n border-radius: ${BorderRadius.Md};\n border: 1px solid ${({ theme }) => semanticColor(theme, 'BorderSubtle', Color.BorderDivider)};\n padding: ${Spacing[1]};\n\n ${({ $maxHeight }) =>\n $maxHeight != null &&\n css`\n max-height: ${typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight};\n overflow-y: auto;\n ${semanticScrollbar}\n `}\n\n ${({ fullWidth }) =>\n !fullWidth &&\n css`\n width: 204px;\n `}\n`;\n\nconst StyledDropIndicator = styled(DropIndicator)`\n height: 2px;\n background: ${({ theme }) => semanticColor(theme, 'BorderAccent', theme.color.text.brand)};\n`;\n\nconst ListBoxEmptyState = styled.button<{ $size?: 'sm' | 'md' }>`\n ${({ $size }) => ($size === 'sm' ? paragraphMixins.sm : paragraphMixins.md)};\n\n background-color: transparent;\n outline: none;\n border: none;\n padding: ${Spacing[1]};\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', Color.TextSecondary)};\n`;\n\nconst ListBoxEmptyStateButton = styled(ListBoxEmptyState)`\n &:hover {\n cursor: pointer;\n }\n`;\n\nexport const ListBox = <T extends object>({\n children,\n onAdd,\n onDelete,\n emptyText,\n deleteDisabled,\n selectedKeys,\n onSelectionChange,\n editable = true,\n size = 'md',\n reorderConfig,\n items,\n maxHeight,\n ...props\n}: PropsWithChildren<ListBoxProps<T>>) => {\n const listBoxRef = useRef<HTMLDivElement>(null);\n const listBoxId = useMemo(() => uniqueId('listbox-'), []);\n const rowDropdownId = `${listBoxId}-row-dropdown`;\n const [itemHasActionsOrDelete, setItemHasActionsOrDelete] = useState(false);\n\n const { dragAndDropHooks } = useDragAndDrop({\n getItems: (keys) =>\n Array.from(keys).map((key) => ({\n 'text/plain': String(key),\n })),\n getAllowedDropOperations: () => ['move'],\n onReorder: (e: DroppableCollectionReorderEvent) => {\n if (!reorderConfig || !items) {\n return;\n }\n const { onReorder, itemKeyPath } = reorderConfig;\n if (!onReorder || !itemKeyPath) {\n return;\n }\n\n const draggedKey = Array.from(e.keys)[0];\n if (draggedKey == null) {\n return;\n }\n\n const itemsArr = Array.from(items);\n const fromIndex = findIndexByKey(itemsArr, itemKeyPath, String(draggedKey));\n const targetIndex = findIndexByKey(itemsArr, itemKeyPath, String(e.target.key));\n if (fromIndex === -1 || targetIndex === -1) {\n return;\n }\n\n // After removing the dragged item, a target that sat after it shifts down by one.\n const targetIndexAfterRemoval = fromIndex < targetIndex ? targetIndex - 1 : targetIndex;\n const toIndex =\n e.target.dropPosition === 'before' ? targetIndexAfterRemoval : targetIndexAfterRemoval + 1;\n\n onReorder(moveItemByIndex(itemsArr, fromIndex, toIndex));\n },\n renderDropIndicator: (target) => <StyledDropIndicator target={target} />,\n });\n\n // If row dropdowns are open, deselect items (which also closes the dropdown) when clicking outside the ListBox\n const handleOutsideClick = useCallback(\n (event: MouseEvent) => {\n const rowDropdownIsOpen = document.querySelector(\n `[id=\"${rowDropdownId}\"][data-state=\"open\"]`,\n );\n if (!rowDropdownIsOpen) {\n return;\n }\n\n const target = event.target as HTMLElement;\n const isOutsideListBox = listBoxRef.current && !listBoxRef.current.contains(target);\n const isOnRowDropdownContent = target.closest(`[id=\"${rowDropdownId}\"]`);\n\n // Only deselect if:\n // 1. Click is outside the ListBox\n // 2. Click is not on popover content\n // 3. There are selected items\n // 4. onSelectionChange is available (to allow deselection)\n if (\n isOutsideListBox &&\n !isOnRowDropdownContent &&\n selectedKeys != null &&\n selectedKeys !== 'all' &&\n Array.from(selectedKeys).length > 0 &&\n onSelectionChange\n ) {\n // Deselect all items when clicking outside (but not on popover content)\n onSelectionChange(new Set());\n }\n },\n [selectedKeys, onSelectionChange, rowDropdownId],\n );\n\n // Set up outside click listener\n useEffect(() => {\n document.addEventListener('mousedown', handleOutsideClick);\n return () => {\n document.removeEventListener('mousedown', handleOutsideClick);\n };\n }, [handleOutsideClick]);\n\n return (\n <ListBoxContext.Provider value={{ size, listBoxId, setItemHasActionsOrDelete }}>\n <Stack spacing={Spacing[1]}>\n <StyledListBox\n ref={listBoxRef}\n onSelectionChange={onSelectionChange}\n renderEmptyState={() =>\n onAdd ? (\n <ListBoxEmptyStateButton as='button' onClick={onAdd} $size={size}>\n {emptyText || 'Click to add an option'}\n </ListBoxEmptyStateButton>\n ) : (\n <ListBoxEmptyState type='button' $size={size}>\n {emptyText || 'No options.'}\n </ListBoxEmptyState>\n )\n }\n selectedKeys={selectedKeys}\n $size={size}\n $maxHeight={maxHeight}\n items={items}\n // Without this, clicking delete triggers item selection (on press down)\n // before the delete/action callback fires (on click/press up)\n {...(itemHasActionsOrDelete && { shouldSelectOnPressUp: true })}\n {...(reorderConfig && { dragAndDropHooks })}\n {...props}\n >\n {children}\n </StyledListBox>\n {editable && (onAdd || onDelete) && (\n <Stack direction='horizontal' spacing={Spacing[1]}>\n {onAdd && (\n <Button size='sm' variant='basic' width='auto' onClick={onAdd}>\n Add\n </Button>\n )}\n {onDelete && (\n <Button\n size='sm'\n variant='basic'\n width='auto'\n onClick={() => onDelete?.(selectedKeys)}\n disabled={deleteDisabled || selectedKeys == null}\n >\n Delete\n </Button>\n )}\n </Stack>\n )}\n </Stack>\n </ListBoxContext.Provider>\n );\n};\n\nconst IconButtonWidth = 16;\nconst BackgroundFadeWidth = parseInt(Spacing[3]);\n\nconst RowActionsContainer = styled('div')`\n width: ${BackgroundFadeWidth + parseInt(Spacing[1]) + IconButtonWidth + parseInt(Spacing[2])}px;\n position: absolute;\n right: 0;\n top: 0;\n height: 100%;\n padding-right: ${Spacing[2]};\n display: flex;\n align-items: center;\n justify-content: end;\n`;\n\nconst StyledItem = styled(ListItem)<{\n $hasActions?: boolean;\n $hasDelete?: boolean;\n}>`\n position: relative;\n padding: ${Spacing[1]} ${Spacing[2]};\n overflow: hidden;\n white-space: nowrap;\n\n ${RowActionsContainer} {\n background: linear-gradient(\n to right,\n transparent,\n ${({ theme }) => semanticColor(theme, 'SurfacePrimary', Color.BackgroundPrimary)}\n ${BackgroundFadeWidth}px\n );\n }\n\n // If both actions and delete are present or only delete is present, hide actions by default, show on hover\n ${({ $hasActions, $hasDelete }) =>\n (($hasActions && $hasDelete) || (!$hasActions && $hasDelete)) &&\n css`\n ${RowActionsContainer} {\n opacity: 0;\n }\n `}\n\n // increase the width of the row actions container when both actions and delete are present\n ${({ $hasActions, $hasDelete }) =>\n $hasActions &&\n $hasDelete &&\n css`\n ${RowActionsContainer} {\n width: ${BackgroundFadeWidth + parseInt(Spacing[1]) + IconButtonWidth * 2 + parseInt(Spacing[2])}px;\n }\n `}\n\n &[data-focus-visible]:not([data-selected], [data-dragging]),\n &[data-hovered]:not([data-selected], [data-dragging]) {\n cursor: pointer;\n color: ${({ theme }) => semanticColor(theme, 'FgPrimary', theme.color.text.primary)};\n background-color: ${({ theme }) => semanticColor(theme, 'SurfaceHover', Color.BackgroundSecondary)};\n\n ${RowActionsContainer} {\n opacity: 1;\n background: linear-gradient(\n to right,\n transparent,\n ${({ theme }) => semanticColor(theme, 'SurfaceHover', Color.BackgroundSecondary)}\n ${BackgroundFadeWidth}px\n );\n }\n }\n\n // react-aria leaves data-hovered off a row with no selection and no action, and reports a\n // pointer-driven focus as not focus-visible; ListItem still styles both from raw pseudo-classes.\n // A real hovered row keeps its hover fill while the pointer is down.\n &&:hover:not([data-hovered], [data-selected], [data-dragging]),\n &&:focus:not([data-focus-visible], [data-hovered], [data-selected], [data-dragging]) {\n cursor: default;\n background-color: transparent;\n }\n\n // Row actions stay reachable on rows react-aria never marks hovered or focus-visible.\n &:hover,\n &:focus-within {\n ${RowActionsContainer} {\n opacity: 1;\n }\n }\n\n &[data-selected],\n &[data-selected]${isFocused}, &[data-selected]:focus,\n &${isNotDisabled}${isHovered}[data-selected] {\n outline: none;\n color: ${({ theme }) => semanticColor(theme, 'FgAccent', theme.color.text.brand)};\n background-color: ${({ theme }) => selectedHighlight(theme)};\n\n ${RowActionsContainer} {\n opacity: 1;\n background: linear-gradient(\n to right,\n transparent,\n ${({ theme }) => selectedActionsFill(theme)} ${BackgroundFadeWidth}px\n );\n }\n }\n\n &[data-dragging] {\n opacity: 0.5;\n background-color: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', Color.BackgroundPrimary)};\n }\n\n .react-aria-Section:not(:first-child) {\n margin-top: ${Spacing[1]};\n }\n`;\n\nconst ContentContainer = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n gap: ${Spacing[2]};\n`;\n\n// The drag handle wraps a 16x16 icon in an HTML <button>. Without this, the\n// button inherits the row's line-height and the icon aligns to the text\n// baseline, leaving a descender gap below it — so the icon visually sits\n// above the row's center. Making the button itself a flex container forces\n// the icon to be centered within the button's box.\nconst DragHandle = styled(HeadlessAriaButton)`\n display: flex;\n align-items: center;\n`;\n\nconst TextContent = styled.span`\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nconst DropdownPopoverHeading = styled.div<{ $size: 'sm' | 'md' }>`\n ${({ $size }) => ($size === 'md' ? Typography.TextMediumBold : Typography.TextSmallBold)};\n border-bottom: 1px solid ${({ theme }) => semanticColor(theme, 'BorderDivider', Color.BorderHairline)};\n padding: ${Spacing[2]} ${Spacing[3]} ${Spacing[1]};\n`;\n\nconst DropdownPopoverContent = styled(Stack)`\n min-width: var(--radix-popover-trigger-width);\n padding: ${Spacing[3]};\n\n ${FormControlContainer} {\n min-width: 0;\n }\n`;\n\nconst DropdownPopoverFooter = styled.div`\n border-top: 1px solid ${({ theme }) => semanticColor(theme, 'BorderDivider', Color.BorderHairline)};\n padding: ${Spacing[1]};\n`;\n\nexport interface ListBoxItemProps extends ComponentPropsWithoutRef<typeof GridListItem> {\n /**\n * Actions to display in a dropdown menu.\n * Supports all props from `MenuItem`.\n */\n actions?: Array<\n {\n label: string;\n onClick: () => void;\n } & Omit<MenuItemProps, 'children'>\n >;\n\n /**\n * Called when the delete (X) icon is clicked. Only renders item-level delete icon if this prop is present.\n * Receives the item's id and the click event as parameters.\n */\n onDelete?: (id: string | number, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /**\n * Size of the list box item.\n */\n size?: 'sm' | 'md';\n\n /**\n * Form fields to be rendered inside a row dropdown popover.\n * The configField prop will be set to true for all fields via FormGroupContext.\n * Dropdown will be opened when the item is selected.\n */\n dropdownFormFields?: ReactNode;\n\n /**\n * Content to be rendered inside the row dropdown popover.\n * Dropdown will be opened when the item is selected.\n */\n dropdownContent?: ReactNode;\n\n /**\n * Optional heading text to display in the row dropdown popover.\n * Either dropdownFormFields or dropdownContent must also be provided,\n * otherwise the dropdown will not be rendered.\n */\n dropdownHeadingText?: string;\n\n /**\n * Footer to be rendered inside the row dropdown popover.\n * Either dropdownFormFields or dropdownContent must also be provided,\n * otherwise the dropdown will not be rendered.\n */\n dropdownFooter?: ReactNode;\n}\n\nconst ListBoxItem = ({\n children,\n actions,\n onDelete,\n size,\n dropdownHeadingText,\n dropdownFormFields,\n dropdownContent,\n dropdownFooter,\n ...props\n}: ListBoxItemProps) => {\n const context = useListBoxContext();\n // Use explicit prop if provided, otherwise fall back to context value, then default to 'md'\n const effectiveSize = size ?? context?.size ?? 'md';\n\n // Update context if this item has actions or onDelete\n useEffect(() => {\n if (context && (actions || onDelete)) {\n context.setItemHasActionsOrDelete(true);\n }\n }, [context, actions, onDelete]);\n\n // Only render dropdown if there are form fields or content provided, not if there's just a header or footer.\n const shouldRenderDropdown = dropdownFormFields || dropdownContent;\n\n const handleDelete = (e: React.MouseEvent<HTMLButtonElement>) => {\n // avoid triggering row selection\n e.preventDefault();\n e.stopPropagation();\n\n if (onDelete && props.id != null) {\n onDelete(props.id, e);\n }\n };\n\n return (\n <StyledItem\n as={GridListItem}\n $hasActions={actions && actions.length > 0}\n $hasDelete={!!onDelete}\n textValue={typeof children === 'string' ? children : undefined}\n size={effectiveSize}\n {...props}\n >\n {({ isSelected, allowsDragging }) => {\n const contentWithDragHandle = (\n <ContentContainer>\n {allowsDragging && (\n <DragHandle slot='drag' aria-label='Drag to reorder'>\n <DragIcon />\n </DragHandle>\n )}\n {typeof children === 'string' || typeof children === 'number' ? (\n <TextContent>{children}</TextContent>\n ) : (\n children\n )}\n {(onDelete || actions) && (\n <RowActionsContainer>\n {actions && (\n <DropdownMenu\n trigger={\n <IconButton aria-label='Actions'>\n <MoreIcon />\n </IconButton>\n }\n align='start'\n portal\n >\n {actions.map((action) => (\n <DropdownMenu.Item\n key={action.label}\n {...action}\n onClick={action.onClick}\n size={effectiveSize}\n >\n {action.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu>\n )}\n {onDelete && (\n <IconButton aria-label='Delete' onClick={handleDelete}>\n <XIcon />\n </IconButton>\n )}\n </RowActionsContainer>\n )}\n </ContentContainer>\n );\n\n return shouldRenderDropdown ? (\n <Popover trigger={contentWithDragHandle} open={isSelected}>\n <Popover.Card\n id={`${context?.listBoxId}-row-dropdown`}\n noPadding\n style={{\n zIndex: Z_INDICES.modalDropdown,\n maxWidth: 'calc(100vw - 16px)',\n }}\n >\n {dropdownHeadingText && (\n <DropdownPopoverHeading $size={effectiveSize}>\n {dropdownHeadingText}\n </DropdownPopoverHeading>\n )}\n {dropdownFormFields && (\n <DropdownPopoverContent spacing={Spacing[2]}>\n <FormGroupContext.Provider\n value={{\n configField: true,\n labelTooltipZIndex: Z_INDICES.modalDropdownTooltip,\n }}\n >\n {dropdownFormFields}\n </FormGroupContext.Provider>\n </DropdownPopoverContent>\n )}\n {dropdownContent && (\n <DropdownPopoverContent spacing={Spacing[3]}>\n {dropdownContent}\n </DropdownPopoverContent>\n )}\n {dropdownFooter && <DropdownPopoverFooter>{dropdownFooter}</DropdownPopoverFooter>}\n </Popover.Card>\n </Popover>\n ) : (\n contentWithDragHandle\n );\n }}\n </StyledItem>\n );\n};\n\nconst StyledMenuHeading = styled(MenuHeading)`\n padding: ${Spacing[1]} ${Spacing[2]};\n`;\n\nconst ListBoxHeader = (props: ComponentPropsWithoutRef<typeof Header>) => {\n return <StyledMenuHeading as={Header} {...props} />;\n};\n\nListBox.Item = ListBoxItem;\n\nListBox.Section = Section;\n\nListBox.Header = ListBoxHeader;\n\nexport default ListBox;\n","import type { ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport { Color, Spacing, Typography } from '@persona/design-tokens';\nimport Sticker, {\n StickerContainer,\n StickerContentContainer,\n StyledTruncatedText,\n} from 'design-system/components/Sticker';\nimport { isFocused, isHovered } from 'design-system/lib/pseudoClass';\nimport { semanticColor, semanticOnly } from 'design-system/lib/semanticColor';\nimport type { InputSizes } from 'design-system/mixins/input';\n\nimport ListBox, { type ListBoxItemProps } from './ListBox';\n\nconst LogicRowSticker = styled(Sticker)`\n display: inline;\n height: initial;\n\n ${StickerContainer}, ${StickerContentContainer}, ${StyledTruncatedText} {\n display: inline;\n }\n`;\n\nconst LogicListBoxItem = styled(ListBox.Item)`\n padding: 0;\n\n &[data-selected],\n &[data-selected]${isFocused}, &[data-selected]:focus,\n &[data-selected]${isHovered}, &[data-selected]:hover,\n &[data-selected]:not(:disabled)${isHovered}, &[data-selected]:not(:disabled):hover {\n color: ${({ theme }) => semanticColor(theme, 'FgPrimary', Color.TextPrimary)};\n\n ${LogicRowSticker} {\n background-color: ${({ theme }) =>\n semanticColor(theme, 'FeedbackAccent2', Color.BackgroundLabelPurple)};\n ${semanticOnly((tokens) => `color: ${tokens.FgPrimaryStatic};`)}\n }\n }\n\n &[data-hovered]:not([data-selected]) {\n ${LogicRowSticker} {\n background-color: ${({ theme }) =>\n semanticColor(theme, 'FeedbackNeutral2', Color.BackgroundLabelGreyHover)};\n ${semanticOnly((tokens) => `color: ${tokens.FgPrimary};`)}\n }\n }\n`;\n\nconst LogicRuleContainer = styled.div<{ $hideCondition?: boolean; $size?: InputSizes }>`\n display: grid;\n grid-template-columns: ${({ $hideCondition }) =>\n $hideCondition ? 'repeat(3, min-content)' : '32px repeat(3, min-content)'};\n grid-gap: 6px;\n align-items: baseline;\n padding: ${Spacing[1]};\n width: 100%;\n ${({ $size }) => ($size === 'md' ? Typography.TextMedium : Typography.TextSmall)}\n`;\n\nexport interface LogicRowProps extends ListBoxItemProps {\n condition: string;\n attributeName?: string;\n operator?: string;\n matchLevelName?: string;\n editable?: boolean;\n id: string | number;\n dropdownHeadingText?: string;\n /** Form fields rendered inside the row dropdown. */\n dropdownFormFields?: ReactNode;\n size?: InputSizes;\n /**\n * Removes the condition column when the surrounding group already communicates\n * the conjunction.\n */\n hideCondition?: boolean;\n}\n\nconst LogicRow = ({\n condition,\n attributeName,\n operator,\n matchLevelName,\n editable = true,\n id,\n onDelete,\n dropdownHeadingText,\n dropdownFormFields,\n size,\n hideCondition = false,\n ...listBoxItemProps\n}: LogicRowProps) => {\n return (\n <LogicListBoxItem\n id={id}\n disabled={!editable}\n onDelete={onDelete}\n dropdownHeadingText={dropdownHeadingText}\n dropdownFormFields={dropdownFormFields}\n {...listBoxItemProps}\n size={size}\n >\n <LogicRuleContainer $hideCondition={hideCondition} $size={size}>\n {!hideCondition && (condition || '\\u00A0')}\n {attributeName && (\n <>\n <LogicRowSticker disabled={!editable}>{attributeName}</LogicRowSticker>\n {operator}\n {matchLevelName && (\n <LogicRowSticker disabled={!editable}>{matchLevelName}</LogicRowSticker>\n )}\n </>\n )}\n </LogicRuleContainer>\n </LogicListBoxItem>\n );\n};\n\nexport default LogicRow;\n","import BaseListBox, { useListBoxContext } from './ListBox';\nimport LogicRow from './LogicRow';\n\nconst ListBox = Object.assign(BaseListBox, { LogicRow });\n\nexport { ListBox, useListBoxContext };\nexport type { ListBoxProps, ListBoxItemProps } from './ListBox';\nexport type { LogicRowProps } from './LogicRow';\n\nexport default ListBox;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAM,qBAAqB,UAA6C;CACtE,MAAM,SAAS,eAAe,MAAM;AACpC,QAAO,SACH,UAAU,OAAO,eAAe,OAAO,UAAU,GACjD,MAAM,MAAM,WAAW;;AAG7B,MAAM,uBAAuB,UAA6C;CACxE,MAAM,SAAS,eAAe,MAAM;AAEpC,QAAO,SACH,WAAW,OAAO,eAAe,OAAO,WAAW,OAAO,eAAe,GACzE,MAAM,MAAM,WAAW;;AAU7B,MAAM,iBAAiB,cAA0C,KAAK;;;;AAKtE,MAAa,0BAA0B;AACrC,QAAO,WAAW,eAAe;;AAkEnC,MAAM,gBAAgB,OAAO,SAAS;KAKjC,EAAE,YAAa,UAAU,OAAO,gBAAgB,KAAK,gBAAgB,GAAI;;;iBAG7D,EAAE,YAAY,cAAc,OAAO,kBAAkB,MAAM,kBAAkB,CAAC;mBAC5E,aAAa,GAAG;uBACZ,EAAE,YAAY,cAAc,OAAO,gBAAgB,MAAM,cAAc,CAAC;aAClF,QAAQ,GAAG;;KAEnB,EAAE,iBACH,cAAc,QACd,GAAG;oBACa,OAAO,eAAe,WAAW,GAAG,WAAW,MAAM,WAAW;;QAE5E,kBAAkB;MACpB;;KAED,EAAE,gBACH,CAAC,aACD,GAAG;;MAED;;AAGN,MAAM,sBAAsB,OAAO,cAAc;;iBA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AAgC,CAAA;IACtE;IACA,kBACC,oBAAC,iBAAD;KAAiB,UAAU,CAAC;eAAW;KAAiC,CAAA;IAEzE,EAAA,CAAA,CAEc;;EACJ,CAAA;;;;AC/GvB,MAAM,UAAU,OAAO,OAAOC,WAAa,EAAE,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"ListBox-eoyBHtnJ.mjs","names":["ListBox","Button","FormControlContainer","DropdownMenu","MoreIcon","XIcon","Popover","Section","ListBox","BaseListBox"],"sources":["../components/ListBox/ListBox.tsx","../components/ListBox/LogicRow.tsx","../components/ListBox/index.ts"],"sourcesContent":["import { uniqueId } from 'lodash-es';\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type PropsWithChildren,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n DropIndicator,\n type DroppableCollectionReorderEvent,\n GridList,\n GridListItem,\n Header,\n ListBoxSection as Section,\n useDragAndDrop,\n} from 'react-aria-components';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius, Color, Spacing, Typography } from '@persona/design-tokens';\nimport { DragIcon } from '@persona/icons';\nimport { MoreIcon, XIcon } from '@persona/icons/12px';\nimport Button, { type ButtonProps, IconButton } from 'design-system/components/Button';\nimport { FormGroupContext } from 'design-system/components/ConfigFormGroup/useFormGroup';\nimport DropdownMenu from 'design-system/components/DropdownMenu';\nimport { Container as FormControlContainer } from 'design-system/components/FormControl';\nimport { ListItem, MenuHeading, type MenuItemProps } from 'design-system/components/Menu';\nimport Popover from 'design-system/components/Popover/Popover';\nimport Stack from 'design-system/components/Stack';\nimport { opaqueOver, withAlpha } from 'design-system/lib/color';\nimport { HeadlessAriaButton } from 'design-system/lib/HeadlessAriaButton';\nimport { isFocused, isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport { findIndexByKey, moveItemByIndex } from 'design-system/lib/reorderItems';\nimport {\n type MaybeSemanticTheme,\n semanticColor,\n semanticTokens,\n} from 'design-system/lib/semanticColor';\nimport { Z_INDICES } from 'design-system/lib/zindex';\nimport { semanticScrollbar } from 'design-system/mixins/scrollbar';\nimport { paragraphMixins } from 'design-system/mixins/text';\nimport type { PersonaTheme } from 'design-system/theme';\n\nconst selectedHighlight = (theme: PersonaTheme & MaybeSemanticTheme) => {\n const tokens = semanticTokens(theme);\n return tokens\n ? withAlpha(tokens.SurfaceAccent, tokens.Opacity25)\n : theme.color.background.highlight;\n};\n\nconst selectedActionsFill = (theme: PersonaTheme & MaybeSemanticTheme) => {\n const tokens = semanticTokens(theme);\n // Opaque so the strip, painted on top of the row, does not wash the accent a second time.\n return tokens\n ? opaqueOver(tokens.SurfaceAccent, tokens.Opacity25, tokens.SurfacePrimary)\n : theme.color.background.highlight;\n};\n\n// Context for sharing ListBox configuration with child items\ninterface ListBoxContextValue {\n size: 'sm' | 'md';\n listBoxId: string;\n setItemHasActionsOrDelete: (value: boolean) => void;\n}\n\nconst ListBoxContext = createContext<ListBoxContextValue | null>(null);\n\n/**\n * Hook to access ListBox context values (like size) from child components\n */\nexport const useListBoxContext = () => {\n return useContext(ListBoxContext);\n};\n\nexport interface ListBoxProps<T extends object> extends Omit<\n ComponentPropsWithoutRef<typeof GridList<T>>,\n 'slot' | 'autoFocus' | 'orientation' | 'shouldFocusWrap' | 'dragAndDropHooks' | 'layout'\n> {\n /**\n * Called when \"Add\" button is clicked. Only renders \"Add\" button if this prop is present.\n */\n onAdd?: ButtonProps['onClick'];\n\n /**\n * Called when \"Delete\" button is clicked. Only renders \"Delete\" button if this prop is present.\n */\n onDelete?: (selectedKeys: ListBoxProps<T>['selectedKeys']) => void;\n\n /**\n * Whether or not delete button should be disabled.\n */\n deleteDisabled?: boolean;\n\n /**\n * Whether or not the Add/Delete buttons should be shown.\n */\n editable?: boolean;\n\n /**\n * Text to display if no options are available.\n */\n emptyText?: string;\n\n /**\n * Whether or not to expand the box to the full width of the container.\n */\n fullWidth?: boolean;\n\n /**\n * When provided, enables drag and drop functionality.\n */\n reorderConfig?: {\n /**\n * Called when items are reordered via drag and drop. Receives the reordered\n * array of items when an item is dropped.\n */\n onReorder: (reorderedItems: T[]) => void;\n /**\n * The name of the property on the item that was passed as the key to\n * `ListBox.Item`. For exanple, if the item is`{ id: '1', name: 'First Item' }`,\n * and you passed ListBox.Item `key={item.id}`, then the `itemKeyPath`\n * should be `'id'`.\n */\n itemKeyPath: string;\n };\n\n /**\n * Size of the list box.\n */\n size?: 'sm' | 'md';\n\n /**\n * Caps the list height and scrolls vertically inside the bordered container.\n */\n maxHeight?: number | string;\n}\n\nconst StyledListBox = styled(GridList)<{\n fullWidth?: boolean;\n $size?: 'sm' | 'md';\n $maxHeight?: number | string;\n}>`\n ${({ $size }) => ($size === 'sm' ? paragraphMixins.sm : paragraphMixins.md)};\n\n box-sizing: border-box;\n background: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', Color.BackgroundPrimary)};\n border-radius: ${BorderRadius.Md};\n border: 1px solid ${({ theme }) => semanticColor(theme, 'BorderSubtle', Color.BorderDivider)};\n padding: ${Spacing[1]};\n\n ${({ $maxHeight }) =>\n $maxHeight != null &&\n css`\n max-height: ${typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight};\n overflow-y: auto;\n ${semanticScrollbar}\n `}\n\n ${({ fullWidth }) =>\n !fullWidth &&\n css`\n width: 204px;\n `}\n`;\n\nconst StyledDropIndicator = styled(DropIndicator)`\n height: 2px;\n background: ${({ theme }) => semanticColor(theme, 'BorderAccent', theme.color.text.brand)};\n`;\n\nconst ListBoxEmptyState = styled.button<{ $size?: 'sm' | 'md' }>`\n ${({ $size }) => ($size === 'sm' ? paragraphMixins.sm : paragraphMixins.md)};\n\n background-color: transparent;\n outline: none;\n border: none;\n padding: ${Spacing[1]};\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', Color.TextSecondary)};\n`;\n\nconst ListBoxEmptyStateButton = styled(ListBoxEmptyState)`\n &:hover {\n cursor: pointer;\n }\n`;\n\nexport const ListBox = <T extends object>({\n children,\n onAdd,\n onDelete,\n emptyText,\n deleteDisabled,\n selectedKeys,\n onSelectionChange,\n editable = true,\n size = 'md',\n reorderConfig,\n items,\n maxHeight,\n ...props\n}: PropsWithChildren<ListBoxProps<T>>) => {\n const listBoxRef = useRef<HTMLDivElement>(null);\n const listBoxId = useMemo(() => uniqueId('listbox-'), []);\n const rowDropdownId = `${listBoxId}-row-dropdown`;\n const [itemHasActionsOrDelete, setItemHasActionsOrDelete] = useState(false);\n\n const { dragAndDropHooks } = useDragAndDrop({\n getItems: (keys) =>\n Array.from(keys).map((key) => ({\n 'text/plain': String(key),\n })),\n getAllowedDropOperations: () => ['move'],\n onReorder: (e: DroppableCollectionReorderEvent) => {\n if (!reorderConfig || !items) {\n return;\n }\n const { onReorder, itemKeyPath } = reorderConfig;\n if (!onReorder || !itemKeyPath) {\n return;\n }\n\n const draggedKey = Array.from(e.keys)[0];\n if (draggedKey == null) {\n return;\n }\n\n const itemsArr = Array.from(items);\n const fromIndex = findIndexByKey(itemsArr, itemKeyPath, String(draggedKey));\n const targetIndex = findIndexByKey(itemsArr, itemKeyPath, String(e.target.key));\n if (fromIndex === -1 || targetIndex === -1) {\n return;\n }\n\n // After removing the dragged item, a target that sat after it shifts down by one.\n const targetIndexAfterRemoval = fromIndex < targetIndex ? targetIndex - 1 : targetIndex;\n const toIndex =\n e.target.dropPosition === 'before' ? targetIndexAfterRemoval : targetIndexAfterRemoval + 1;\n\n onReorder(moveItemByIndex(itemsArr, fromIndex, toIndex));\n },\n renderDropIndicator: (target) => <StyledDropIndicator target={target} />,\n });\n\n // If row dropdowns are open, deselect items (which also closes the dropdown) when clicking outside the ListBox\n const handleOutsideClick = useCallback(\n (event: MouseEvent) => {\n const rowDropdownIsOpen = document.querySelector(\n `[id=\"${rowDropdownId}\"][data-state=\"open\"]`,\n );\n if (!rowDropdownIsOpen) {\n return;\n }\n\n const target = event.target as HTMLElement;\n const isOutsideListBox = listBoxRef.current && !listBoxRef.current.contains(target);\n const isOnRowDropdownContent = target.closest(`[id=\"${rowDropdownId}\"]`);\n\n // Only deselect if:\n // 1. Click is outside the ListBox\n // 2. Click is not on popover content\n // 3. There are selected items\n // 4. onSelectionChange is available (to allow deselection)\n if (\n isOutsideListBox &&\n !isOnRowDropdownContent &&\n selectedKeys != null &&\n selectedKeys !== 'all' &&\n Array.from(selectedKeys).length > 0 &&\n onSelectionChange\n ) {\n // Deselect all items when clicking outside (but not on popover content)\n onSelectionChange(new Set());\n }\n },\n [selectedKeys, onSelectionChange, rowDropdownId],\n );\n\n // Set up outside click listener\n useEffect(() => {\n document.addEventListener('mousedown', handleOutsideClick);\n return () => {\n document.removeEventListener('mousedown', handleOutsideClick);\n };\n }, [handleOutsideClick]);\n\n return (\n <ListBoxContext.Provider value={{ size, listBoxId, setItemHasActionsOrDelete }}>\n <Stack spacing={Spacing[1]}>\n <StyledListBox\n ref={listBoxRef}\n onSelectionChange={onSelectionChange}\n renderEmptyState={() =>\n onAdd ? (\n <ListBoxEmptyStateButton as='button' onClick={onAdd} $size={size}>\n {emptyText || 'Click to add an option'}\n </ListBoxEmptyStateButton>\n ) : (\n <ListBoxEmptyState type='button' $size={size}>\n {emptyText || 'No options.'}\n </ListBoxEmptyState>\n )\n }\n selectedKeys={selectedKeys}\n $size={size}\n $maxHeight={maxHeight}\n items={items}\n // Without this, clicking delete triggers item selection (on press down)\n // before the delete/action callback fires (on click/press up)\n {...(itemHasActionsOrDelete && { shouldSelectOnPressUp: true })}\n {...(reorderConfig && { dragAndDropHooks })}\n {...props}\n >\n {children}\n </StyledListBox>\n {editable && (onAdd || onDelete) && (\n <Stack direction='horizontal' spacing={Spacing[1]}>\n {onAdd && (\n <Button size='sm' variant='basic' width='auto' onClick={onAdd}>\n Add\n </Button>\n )}\n {onDelete && (\n <Button\n size='sm'\n variant='basic'\n width='auto'\n onClick={() => onDelete?.(selectedKeys)}\n disabled={deleteDisabled || selectedKeys == null}\n >\n Delete\n </Button>\n )}\n </Stack>\n )}\n </Stack>\n </ListBoxContext.Provider>\n );\n};\n\nconst IconButtonWidth = 16;\nconst BackgroundFadeWidth = parseInt(Spacing[3]);\n\nconst RowActionsContainer = styled('div')`\n width: ${BackgroundFadeWidth + parseInt(Spacing[1]) + IconButtonWidth + parseInt(Spacing[2])}px;\n position: absolute;\n right: 0;\n top: 0;\n height: 100%;\n padding-right: ${Spacing[2]};\n display: flex;\n align-items: center;\n justify-content: end;\n`;\n\nconst StyledItem = styled(ListItem)<{\n $hasActions?: boolean;\n $hasDelete?: boolean;\n}>`\n position: relative;\n padding: ${Spacing[1]} ${Spacing[2]};\n overflow: hidden;\n white-space: nowrap;\n\n ${RowActionsContainer} {\n background: linear-gradient(\n to right,\n transparent,\n ${({ theme }) => semanticColor(theme, 'SurfacePrimary', Color.BackgroundPrimary)}\n ${BackgroundFadeWidth}px\n );\n }\n\n // If both actions and delete are present or only delete is present, hide actions by default, show on hover\n ${({ $hasActions, $hasDelete }) =>\n (($hasActions && $hasDelete) || (!$hasActions && $hasDelete)) &&\n css`\n ${RowActionsContainer} {\n opacity: 0;\n }\n `}\n\n // increase the width of the row actions container when both actions and delete are present\n ${({ $hasActions, $hasDelete }) =>\n $hasActions &&\n $hasDelete &&\n css`\n ${RowActionsContainer} {\n width: ${BackgroundFadeWidth + parseInt(Spacing[1]) + IconButtonWidth * 2 + parseInt(Spacing[2])}px;\n }\n `}\n\n &[data-focus-visible]:not([data-selected], [data-dragging]),\n &[data-hovered]:not([data-selected], [data-dragging]) {\n cursor: pointer;\n color: ${({ theme }) => semanticColor(theme, 'FgPrimary', theme.color.text.primary)};\n background-color: ${({ theme }) => semanticColor(theme, 'SurfaceHover', Color.BackgroundSecondary)};\n\n ${RowActionsContainer} {\n opacity: 1;\n background: linear-gradient(\n to right,\n transparent,\n ${({ theme }) => semanticColor(theme, 'SurfaceHover', Color.BackgroundSecondary)}\n ${BackgroundFadeWidth}px\n );\n }\n }\n\n // react-aria leaves data-hovered off a row with no selection and no action, and reports a\n // pointer-driven focus as not focus-visible; ListItem still styles both from raw pseudo-classes.\n // A real hovered row keeps its hover fill while the pointer is down.\n &&:hover:not([data-hovered], [data-selected], [data-dragging]),\n &&:focus:not([data-focus-visible], [data-hovered], [data-selected], [data-dragging]) {\n cursor: default;\n background-color: transparent;\n }\n\n // Row actions stay reachable on rows react-aria never marks hovered or focus-visible.\n &:hover,\n &:focus-within {\n ${RowActionsContainer} {\n opacity: 1;\n }\n }\n\n &[data-selected],\n &[data-selected]${isFocused}, &[data-selected]:focus,\n &${isNotDisabled}${isHovered}[data-selected] {\n outline: none;\n color: ${({ theme }) => semanticColor(theme, 'FgAccent', theme.color.text.brand)};\n background-color: ${({ theme }) => selectedHighlight(theme)};\n\n ${RowActionsContainer} {\n opacity: 1;\n background: linear-gradient(\n to right,\n transparent,\n ${({ theme }) => selectedActionsFill(theme)} ${BackgroundFadeWidth}px\n );\n }\n }\n\n &[data-dragging] {\n opacity: 0.5;\n background-color: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', Color.BackgroundPrimary)};\n }\n\n .react-aria-Section:not(:first-child) {\n margin-top: ${Spacing[1]};\n }\n`;\n\nconst ContentContainer = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n gap: ${Spacing[2]};\n`;\n\n// The drag handle wraps a 16x16 icon in an HTML <button>. Without this, the\n// button inherits the row's line-height and the icon aligns to the text\n// baseline, leaving a descender gap below it — so the icon visually sits\n// above the row's center. Making the button itself a flex container forces\n// the icon to be centered within the button's box.\nconst DragHandle = styled(HeadlessAriaButton)`\n display: flex;\n align-items: center;\n`;\n\nconst TextContent = styled.span`\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nconst DropdownPopoverHeading = styled.div<{ $size: 'sm' | 'md' }>`\n ${({ $size }) => ($size === 'md' ? Typography.TextMediumBold : Typography.TextSmallBold)};\n border-bottom: 1px solid ${({ theme }) => semanticColor(theme, 'BorderDivider', Color.BorderHairline)};\n padding: ${Spacing[2]} ${Spacing[3]} ${Spacing[1]};\n`;\n\nconst DropdownPopoverContent = styled(Stack)`\n min-width: var(--radix-popover-trigger-width);\n padding: ${Spacing[3]};\n\n ${FormControlContainer} {\n min-width: 0;\n }\n`;\n\nconst DropdownPopoverFooter = styled.div`\n border-top: 1px solid ${({ theme }) => semanticColor(theme, 'BorderDivider', Color.BorderHairline)};\n padding: ${Spacing[1]};\n`;\n\nexport interface ListBoxItemProps extends ComponentPropsWithoutRef<typeof GridListItem> {\n /**\n * Actions to display in a dropdown menu.\n * Supports all props from `MenuItem`.\n */\n actions?: Array<\n {\n label: string;\n onClick: () => void;\n } & Omit<MenuItemProps, 'children'>\n >;\n\n /**\n * Called when the delete (X) icon is clicked. Only renders item-level delete icon if this prop is present.\n * Receives the item's id and the click event as parameters.\n */\n onDelete?: (id: string | number, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /**\n * Size of the list box item.\n */\n size?: 'sm' | 'md';\n\n /**\n * Form fields to be rendered inside a row dropdown popover.\n * The configField prop will be set to true for all fields via FormGroupContext.\n * Dropdown will be opened when the item is selected.\n */\n dropdownFormFields?: ReactNode;\n\n /**\n * Content to be rendered inside the row dropdown popover.\n * Dropdown will be opened when the item is selected.\n */\n dropdownContent?: ReactNode;\n\n /**\n * Optional heading text to display in the row dropdown popover.\n * Either dropdownFormFields or dropdownContent must also be provided,\n * otherwise the dropdown will not be rendered.\n */\n dropdownHeadingText?: string;\n\n /**\n * Footer to be rendered inside the row dropdown popover.\n * Either dropdownFormFields or dropdownContent must also be provided,\n * otherwise the dropdown will not be rendered.\n */\n dropdownFooter?: ReactNode;\n}\n\nconst ListBoxItem = ({\n children,\n actions,\n onDelete,\n size,\n dropdownHeadingText,\n dropdownFormFields,\n dropdownContent,\n dropdownFooter,\n ...props\n}: ListBoxItemProps) => {\n const context = useListBoxContext();\n // Use explicit prop if provided, otherwise fall back to context value, then default to 'md'\n const effectiveSize = size ?? context?.size ?? 'md';\n\n // Update context if this item has actions or onDelete\n useEffect(() => {\n if (context && (actions || onDelete)) {\n context.setItemHasActionsOrDelete(true);\n }\n }, [context, actions, onDelete]);\n\n // Only render dropdown if there are form fields or content provided, not if there's just a header or footer.\n const shouldRenderDropdown = dropdownFormFields || dropdownContent;\n\n const handleDelete = (e: React.MouseEvent<HTMLButtonElement>) => {\n // avoid triggering row selection\n e.preventDefault();\n e.stopPropagation();\n\n if (onDelete && props.id != null) {\n onDelete(props.id, e);\n }\n };\n\n return (\n <StyledItem\n as={GridListItem}\n $hasActions={actions && actions.length > 0}\n $hasDelete={!!onDelete}\n textValue={typeof children === 'string' ? children : undefined}\n size={effectiveSize}\n {...props}\n >\n {({ isSelected, allowsDragging }) => {\n const contentWithDragHandle = (\n <ContentContainer>\n {allowsDragging && (\n <DragHandle slot='drag' aria-label='Drag to reorder'>\n <DragIcon />\n </DragHandle>\n )}\n {typeof children === 'string' || typeof children === 'number' ? (\n <TextContent>{children}</TextContent>\n ) : (\n children\n )}\n {(onDelete || actions) && (\n <RowActionsContainer>\n {actions && (\n <DropdownMenu\n trigger={\n <IconButton aria-label='Actions'>\n <MoreIcon />\n </IconButton>\n }\n align='start'\n portal\n >\n {actions.map((action) => (\n <DropdownMenu.Item\n key={action.label}\n {...action}\n onClick={action.onClick}\n size={effectiveSize}\n >\n {action.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu>\n )}\n {onDelete && (\n <IconButton aria-label='Delete' onClick={handleDelete}>\n <XIcon />\n </IconButton>\n )}\n </RowActionsContainer>\n )}\n </ContentContainer>\n );\n\n return shouldRenderDropdown ? (\n <Popover trigger={contentWithDragHandle} open={isSelected}>\n <Popover.Card\n id={`${context?.listBoxId}-row-dropdown`}\n noPadding\n style={{\n zIndex: Z_INDICES.modalDropdown,\n maxWidth: 'calc(100vw - 16px)',\n }}\n >\n {dropdownHeadingText && (\n <DropdownPopoverHeading $size={effectiveSize}>\n {dropdownHeadingText}\n </DropdownPopoverHeading>\n )}\n {dropdownFormFields && (\n <DropdownPopoverContent spacing={Spacing[2]}>\n <FormGroupContext.Provider\n value={{\n configField: true,\n labelTooltipZIndex: Z_INDICES.modalDropdownTooltip,\n }}\n >\n {dropdownFormFields}\n </FormGroupContext.Provider>\n </DropdownPopoverContent>\n )}\n {dropdownContent && (\n <DropdownPopoverContent spacing={Spacing[3]}>\n {dropdownContent}\n </DropdownPopoverContent>\n )}\n {dropdownFooter && <DropdownPopoverFooter>{dropdownFooter}</DropdownPopoverFooter>}\n </Popover.Card>\n </Popover>\n ) : (\n contentWithDragHandle\n );\n }}\n </StyledItem>\n );\n};\n\nconst StyledMenuHeading = styled(MenuHeading)`\n padding: ${Spacing[1]} ${Spacing[2]};\n`;\n\nconst ListBoxHeader = (props: ComponentPropsWithoutRef<typeof Header>) => {\n return <StyledMenuHeading as={Header} {...props} />;\n};\n\nListBox.Item = ListBoxItem;\n\nListBox.Section = Section;\n\nListBox.Header = ListBoxHeader;\n\nexport default ListBox;\n","import type { ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport { Color, Spacing, Typography } from '@persona/design-tokens';\nimport Sticker, {\n StickerContainer,\n StickerContentContainer,\n StyledTruncatedText,\n} from 'design-system/components/Sticker';\nimport { isFocused, isHovered } from 'design-system/lib/pseudoClass';\nimport { semanticColor, semanticOnly } from 'design-system/lib/semanticColor';\nimport type { InputSizes } from 'design-system/mixins/input';\n\nimport ListBox, { type ListBoxItemProps } from './ListBox';\n\nconst LogicRowSticker = styled(Sticker)`\n display: inline;\n height: initial;\n\n ${StickerContainer}, ${StickerContentContainer}, ${StyledTruncatedText} {\n display: inline;\n }\n`;\n\nconst LogicListBoxItem = styled(ListBox.Item)`\n padding: 0;\n\n &[data-selected],\n &[data-selected]${isFocused}, &[data-selected]:focus,\n &[data-selected]${isHovered}, &[data-selected]:hover,\n &[data-selected]:not(:disabled)${isHovered}, &[data-selected]:not(:disabled):hover {\n color: ${({ theme }) => semanticColor(theme, 'FgPrimary', Color.TextPrimary)};\n\n ${LogicRowSticker} {\n background-color: ${({ theme }) =>\n semanticColor(theme, 'FeedbackAccent2', Color.BackgroundLabelPurple)};\n ${semanticOnly((tokens) => `color: ${tokens.FgPrimaryStatic};`)}\n }\n }\n\n &[data-hovered]:not([data-selected]) {\n ${LogicRowSticker} {\n background-color: ${({ theme }) =>\n semanticColor(theme, 'FeedbackNeutral2', Color.BackgroundLabelGreyHover)};\n ${semanticOnly((tokens) => `color: ${tokens.FgPrimary};`)}\n }\n }\n`;\n\nconst LogicRuleContainer = styled.div<{ $hideCondition?: boolean; $size?: InputSizes }>`\n display: grid;\n grid-template-columns: ${({ $hideCondition }) =>\n $hideCondition ? 'repeat(3, min-content)' : '32px repeat(3, min-content)'};\n grid-gap: 6px;\n align-items: baseline;\n padding: ${Spacing[1]};\n width: 100%;\n ${({ $size }) => ($size === 'md' ? Typography.TextMedium : Typography.TextSmall)}\n`;\n\nexport interface LogicRowProps extends ListBoxItemProps {\n condition: string;\n attributeName?: string;\n operator?: string;\n matchLevelName?: string;\n editable?: boolean;\n id: string | number;\n dropdownHeadingText?: string;\n /** Form fields rendered inside the row dropdown. */\n dropdownFormFields?: ReactNode;\n size?: InputSizes;\n /**\n * Removes the condition column when the surrounding group already communicates\n * the conjunction.\n */\n hideCondition?: boolean;\n}\n\nconst LogicRow = ({\n condition,\n attributeName,\n operator,\n matchLevelName,\n editable = true,\n id,\n onDelete,\n dropdownHeadingText,\n dropdownFormFields,\n size,\n hideCondition = false,\n ...listBoxItemProps\n}: LogicRowProps) => {\n return (\n <LogicListBoxItem\n id={id}\n disabled={!editable}\n onDelete={onDelete}\n dropdownHeadingText={dropdownHeadingText}\n dropdownFormFields={dropdownFormFields}\n {...listBoxItemProps}\n size={size}\n >\n <LogicRuleContainer $hideCondition={hideCondition} $size={size}>\n {!hideCondition && (condition || '\\u00A0')}\n {attributeName && (\n <>\n <LogicRowSticker disabled={!editable}>{attributeName}</LogicRowSticker>\n {operator}\n {matchLevelName && (\n <LogicRowSticker disabled={!editable}>{matchLevelName}</LogicRowSticker>\n )}\n </>\n )}\n </LogicRuleContainer>\n </LogicListBoxItem>\n );\n};\n\nexport default LogicRow;\n","import BaseListBox, { useListBoxContext } from './ListBox';\nimport LogicRow from './LogicRow';\n\nconst ListBox = Object.assign(BaseListBox, { LogicRow });\n\nexport { ListBox, useListBoxContext };\nexport type { ListBoxProps, ListBoxItemProps } from './ListBox';\nexport type { LogicRowProps } from './LogicRow';\n\nexport default ListBox;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAM,qBAAqB,UAA6C;CACtE,MAAM,SAAS,eAAe,MAAM;AACpC,QAAO,SACH,UAAU,OAAO,eAAe,OAAO,UAAU,GACjD,MAAM,MAAM,WAAW;;AAG7B,MAAM,uBAAuB,UAA6C;CACxE,MAAM,SAAS,eAAe,MAAM;AAEpC,QAAO,SACH,WAAW,OAAO,eAAe,OAAO,WAAW,OAAO,eAAe,GACzE,MAAM,MAAM,WAAW;;AAU7B,MAAM,iBAAiB,cAA0C,KAAK;;;;AAKtE,MAAa,0BAA0B;AACrC,QAAO,WAAW,eAAe;;AAkEnC,MAAM,gBAAgB,OAAO,SAAS;KAKjC,EAAE,YAAa,UAAU,OAAO,gBAAgB,KAAK,gBAAgB,GAAI;;;iBAG7D,EAAE,YAAY,cAAc,OAAO,kBAAkB,MAAM,kBAAkB,CAAC;mBAC5E,aAAa,GAAG;uBACZ,EAAE,YAAY,cAAc,OAAO,gBAAgB,MAAM,cAAc,CAAC;aAClF,QAAQ,GAAG;;KAEnB,EAAE,iBACH,cAAc,QACd,GAAG;oBACa,OAAO,eAAe,WAAW,GAAG,WAAW,MAAM,WAAW;;QAE5E,kBAAkB;MACpB;;KAED,EAAE,gBACH,CAAC,aACD,GAAG;;MAED;;AAGN,MAAM,sBAAsB,OAAO,cAAc;;iBAEhC,EAAE,YAAY,cAAc,OAAO,gBAAgB,MAAM,MAAM,KAAK,MAAM,CAAC;;AAG5F,MAAM,oBAAoB,OAAO,MAA+B;KAC3D,EAAE,YAAa,UAAU,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vB,MAAM,UAAU,OAAO,OAAOC,WAAa,EAAE,UAAU,CAAC"}
|
package/dist/ListBox.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as useListBoxContext, n as ListBoxItemProps, r as ListBoxProps, t as ListBox } from "./ListBox-
|
|
1
|
+
import { i as useListBoxContext, n as ListBoxItemProps, r as ListBoxProps, t as ListBox } from "./ListBox-DIk8suJM.mjs";
|
|
2
2
|
export { ListBox, ListBox as default, ListBoxItemProps, ListBoxProps, useListBoxContext };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as MenuItemProps } from "./Menu-
|
|
2
|
-
import { o as ImplementsFormField } from "./inputFields-
|
|
3
|
-
import { r as ListBoxProps } from "./ListBox-
|
|
1
|
+
import { l as MenuItemProps } from "./Menu-CrThaUX2.mjs";
|
|
2
|
+
import { o as ImplementsFormField } from "./inputFields-DVLg_2wz.mjs";
|
|
3
|
+
import { r as ListBoxProps } from "./ListBox-DIk8suJM.mjs";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
6
|
|
|
@@ -48,4 +48,4 @@ declare const ListBoxField: <T extends object>({
|
|
|
48
48
|
}: ListBoxFieldProps<T>) => _$react_jsx_runtime0.JSX.Element;
|
|
49
49
|
//#endregion
|
|
50
50
|
export { ListBoxField as t };
|
|
51
|
-
//# sourceMappingURL=ListBoxField-
|
|
51
|
+
//# sourceMappingURL=ListBoxField-DF8rqPsu.d.mts.map
|
package/dist/ListBoxField.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ListBoxField } from "./ListBoxField-
|
|
1
|
+
import { t as ListBoxField } from "./ListBoxField-DF8rqPsu.mjs";
|
|
2
2
|
export { ListBoxField as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as InputSizes } from "./input-CKhARTlS.mjs";
|
|
2
|
-
import { n as ListBoxItemProps } from "./ListBox-
|
|
2
|
+
import { n as ListBoxItemProps } from "./ListBox-DIk8suJM.mjs";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
|
|
@@ -37,4 +37,4 @@ declare const LogicRow: ({
|
|
|
37
37
|
}: LogicRowProps) => _$react_jsx_runtime0.JSX.Element;
|
|
38
38
|
//#endregion
|
|
39
39
|
export { LogicRowProps as n, LogicRow as t };
|
|
40
|
-
//# sourceMappingURL=LogicRow-
|
|
40
|
+
//# sourceMappingURL=LogicRow-uxpe1vZ1.d.mts.map
|
package/dist/LogicRow.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as LogicRowProps, t as LogicRow } from "./LogicRow-
|
|
1
|
+
import { n as LogicRowProps, t as LogicRow } from "./LogicRow-uxpe1vZ1.mjs";
|
|
2
2
|
export { LogicRowProps, LogicRow as default };
|
package/dist/MaskedInput.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { IMaskInputProps } from "react-imask/mixin";
|
|
|
4
4
|
|
|
5
5
|
//#region components/MaskedInput/MaskedInput.d.ts
|
|
6
6
|
type MaskedInputProps = Omit<IMaskInputProps<HTMLInputElement>, 'inputRef' | 'componentProps' | 'size' | 'ref'> & InputProps;
|
|
7
|
-
declare const MaskedInput: _$react.ForwardRefExoticComponent<Omit<IMaskInputProps<HTMLInputElement>, "
|
|
7
|
+
declare const MaskedInput: _$react.ForwardRefExoticComponent<Omit<IMaskInputProps<HTMLInputElement>, "ref" | "size" | "inputRef" | "componentProps"> & InputProps & _$react.RefAttributes<HTMLInputElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { MaskedInput, MaskedInput as default, MaskedInputProps };
|
|
10
10
|
//# sourceMappingURL=MaskedInput.d.mts.map
|
|
@@ -22,7 +22,7 @@ interface MenuItemProps<T extends ElementType = 'div'> {
|
|
|
22
22
|
selected?: boolean;
|
|
23
23
|
size?: 'sm' | 'md';
|
|
24
24
|
}
|
|
25
|
-
declare const ListItem: StyledComponent<"li", any, Pick<MenuItemProps<"div">, "
|
|
25
|
+
declare const ListItem: StyledComponent<"li", any, Pick<MenuItemProps<"div">, "variant" | "disabled" | "size" | "selected" | "focused">, never>;
|
|
26
26
|
declare const IconContainer: StyledComponent<"div", any, {
|
|
27
27
|
suffix?: boolean;
|
|
28
28
|
}, never>;
|
|
@@ -67,4 +67,4 @@ declare const Menu: {
|
|
|
67
67
|
};
|
|
68
68
|
//#endregion
|
|
69
69
|
export { MenuDivider as a, MenuItem as c, MenuList as d, MenuProps as f, Menu as i, MenuItemProps as l, IconContainer as n, MenuHeading as o, ListItem as r, MenuHeadingProps as s, FloatingCard as t, MenuItemType as u };
|
|
70
|
-
//# sourceMappingURL=Menu-
|
|
70
|
+
//# sourceMappingURL=Menu-CrThaUX2.d.mts.map
|
package/dist/Menu.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MenuDivider, c as MenuItem, d as MenuList, f as MenuProps, i as Menu, l as MenuItemProps, n as IconContainer, o as MenuHeading, r as ListItem, s as MenuHeadingProps, t as FloatingCard, u as MenuItemType } from "./Menu-
|
|
1
|
+
import { a as MenuDivider, c as MenuItem, d as MenuList, f as MenuProps, i as Menu, l as MenuItemProps, n as IconContainer, o as MenuHeading, r as ListItem, s as MenuHeadingProps, t as FloatingCard, u as MenuItemType } from "./Menu-CrThaUX2.mjs";
|
|
2
2
|
export { FloatingCard, IconContainer, ListItem, Menu, Menu as default, MenuDivider, MenuHeading, MenuHeadingProps, MenuItem, MenuItemProps, MenuItemType, MenuList, MenuProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as FilterSize } from "./types-
|
|
1
|
+
import { p as FilterSize } from "./types-EodOhsjw.mjs";
|
|
2
2
|
import * as _$react from "react";
|
|
3
3
|
import { HTMLAttributes, ReactNode } from "react";
|
|
4
4
|
|
|
@@ -82,4 +82,4 @@ interface PillShellProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'onClick'
|
|
|
82
82
|
declare const PillShell: _$react.ForwardRefExoticComponent<PillShellProps & _$react.RefAttributes<HTMLSpanElement>>;
|
|
83
83
|
//#endregion
|
|
84
84
|
export { PillShellProps as n, PillShell as t };
|
|
85
|
-
//# sourceMappingURL=PillShell-
|
|
85
|
+
//# sourceMappingURL=PillShell-DqglbFHe.d.mts.map
|
package/dist/PillShell.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as PillShellProps, t as PillShell } from "./PillShell-
|
|
1
|
+
import { n as PillShellProps, t as PillShell } from "./PillShell-DqglbFHe.mjs";
|
|
2
2
|
export { PillShellProps, PillShell as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio-
|
|
1
|
+
{"version":3,"file":"Radio-BstZg3DI.mjs","names":[],"sources":["../components/Radio/Radio.tsx"],"sourcesContent":["import { uniqueId } from 'lodash-es';\nimport {\n type ChangeEvent,\n type ComponentPropsWithoutRef,\n forwardRef,\n type ReactNode,\n useMemo,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing, Typography } from '@persona/design-tokens';\nimport useFormField from 'design-system/components/FormControl/useFormField';\nimport { opacityOf } from 'design-system/lib/color';\nimport {\n isChecked,\n isDisabled,\n isFocusedVisible,\n isHovered,\n isNotDisabled,\n} from 'design-system/lib/pseudoClass';\nimport { semanticColor, semanticOnly } from 'design-system/lib/semanticColor';\nimport { focusStyle } from 'design-system/mixins/focus';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst Container = styled.div<{ size: 'md' | 'sm'; disabled?: boolean }>`\n cursor: pointer;\n display: flex;\n align-items: flex-start;\n flex-wrap: nowrap;\n position: relative;\n\n ${({ size }) =>\n size === 'sm' &&\n css`\n align-items: center;\n height: 16px;\n `}\n\n &${isDisabled} {\n cursor: default;\n }\n`;\n\nconst Label = styled.label<{ disabled: boolean; size: 'md' | 'sm' }>`\n cursor: inherit;\n padding: 0 ${Spacing[2]};\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', Color.TextSecondary)};\n\n ${({ size }) =>\n size === 'sm'\n ? css`\n ${Typography.TextSmall};\n line-height: 16px;\n `\n : css`\n ${Typography.TextMedium};\n `}\n\n ${({ theme, disabled }) =>\n disabled &&\n css`\n cursor: default;\n color: ${semanticColor(theme, 'FgDisabled', theme.color.text.disabled)};\n `}\n`;\n\nconst RadioCircle = styled.div<{ size: 'md' | 'sm' }>`\n cursor: pointer;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: box-shadow ${TransitionDuration.Fast};\n border-radius: 100%;\n height: ${Spacing[4]};\n width: ${Spacing[4]};\n flex: 0 0 16px;\n box-sizing: border-box;\n margin-top: ${({ size }) => (size === 'sm' ? 0 : '2px')};\n border: 1px solid ${({ theme }) => semanticColor(theme, 'InputBorderStrong', Color.BorderInputCheckbox)};\n background: ${({ theme }) => semanticColor(theme, 'InputSurfaceDefault', Color.PrimaryWhite)};\n`;\n\nconst RadioInput = styled.input<{ $size: 'md' | 'sm' }>`\n cursor: inherit;\n height: ${Spacing[4]};\n width: ${Spacing[4]};\n margin: 0;\n border: 0;\n opacity: 0;\n overflow: hidden;\n position: absolute;\n top: ${({ $size }) => ($size === 'sm' ? 0 : '2px')};\n border-radius: 100%;\n z-index: 10; // this needs to be above the dot in the checked input\n\n &${isHovered}${isNotDisabled} ~ ${RadioCircle} {\n border-color: ${({ theme }) =>\n semanticColor(theme, 'InputBorderHoverStrong', Color.BorderInputCheckboxHover)};\n ${semanticOnly((tokens) => `background: ${tokens.InputSurfaceHover};`)}\n }\n\n &${isChecked}, &:checked {\n &${isHovered}${isNotDisabled} ~ ${RadioCircle} {\n background: ${({ theme }) => semanticColor(theme, 'InputSurfaceAccentHover', Color.BackgroundInputActiveHover)};\n border-color: ${({ theme }) => semanticColor(theme, 'InputSurfaceAccentHover', Color.BackgroundInputActiveHover)};\n }\n }\n\n &${isFocusedVisible}${isNotDisabled} ~ ${RadioCircle} {\n ${focusStyle}\n }\n\n // RadioCircle state styles; Uses pure CSS\n &${isDisabled} + ${RadioCircle} {\n cursor: default;\n background: ${({ theme }) =>\n semanticColor(theme, 'InputSurfaceDisabled', Color.BackgroundInputDisabled)};\n border-color: ${({ theme }) =>\n semanticColor(theme, 'InputBorderDisabled', Color.BorderInputDisabled)};\n ${semanticOnly((tokens) => `opacity: ${opacityOf(tokens.Opacity65)};`)}\n }\n\n &:checked + ${RadioCircle}, &${isChecked} + ${RadioCircle} {\n border-color: ${({ theme }) => semanticColor(theme, 'InputBorderAccent', Color.BackgroundInputActive)};\n background: ${({ theme }) => semanticColor(theme, 'InputSurfaceAccent', Color.BackgroundInputActive)};\n\n &::after {\n background: ${({ theme }) => semanticColor(theme, 'FgInverseStatic', Color.BackgroundInputDefault)};\n height: 6px;\n width: 6px;\n border-radius: 100%;\n content: '';\n position: absolute;\n }\n }\n\n &:checked${isDisabled} + ${RadioCircle}, &${isChecked}${isDisabled} + ${RadioCircle} {\n border-color: ${({ theme }) => semanticColor(theme, 'InputSurfaceAccentDisabled', Color.BackgroundInputActiveDisabled)};\n background: ${({ theme }) => semanticColor(theme, 'InputSurfaceAccentDisabled', Color.BackgroundInputActiveDisabled)};\n }\n`;\n\nexport interface RadioProps extends Omit<ComponentPropsWithoutRef<'input'>, 'size'> {\n /**\n * If not provided, a unique ID will be generated.\n */\n id?: string;\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n label?: ReactNode;\n disabled?: boolean;\n checked?: boolean;\n value: string;\n 'data-test'?: string;\n size?: 'md' | 'sm';\n}\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n {\n id,\n label,\n className,\n value,\n disabled,\n checked,\n defaultChecked,\n onChange,\n 'data-test': dataTest,\n size = 'md',\n ...elemProps\n },\n ref,\n) {\n const field = useFormField({ disabled });\n const generatedId = useMemo(() => uniqueId('pds_radio__'), []);\n\n return (\n <Container className={className} disabled={disabled} data-test={dataTest} size={size}>\n <RadioInput\n id={id || generatedId}\n disabled={field.disabled}\n onChange={onChange}\n type='radio'\n value={value}\n checked={checked}\n defaultChecked={defaultChecked}\n ref={ref}\n $size={size}\n {...elemProps}\n />\n <RadioCircle size={size} />\n {label && (\n <Label htmlFor={id || generatedId} disabled={disabled ?? false} size={size}>\n {label}\n </Label>\n )}\n </Container>\n );\n});\n\nexport default Radio;\n"],"mappings":";;;;;;;;;;;;AAwBA,MAAM,YAAY,OAAO,GAA8C;;;;;;;KAOlE,EAAE,WACH,SAAS,QACT,GAAG;;;MAGD;;KAED,WAAW;;;;AAKhB,MAAM,QAAQ,OAAO,KAA+C;;eAErD,QAAQ,GAAG;YACd,EAAE,YAAY,cAAc,OAAO,eAAe,MAAM,cAAc,CAAC;;KAE9E,EAAE,WACH,SAAS,OACL,GAAG;YACC,WAAW,UAAU;;YAGzB,GAAG;YACC,WAAW,WAAW;UACxB;;KAEL,EAAE,OAAO,eACV,YACA,GAAG;;eAEQ,cAAc,OAAO,cAAc,MAAM,MAAM,KAAK,SAAS,CAAC;MACvE;;AAGN,MAAM,cAAc,OAAO,GAA0B;;;;;mCAKF;;YAEvC,QAAQ,GAAG;WACZ,QAAQ,GAAG;;;iBAGL,EAAE,WAAY,SAAS,OAAO,IAAI,MAAO;uBACnC,EAAE,YAAY,cAAc,OAAO,qBAAqB,MAAM,oBAAoB,CAAC;iBACzF,EAAE,YAAY,cAAc,OAAO,uBAAuB,MAAM,aAAa,CAAC;;AAG/F,MAAM,aAAa,OAAO,KAA6B;;YAE3C,QAAQ,GAAG;WACZ,QAAQ,GAAG;;;;;;UAMZ,EAAE,YAAa,UAAU,OAAO,IAAI,MAAO;;;;KAIhD,YAAY,cAAc,KAAK,YAAY;qBAC3B,EAAE,YACjB,cAAc,OAAO,0BAA0B,MAAM,yBAAyB,CAAC;MAC/E,cAAc,WAAW,eAAe,OAAO,kBAAkB,GAAG,CAAC;;;KAGtE,UAAU;OACR,YAAY,cAAc,KAAK,YAAY;qBAC7B,EAAE,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,SACC,oBAAC,OAAD;IAAO,SAAS,MAAM;IAAa,UAAU,YAAY;IAAa;cACnE;IACK,CAAA;GAEA;;EAEd"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as styled, r as css } from "./styledComponentsInterop-NxwFjeA4.mjs";
|
|
2
2
|
import useControlled from "./lib/useControlled.mjs";
|
|
3
|
-
import { t as Radio } from "./Radio-
|
|
3
|
+
import { t as Radio } from "./Radio-BstZg3DI.mjs";
|
|
4
4
|
import { Spacing } from "@persona/design-tokens";
|
|
5
5
|
import { Children, cloneElement } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -47,4 +47,4 @@ const RadioGroup = ({ children, defaultValue, name, value: valueProp, onChange,
|
|
|
47
47
|
//#endregion
|
|
48
48
|
export { RadioGroup as t };
|
|
49
49
|
|
|
50
|
-
//# sourceMappingURL=RadioGroup-
|
|
50
|
+
//# sourceMappingURL=RadioGroup-erKerwSt.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup-
|
|
1
|
+
{"version":3,"file":"RadioGroup-erKerwSt.mjs","names":[],"sources":["../components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import {\n type ChangeEvent,\n Children,\n cloneElement,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type VFC,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\nimport Radio, { type RadioProps } from 'design-system/components/Radio';\nimport useControlled from 'design-system/lib/useControlled';\n\nconst Container = styled.div<{ size: 'md' | 'sm'; horizontal?: boolean }>`\n & > div {\n margin-bottom: ${Spacing[2]};\n }\n\n ${({ horizontal }) =>\n horizontal &&\n css`\n display: flex;\n align-items: center;\n & > div {\n margin-right: ${Spacing[2]};\n }\n `}\n`;\n\nexport interface RadioGroupProps extends ComponentPropsWithoutRef<'div'> {\n defaultValue?: any;\n name?: string;\n value?: any;\n onChange?: (value: any) => void;\n /**\n * Direction of radio group\n */\n horizontal?: boolean;\n /**\n * Size of radio buttons within the group\n */\n size?: 'md' | 'sm';\n}\n\nexport const RadioGroup: VFC<RadioGroupProps> = ({\n children,\n defaultValue,\n name,\n value: valueProp,\n onChange,\n horizontal = false,\n size = 'md',\n ...elemProps\n}) => {\n const [value, setValue] = useControlled({\n controlledValue: valueProp,\n default: defaultValue,\n });\n\n return (\n <Container role='radiogroup' horizontal={horizontal} size={size} {...elemProps}>\n {/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */}\n {Children.map(children, (child: ReactElement<RadioProps>) => {\n if (child?.type === Radio && (typeof valueProp !== 'undefined' || onChange)) {\n return cloneElement(child, {\n name,\n size,\n checked: child.props.value === value,\n onChange: (e: ChangeEvent<HTMLInputElement>) => {\n const newVal = e.target.value;\n if (typeof valueProp !== 'undefined' && onChange) {\n onChange(newVal);\n } else {\n setValue(newVal);\n }\n },\n });\n }\n\n if (name) {\n return cloneElement(child, { name });\n }\n\n return child;\n })}\n </Container>\n );\n};\n\nexport default RadioGroup;\n"],"mappings":";;;;;;;AAcA,MAAM,YAAY,OAAO,GAAgD;;qBAEpD,QAAQ,GAAG;;;KAG3B,EAAE,iBACH,cACA,GAAG;;;;wBAIiB,QAAQ,GAAG;;MAE7B;;AAkBN,MAAa,cAAoC,EAC/C,UACA,cACA,MACA,OAAO,WACP,UACA,aAAa,OACb,OAAO,MACP,GAAG,gBACC;CACJ,MAAM,CAAC,OAAO,YAAY,cAAc;EACtC,iBAAiB;EACjB,SAAS;EACV,CAAC;AAEF,QACE,oBAAC,WAAD;EAAW,MAAK;EAAyB;EAAkB;EAAM,GAAI;YAElE,SAAS,IAAI,WAAW,UAAoC;AAC3D,OAAI,OAAO,SAAS,UAAU,OAAO,cAAc,eAAe,UAChE,QAAO,aAAa,OAAO;IACzB;IACA;IACA,SAAS,MAAM,MAAM,UAAU;IAC/B,WAAW,MAAqC;KAC9C,MAAM,SAAS,EAAE,OAAO;AACxB,SAAI,OAAO,cAAc,eAAe,SACtC,UAAS,OAAO;SAEhB,UAAS,OAAO;;IAGrB,CAAC;AAGJ,OAAI,KACF,QAAO,aAAa,OAAO,EAAE,MAAM,CAAC;AAGtC,UAAO;IACP;EACQ,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as DateFilterPreset } from "./types-
|
|
1
|
+
import { a as DateFilterPreset } from "./types-39QvBZuZ.mjs";
|
|
2
2
|
import { Ref } from "react";
|
|
3
3
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
import { DateRange, RangeCalendarProps } from "react-aria";
|
|
@@ -37,4 +37,4 @@ declare const RangeCalendar: ({
|
|
|
37
37
|
}: RangeCalendarProps$1) => _$react_jsx_runtime0.JSX.Element;
|
|
38
38
|
//#endregion
|
|
39
39
|
export { RangeCalendarProps$1 as n, RangeCalendar as t };
|
|
40
|
-
//# sourceMappingURL=RangeCalendar-
|
|
40
|
+
//# sourceMappingURL=RangeCalendar-CK5ArbIQ.d.mts.map
|
package/dist/RangeCalendar.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RangeCalendarProps, t as RangeCalendar } from "./RangeCalendar-
|
|
1
|
+
import { n as RangeCalendarProps, t as RangeCalendar } from "./RangeCalendar-CK5ArbIQ.mjs";
|
|
2
2
|
export { RangeCalendarProps, RangeCalendar as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as DateFilterPreset } from "./types-
|
|
1
|
+
import { a as DateFilterPreset } from "./types-39QvBZuZ.mjs";
|
|
2
2
|
import * as _$react from "react";
|
|
3
3
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
import { RangeCalendarState } from "react-stately";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as FilterRuleValue, f as FilterRuleValueChange, l as FilterOperator, o as FilterField, p as FilterSize, u as FilterRule } from "./types-
|
|
2
|
-
import { t as FieldRegistry } from "./FieldRegistry-
|
|
1
|
+
import { d as FilterRuleValue, f as FilterRuleValueChange, l as FilterOperator, o as FilterField, p as FilterSize, u as FilterRule } from "./types-EodOhsjw.mjs";
|
|
2
|
+
import { t as FieldRegistry } from "./FieldRegistry-B5E-GN91.mjs";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
|
package/dist/RulesPill.d.mts
CHANGED
|
@@ -117,4 +117,4 @@ const SegmentedControlItem = forwardRef(function SegmentedControlItem({ disabled
|
|
|
117
117
|
//#endregion
|
|
118
118
|
export { SegmentedControlItem as n, SegmentedControl as t };
|
|
119
119
|
|
|
120
|
-
//# sourceMappingURL=SegmentedControl-
|
|
120
|
+
//# sourceMappingURL=SegmentedControl-DQjIO6iX.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl-
|
|
1
|
+
{"version":3,"file":"SegmentedControl-DQjIO6iX.mjs","names":[],"sources":["../components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n type Key,\n type ReactNode,\n useContext,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport { ToggleButton, ToggleButtonGroup, type ToggleButtonProps } from 'react-aria-components';\nimport styled from 'styled-components';\n\nimport { BorderRadius, Spacing } from '@persona/design-tokens';\nimport useFormField from 'design-system/components/FormControl/useFormField';\nimport { semanticColor } from 'design-system/lib/semanticColor';\nimport { paragraphMixins } from 'design-system/mixins/text';\n\nconst SegmentedControlSizeContext = createContext<'sm' | 'md'>('md');\n\nexport interface SegmentedControlProps {\n id?: string;\n className?: string;\n\n /**\n * Current selected key (controlled)\n */\n selectedKey?: Key;\n\n /**\n * Default selected key (uncontrolled)\n */\n defaultSelectedKey?: Key;\n\n /**\n * Callback when selection changes\n */\n onSelectionChange?: (key: Key) => void;\n\n /**\n * Whether the entire component is disabled\n */\n disabled?: boolean;\n\n /**\n * Whether the component should take full width\n */\n fullWidth?: boolean;\n\n /**\n * Size of the segmented control\n */\n size?: 'sm' | 'md';\n\n /**\n * Accessible label for the group\n */\n 'aria-label'?: string;\n 'aria-required'?: boolean;\n\n /**\n * Segment components\n */\n children: ReactNode;\n}\n\ninterface StyledSegmentedControlProps {\n id?: string;\n $fullWidth?: boolean;\n $size?: 'sm' | 'md';\n}\n\nconst StyledSegmentedControl = styled(ToggleButtonGroup)<StyledSegmentedControlProps>`\n display: inline-flex;\n background-color: ${({ theme }) =>\n semanticColor(theme, 'ActionNeutral', theme.color.variants.basic.default)};\n border-radius: 5px;\n padding: 1px;\n width: ${({ $fullWidth }) => ($fullWidth ? '100%' : 'auto')};\n height: ${({ $size = 'md' }) => ($size === 'sm' ? '20px' : '24px')};\n`;\n\n/**\n * A segmented control component that allows users to select between multiple options.\n * Built with React Aria for accessibility and keyboard navigation.\n */\nexport const SegmentedControl = forwardRef<HTMLDivElement, SegmentedControlProps>(\n function SegmentedControl(\n {\n id,\n selectedKey,\n defaultSelectedKey,\n onSelectionChange,\n disabled,\n fullWidth = false,\n size = 'md',\n className,\n 'aria-label': ariaLabel,\n 'aria-required': ariaRequired,\n children,\n ...props\n },\n ref,\n ) {\n const field = useFormField({ inputId: id, disabled });\n const segmentedControlRef = useRef<HTMLDivElement>(null);\n const isRequired = ariaRequired;\n\n useImperativeHandle(ref, () => segmentedControlRef.current!, []);\n // react-aria-components filters aria-required from DOM props, so it is applied imperatively.\n useEffect(() => {\n if (isRequired) {\n segmentedControlRef.current?.setAttribute('aria-required', 'true');\n } else {\n segmentedControlRef.current?.removeAttribute('aria-required');\n }\n }, [isRequired]);\n\n return (\n <SegmentedControlSizeContext.Provider value={size}>\n <StyledSegmentedControl\n ref={segmentedControlRef}\n className={className}\n selectionMode='single'\n selectedKeys={selectedKey ? [selectedKey] : undefined}\n defaultSelectedKeys={defaultSelectedKey ? [defaultSelectedKey] : undefined}\n onSelectionChange={(keys) => {\n const key = Array.from(keys)[0];\n if (key && onSelectionChange) {\n onSelectionChange(key);\n }\n }}\n isDisabled={field.disabled}\n aria-label={ariaLabel}\n aria-labelledby={field.labelId}\n aria-describedby={field.helperTextId}\n aria-errormessage={field.hasError ? field.helperTextId : undefined}\n aria-invalid={field.hasError}\n $fullWidth={fullWidth}\n $size={size}\n {...props}\n id={field.inputId}\n >\n {children}\n </StyledSegmentedControl>\n </SegmentedControlSizeContext.Provider>\n );\n },\n);\n\nconst StyledSegment = styled(ToggleButton)<{ $size?: 'sm' | 'md' }>`\n ${paragraphMixins.sm};\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: transparent;\n border: none;\n border-radius: ${BorderRadius.Md};\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', theme.color.text.secondary)};\n cursor: pointer;\n flex: 1;\n line-height: 1;\n\n & * {\n cursor: inherit;\n }\n padding: 0 ${({ $size = 'md' }) => ($size === 'sm' ? Spacing[1] : Spacing[2])};\n position: relative;\n transition: all 0.15s ease-in-out;\n white-space: nowrap;\n\n /* Hover state */\n &[data-hovered] {\n background-color: ${({ theme }) => semanticColor(theme, 'ActionNeutralHover', theme.color.variants.basic.hover)};\n }\n\n /* Selected state */\n &[data-selected] {\n background-color: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', theme.color.primary.white)};\n box-shadow: inset 0 0 0 1px ${({ theme }) => semanticColor(theme, 'BorderDefault', theme.color.border.input)};\n color: ${({ theme }) => semanticColor(theme, 'FgPrimary', theme.color.text.primary)};\n }\n\n /* Disabled state */\n &[data-disabled] {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Remove focus outline unless we're using a keyboard */\n &[data-focused]:not([data-focus-visible]) {\n outline: none;\n }\n`;\n\nexport interface SegmentedControlItemProps extends Omit<\n ToggleButtonProps,\n 'isDisabled' | 'style' | 'isSelected' | 'defaultSelected'\n> {\n /**\n * Whether this control item is disabled\n */\n disabled?: boolean;\n}\n\n/**\n * A segment item component for use within SegmentedControl.\n */\nconst SegmentedControlItem = forwardRef<HTMLButtonElement, SegmentedControlItemProps>(\n function SegmentedControlItem({ disabled, children, ...props }, ref) {\n const size = useContext(SegmentedControlSizeContext);\n return (\n <StyledSegment ref={ref} isDisabled={disabled} $size={size} {...props}>\n {children}\n </StyledSegment>\n );\n },\n);\n\nexport default SegmentedControl;\nexport { SegmentedControlItem };\n"],"mappings":";;;;;;;;;AAkBA,MAAM,8BAA8B,cAA2B,KAAK;AAsDpE,MAAM,yBAAyB,OAAO,kBAAkB;;uBAEjC,EAAE,YACrB,cAAc,OAAO,iBAAiB,MAAM,MAAM,SAAS,MAAM,QAAQ,CAAC;;;YAGlE,EAAE,iBAAkB,aAAa,SAAS,OAAQ;aACjD,EAAE,QAAQ,WAAY,UAAU,OAAO,SAAS,OAAQ;;;;;;AAOrE,MAAa,mBAAmB,WAC9B,SAAS,iBACP,EACE,IACA,aACA,oBACA,mBACA,UACA,YAAY,OACZ,OAAO,MACP,WACA,cAAc,WACd,iBAAiB,cACjB,UACA,GAAG,SAEL,KACA;CACA,MAAM,QAAQ,aAAa;EAAE,SAAS;EAAI;EAAU,CAAC;CACrD,MAAM,sBAAsB,OAAuB,KAAK;CACxD,MAAM,aAAa;AAEnB,qBAAoB,WAAW,oBAAoB,SAAU,EAAE,CAAC;AAEhE,iBAAgB;AACd,MAAI,WACF,qBAAoB,SAAS,aAAa,iBAAiB,OAAO;MAElE,qBAAoB,SAAS,gBAAgB,gBAAgB;IAE9D,CAAC,WAAW,CAAC;AAEhB,QACE,oBAAC,4BAA4B,UAA7B;EAAsC,OAAO;YAC3C,oBAAC,wBAAD;GACE,KAAK;GACM;GACX,eAAc;GACd,cAAc,cAAc,CAAC,YAAY,GAAG,KAAA;GAC5C,qBAAqB,qBAAqB,CAAC,mBAAmB,GAAG,KAAA;GACjE,oBAAoB,SAAS;IAC3B,MAAM,MAAM,MAAM,KAAK,KAAK,CAAC;AAC7B,QAAI,OAAO,kBACT,mBAAkB,IAAI;;GAG1B,YAAY,MAAM;GAClB,cAAY;GACZ,mBAAiB,MAAM;GACvB,oBAAkB,MAAM;GACxB,qBAAmB,MAAM,WAAW,MAAM,eAAe,KAAA;GACzD,gBAAc,MAAM;GACpB,YAAY;GACZ,OAAO;GACP,GAAI;GACJ,IAAI,MAAM;GAET;GACsB,CAAA;EACY,CAAA;EAG5C;AAED,MAAM,gBAAgB,OAAO,aAAa;IACtC,gBAAgB,GAAG;;;;;;mBAMJ,aAAa,GAAG;YACvB,EAAE,YAAY,cAAc,OAAO,eAAe,MAAM,MAAM,KAAK,UAAU,CAAC;;;;;;;;gBAQ1E,EAAE,QAAQ,WAAY,UAAU,OAAO,QAAQ,KAAK,QAAQ,GAAI;;;;;;;yBAOvD,EAAE,YAAY,cAAc,OAAO,sBAAsB,MAAM,MAAM,SAAS,MAAM,MAAM,CAAC;;;;;yBAK3F,EAAE,YAAY,cAAc,OAAO,kBAAkB,MAAM,MAAM,QAAQ,MAAM,CAAC;mCACtE,EAAE,YAAY,cAAc,OAAO,iBAAiB,MAAM,MAAM,OAAO,MAAM,CAAC;cACnG,EAAE,YAAY,cAAc,OAAO,aAAa,MAAM,MAAM,KAAK,QAAQ,CAAC;;;;;;;;;;;;;;;;;AA4BxF,MAAM,uBAAuB,WAC3B,SAAS,qBAAqB,EAAE,UAAU,UAAU,GAAG,SAAS,KAAK;AAEnE,QACE,oBAAC,eAAD;EAAoB;EAAK,YAAY;EAAU,OAFpC,WAAW,4BAEoC;EAAE,GAAI;EAC7D;EACa,CAAA;EAGrB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as MenuItemProps } from "./Menu-
|
|
1
|
+
import { l as MenuItemProps } from "./Menu-CrThaUX2.mjs";
|
|
2
2
|
import { n as InputSizes, t as InputMixinProps } from "./input-CKhARTlS.mjs";
|
|
3
3
|
import * as _$react from "react";
|
|
4
4
|
import { ReactNode } from "react";
|
|
@@ -80,4 +80,4 @@ declare const Select: _$react.ForwardRefExoticComponent<SelectProps & _$react.Re
|
|
|
80
80
|
declare const Option: _$react.ForwardRefExoticComponent<SelectPrimitive.SelectItemProps & MenuItemProps<"div"> & _$react.RefAttributes<HTMLDivElement>>;
|
|
81
81
|
//#endregion
|
|
82
82
|
export { SelectProps as i, Select as n, SelectHeader as r, Option as t };
|
|
83
|
-
//# sourceMappingURL=Select-
|
|
83
|
+
//# sourceMappingURL=Select-CsxK6A5m.d.mts.map
|
package/dist/Select.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as SelectProps, n as Select, r as SelectHeader, t as Option } from "./Select-
|
|
1
|
+
import { i as SelectProps, n as Select, r as SelectHeader, t as Option } from "./Select-CsxK6A5m.mjs";
|
|
2
2
|
export { Option, Select, Select as default, SelectHeader, SelectProps };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as ASTNode } from "./types-DfpVVjso.mjs";
|
|
2
|
-
import { dt as ObjectSchemaMap, n as JsonSchema, st as FunctionJsonSchema } from "./jsonSchema-
|
|
3
|
-
import { n as PossibleChainSchema, t as ChainRoot } from "./chainTypes-
|
|
4
|
-
import { a as Mode, i as FunctionFormRenderProps, n as CustomFunctionDetailRenderProps, s as PopoverFooterRenderer, t as CodeChainFunctionPanelRenderProps, u as ValueType } from "./types-
|
|
5
|
-
import { n as useChain } from "./useChain-
|
|
6
|
-
import { t as ContextMenuExamples } from "./listbox-options-
|
|
2
|
+
import { dt as ObjectSchemaMap, n as JsonSchema, st as FunctionJsonSchema } from "./jsonSchema-DmOA0Lnu.mjs";
|
|
3
|
+
import { n as PossibleChainSchema, t as ChainRoot } from "./chainTypes-Cjp0zZ4E.mjs";
|
|
4
|
+
import { a as Mode, i as FunctionFormRenderProps, n as CustomFunctionDetailRenderProps, s as PopoverFooterRenderer, t as CodeChainFunctionPanelRenderProps, u as ValueType } from "./types-DWU0Dmy9.mjs";
|
|
5
|
+
import { n as useChain } from "./useChain-DXkKKe-J.mjs";
|
|
6
|
+
import { t as ContextMenuExamples } from "./listbox-options-DCmqWWgy.mjs";
|
|
7
7
|
import { ReactNode } from "react";
|
|
8
8
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
9
9
|
|
|
@@ -59,6 +59,23 @@ interface SmartTextInputProps {
|
|
|
59
59
|
*/
|
|
60
60
|
portalContainerRef?: HTMLElement | null;
|
|
61
61
|
creatable?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Renders the parameter form inside the function dialog — the popup shown when the cursor is
|
|
64
|
+
* inside a parameterised call such as `convert_to(...)`.
|
|
65
|
+
*
|
|
66
|
+
* **REQUIRED for method-chain mode** (`ValueType.MethodChain`, or `{{...}}` expressions in
|
|
67
|
+
* Interpolation mode). PDS deliberately does not build this form so that data fetching and
|
|
68
|
+
* permission checks stay in the consuming app; without it the dialog shows only the function
|
|
69
|
+
* name over an empty body, which looks like the popup never opened. A `console.warn` is logged in
|
|
70
|
+
* development when that happens.
|
|
71
|
+
*
|
|
72
|
+
* Receives {@link FunctionFormRenderProps} (`functionName`, `schema`, `parentItemSchema`,
|
|
73
|
+
* `receiverSchema`, `defaultParameters`, `chainRoots`, `baseId`) and must call `onComplete` with
|
|
74
|
+
* the new method-chain nodes or `onCancel` to close the dialog.
|
|
75
|
+
*
|
|
76
|
+
* Reference implementation: persona-web's `InputMethodChain/FunctionForm.tsx`; dashboard
|
|
77
|
+
* consumers get it pre-wired from `useDashboardSmartTextInputProps`.
|
|
78
|
+
*/
|
|
62
79
|
renderFunctionForm?: (props: FunctionFormRenderProps) => ReactNode;
|
|
63
80
|
renderCustomFunctionDetail?: (props: CustomFunctionDetailRenderProps) => ReactNode;
|
|
64
81
|
renderCodeChainFunctionPanel?: (props: CodeChainFunctionPanelRenderProps) => ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as ImplementsFormField } from "./inputFields-
|
|
2
|
-
import { n as TableBoxField } from "./TableBoxField-
|
|
1
|
+
import { o as ImplementsFormField } from "./inputFields-DVLg_2wz.mjs";
|
|
2
|
+
import { n as TableBoxField } from "./TableBoxField-DR-SJY9z.mjs";
|
|
3
3
|
import SmartTextInput from "./SmartTextInput.mjs";
|
|
4
4
|
import { CSSProperties, ComponentProps } from "react";
|
|
5
5
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as StackProps } from "./Stack-BZyboHQl.mjs";
|
|
2
2
|
import { s as MethodChainNode } from "./methodChainTypes-a7kHYhs7.mjs";
|
|
3
|
-
import { n as PossibleChainSchema, t as ChainRoot } from "./chainTypes-
|
|
4
|
-
import { i as FunctionFormRenderProps, n as CustomFunctionDetailRenderProps, o as OpenCodeChainFunctionPanel, r as FunctionAtCursor } from "./types-
|
|
3
|
+
import { n as PossibleChainSchema, t as ChainRoot } from "./chainTypes-Cjp0zZ4E.mjs";
|
|
4
|
+
import { i as FunctionFormRenderProps, n as CustomFunctionDetailRenderProps, o as OpenCodeChainFunctionPanel, r as FunctionAtCursor } from "./types-DWU0Dmy9.mjs";
|
|
5
5
|
import * as _$styled_components0 from "styled-components";
|
|
6
6
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as Mode } from "./types-
|
|
2
|
-
import { a as SmartTextInputOption } from "./listbox-options-
|
|
1
|
+
import { a as Mode } from "./types-DWU0Dmy9.mjs";
|
|
2
|
+
import { a as SmartTextInputOption } from "./listbox-options-DCmqWWgy.mjs";
|
|
3
3
|
import { ListBoxProps } from "react-aria-components";
|
|
4
4
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
import { ComboBoxState } from "react-stately";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SmartTextInputOption } from "./listbox-options-
|
|
1
|
+
import { a as SmartTextInputOption } from "./listbox-options-DCmqWWgy.mjs";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import * as _$styled_components0 from "styled-components";
|
|
4
4
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ValueControlProps } from "./types-
|
|
1
|
+
import { t as ValueControlProps } from "./types-SOkNtcBq.mjs";
|
|
2
2
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region components/DataTable/TableControls/FiltersV2/value-controls/StringValueControl/StringValueControl.d.ts
|
package/dist/TableBox.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as DragDirection } from "./useTableBoxDragAndDrop-CKPIY98e.mjs";
|
|
2
|
-
import { a as TableBox, i as PinnedActionsCell, o as TableBoxContext, r as InlineEditConfig, s as TableBoxProps } from "./TableBoxCell-
|
|
2
|
+
import { a as TableBox, i as PinnedActionsCell, o as TableBoxContext, r as InlineEditConfig, s as TableBoxProps } from "./TableBoxCell-okcOQ5Ec.mjs";
|
|
3
3
|
export { DragDirection, InlineEditConfig, PinnedActionsCell, TableBoxContext, TableBoxProps, TableBox as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { o as ComboboxOptionsOrGroups } from "./ComboboxBase-
|
|
1
|
+
import { o as ComboboxOptionsOrGroups } from "./ComboboxBase-B7ZcqU9p.mjs";
|
|
2
2
|
import { a as TableCellProps, i as TableCell } from "./TableCell-4u5_BgTC.mjs";
|
|
3
|
-
import { r as TableBoxRowProps } from "./TableBoxRow-
|
|
3
|
+
import { r as TableBoxRowProps } from "./TableBoxRow-DiuAB_rV.mjs";
|
|
4
4
|
import { n as ReorderConfig, t as DragDirection } from "./useTableBoxDragAndDrop-CKPIY98e.mjs";
|
|
5
|
-
import { t as RowAction } from "./TableBoxRowActions-
|
|
5
|
+
import { t as RowAction } from "./TableBoxRowActions-Cm4KJsAD.mjs";
|
|
6
6
|
import * as _$react from "react";
|
|
7
7
|
import { ComponentPropsWithoutRef, PropsWithChildren } from "react";
|
|
8
8
|
import * as _$styled_components0 from "styled-components";
|
|
@@ -273,4 +273,4 @@ declare const TableBoxCell: ({
|
|
|
273
273
|
}: TableBoxCellProps) => _$react_jsx_runtime0.JSX.Element;
|
|
274
274
|
//#endregion
|
|
275
275
|
export { TableBox as a, PinnedActionsCell as i, TableBoxCellProps as n, TableBoxContext as o, InlineEditConfig as r, TableBoxProps as s, TableBoxCell as t };
|
|
276
|
-
//# sourceMappingURL=TableBoxCell-
|
|
276
|
+
//# sourceMappingURL=TableBoxCell-okcOQ5Ec.d.mts.map
|
package/dist/TableBoxCell.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TableBoxCellProps, t as TableBoxCell } from "./TableBoxCell-
|
|
1
|
+
import { n as TableBoxCellProps, t as TableBoxCell } from "./TableBoxCell-okcOQ5Ec.mjs";
|
|
2
2
|
export { TableBoxCellProps, TableBoxCell as default };
|