@persona/design-system 0.7.1 → 0.7.2
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 +17 -0
- package/README.md +9 -9
- package/dist/Accordion.d.mts +38 -0
- package/dist/AccordionItem.d.mts +31 -0
- package/dist/{Action-C7INft7X.d.mts → Action-Cyo6KCsS.d.mts} +3 -3
- package/dist/Action.d.mts +1 -1
- package/dist/AdvancedFilterRuleRow.d.mts +2 -2
- package/dist/AdvancedFilterRulesPopover.d.mts +2 -2
- package/dist/ArrayValueControl.d.mts +1 -1
- package/dist/Attribute.d.mts +3 -3
- package/dist/BooleanValueControl.d.mts +1 -1
- package/dist/{Breadcrumb-DtW1R9xW.d.mts → Breadcrumb-CYXkrKXl.d.mts} +1 -1
- package/dist/Breadcrumb.d.mts +1 -1
- package/dist/{Breadcrumbs-B6JyoS8n.d.mts → Breadcrumbs-CP7eUYUy.d.mts} +2 -2
- package/dist/Breadcrumbs.d.mts +1 -1
- package/dist/{Button-HodDf_bB.d.mts → Button-Dhiund3f.d.mts} +4 -4
- package/dist/Button.d.mts +1 -1
- package/dist/{Calendar-DrdTvzAa.d.mts → Calendar-CMeIZ0BO.d.mts} +1 -1
- package/dist/Calendar.d.mts +1 -1
- package/dist/CalendarBase.d.mts +1 -1
- package/dist/{Card-CpDwATnX.d.mts → Card-DCYB_mtR.d.mts} +3 -3
- package/dist/Card.d.mts +1 -1
- package/dist/{Checkbox-CyWXhuby.mjs → Checkbox-AjL7ucoR.mjs} +2 -2
- package/dist/{Checkbox-CyWXhuby.mjs.map → Checkbox-AjL7ucoR.mjs.map} +1 -1
- package/dist/{Checkbox-C-hMfItK.d.mts → Checkbox-fWj7GkBl.d.mts} +1 -1
- package/dist/Checkbox.d.mts +1 -1
- package/dist/CheckboxGroupField.d.mts +1 -1
- package/dist/ChoicesValueControl.d.mts +1 -1
- package/dist/{Combobox-1M6EwVmq.mjs → Combobox-C2b9u955.mjs} +9 -6
- package/dist/Combobox-C2b9u955.mjs.map +1 -0
- package/dist/{Combobox-DyNllwt8.d.mts → Combobox-CC-Osr57.d.mts} +3 -3
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-B3YqkjQp.d.mts → ComboboxBase-Evo0FRxP.d.mts} +7 -5
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-BuwVssvZ.d.mts → ComboboxMultiSelect-CvAc0FT3.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-gJC4v7ER.d.mts → ComboboxSingleSelect-CBm7x0oh.d.mts} +4 -4
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/{CompactBar-DhHh7Roq.d.mts → CompactBar-D_2qMK4y.d.mts} +3 -3
- package/dist/CompactBar.d.mts +1 -1
- package/dist/{ControlBar-C8kagIck.d.mts → ControlBar-B7j9sOr9.d.mts} +2 -2
- package/dist/ControlBar.d.mts +1 -1
- package/dist/DataTable.d.mts +3 -3
- package/dist/{DateField-2aigfD4u.d.mts → DateField-BamAk9_w.d.mts} +2 -2
- package/dist/DateField.d.mts +1 -1
- package/dist/{DatePicker-DC_RKjdM.d.mts → DatePicker-C3xNSkPG.d.mts} +2 -2
- package/dist/{DatePicker-D9JurBBj.mjs → DatePicker-IgiUI3Wj.mjs} +3 -3
- package/dist/{DatePicker-D9JurBBj.mjs.map → DatePicker-IgiUI3Wj.mjs.map} +1 -1
- package/dist/DatePicker.d.mts +1 -1
- package/dist/{DateRangePicker-ByD6IsLB.d.mts → DateRangePicker-C4QKMo2a.d.mts} +3 -3
- 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 +2 -2
- package/dist/{DropdownMenu-Xl1BYXsY.d.mts → DropdownMenu-DL5ye-0m.d.mts} +2 -2
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{ErrorProps-Dgu98PkH.d.mts → ErrorProps-BA0-m_Wp.d.mts} +1 -1
- package/dist/ErrorProps.d.mts +1 -1
- package/dist/{FieldRegistry-BdtxI1N2.d.mts → FieldRegistry-bKxrF1gC.d.mts} +2 -2
- package/dist/FieldRegistry.d.mts +1 -1
- package/dist/{FilterBar-jYjPeD7F.d.mts → FilterBar-DhlBLWxw.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/{FormControl-CJfYdgZF.d.mts → FormControl-D5xyPkST.d.mts} +6 -2
- package/dist/{FormControl-BEk4F1EV.mjs → FormControl-DnfZTli_.mjs} +25 -10
- package/dist/FormControl-DnfZTli_.mjs.map +1 -0
- package/dist/FormControl.d.mts +1 -1
- package/dist/FormControlLabel.d.mts +1 -1
- package/dist/{FormField-ByT0avVx.mjs → FormField-74TPV8-8.mjs} +27 -17
- package/dist/FormField-74TPV8-8.mjs.map +1 -0
- package/dist/{FormField-CK8o1sMB.d.mts → FormField-BJZUj6jg.d.mts} +4 -2
- package/dist/FormField.d.mts +1 -1
- package/dist/Grid-DOyYYsvk.mjs +92 -0
- package/dist/Grid-DOyYYsvk.mjs.map +1 -0
- package/dist/Grid.d.mts +4 -1
- package/dist/{Header-ZnHGm8fs.d.mts → Header-BqEKkEp5.d.mts} +1 -1
- package/dist/Header.d.mts +1 -1
- package/dist/{HelperTooltip-CQpPO16Q.d.mts → HelperTooltip-mOVSuEB8.d.mts} +2 -2
- package/dist/HelperTooltip.d.mts +1 -1
- package/dist/{IconButton-zu-VNp1h.d.mts → IconButton-CjPFhpVG.d.mts} +2 -2
- package/dist/IconButton-CqTPMhjV.mjs.map +1 -1
- package/dist/IconButton.d.mts +1 -1
- package/dist/ImageTile.d.mts +1 -1
- package/dist/InlineCombobox.d.mts +1 -1
- package/dist/InlineInput.d.mts +1 -1
- package/dist/{Input-Ce8FvSYf.d.mts → Input-CZ_6KWDN.d.mts} +3 -3
- package/dist/{Input-Bc2yWH3j.mjs → Input-C_3QwAAt.mjs} +2 -2
- package/dist/{Input-Bc2yWH3j.mjs.map → Input-C_3QwAAt.mjs.map} +1 -1
- package/dist/Input.d.mts +1 -1
- package/dist/{InputProps-B1Xod4wm.d.mts → InputProps-lag6BM5h.d.mts} +2 -2
- package/dist/InputProps.d.mts +1 -1
- package/dist/IntegerValueControl.d.mts +1 -1
- package/dist/Link.d.mts +1 -1
- package/dist/{ListBox-CFBhILRy.mjs → ListBox-D4j4LCT3.mjs} +2 -2
- package/dist/{ListBox-CFBhILRy.mjs.map → ListBox-D4j4LCT3.mjs.map} +1 -1
- package/dist/{ListBox-D-8iwYVj.d.mts → ListBox-nYAdYVQx.d.mts} +3 -3
- package/dist/ListBox.d.mts +1 -1
- package/dist/ListBoxField.d.mts +3 -2
- package/dist/LoadingShimmer.d.mts +1 -1
- package/dist/{LogicRow-CgPds2tq.d.mts → LogicRow-k4ZPtjN0.d.mts} +3 -3
- package/dist/LogicRow.d.mts +1 -1
- package/dist/MaskedInput.d.mts +2 -2
- package/dist/{Menu-CSwzFqdv.d.mts → Menu-Bu7-KBhp.d.mts} +3 -3
- package/dist/Menu.d.mts +1 -1
- package/dist/Modal-BN0K8QXi.mjs +258 -0
- package/dist/Modal-BN0K8QXi.mjs.map +1 -0
- package/dist/Modal-Dwq-QBw_.d.mts +145 -0
- package/dist/Modal.d.mts +2 -145
- package/dist/{PageHeader-DJOlcAiW.mjs → PageHeader-BTtm3hRQ.mjs} +1 -1
- package/dist/{PageHeader-DJOlcAiW.mjs.map → PageHeader-BTtm3hRQ.mjs.map} +1 -1
- package/dist/PageHeader.d.mts +1 -1
- package/dist/PageLayoutFrame.d.mts +28 -0
- package/dist/{PageSelector-BMz2Q4P6.d.mts → PageSelector-CeGC84N1.d.mts} +3 -3
- package/dist/PageSelector.d.mts +1 -1
- package/dist/{Pagination-B1u203DE.mjs → Pagination-CPd4mSnw.mjs} +3 -3
- package/dist/{Pagination-B1u203DE.mjs.map → Pagination-CPd4mSnw.mjs.map} +1 -1
- package/dist/{Pagination-ne9hnVoe.d.mts → Pagination-H-CcXrCD.d.mts} +2 -2
- package/dist/Pagination.d.mts +1 -1
- package/dist/{PillShell-ChTB_koa.d.mts → PillShell-BQC-k7Rl.d.mts} +2 -2
- package/dist/PillShell.d.mts +1 -1
- package/dist/ProgressIndicator-3A4Aqci6.mjs +188 -0
- package/dist/ProgressIndicator-3A4Aqci6.mjs.map +1 -0
- package/dist/ProgressIndicator-DbOLOaxJ.d.mts +66 -0
- package/dist/ProgressIndicator.d.mts +2 -66
- package/dist/{PseudoClassProps-CdRF3QNn.d.mts → PseudoClassProps-CHtBNv8B.d.mts} +1 -1
- package/dist/PseudoClassProps.d.mts +1 -1
- package/dist/{Radio-Ds1pODKw.mjs → Radio-Cxt89w8s.mjs} +2 -2
- package/dist/{Radio-Ds1pODKw.mjs.map → Radio-Cxt89w8s.mjs.map} +1 -1
- package/dist/{RadioGroup-HIC9V2hO.mjs → RadioGroup-B6Cg1kdm.mjs} +2 -2
- package/dist/{RadioGroup-HIC9V2hO.mjs.map → RadioGroup-B6Cg1kdm.mjs.map} +1 -1
- package/dist/{RadioGroup-CxL6LW4q.d.mts → RadioGroup-BjrfVPZQ.d.mts} +1 -1
- package/dist/RadioGroup.d.mts +1 -1
- package/dist/{RangeCalendar-B7TwRJbg.d.mts → RangeCalendar-CPnLaM-J.d.mts} +2 -2
- package/dist/RangeCalendar.d.mts +1 -1
- package/dist/RangeCalendarPresets.d.mts +1 -1
- package/dist/{RouterContext-B7N12wkK.d.mts → RouterContext-CbvHIl4K.d.mts} +2 -2
- package/dist/RouterContext.d.mts +1 -1
- package/dist/{RouterLink-Bq36EGjc.d.mts → RouterLink-v9AG9fYa.d.mts} +2 -2
- package/dist/RouterLink.d.mts +1 -1
- package/dist/RuleEditorFields.d.mts +2 -2
- package/dist/RulesPill.d.mts +1 -1
- package/dist/{SearchInput-D69WxMNq.d.mts → SearchInput-CIjwmT8R.d.mts} +2 -2
- package/dist/SearchInput.d.mts +1 -1
- package/dist/SectionHeading.d.mts +1 -1
- package/dist/{SegmentedControl-OHrfJiw0.mjs → SegmentedControl-BcwfLuHA.mjs} +12 -5
- package/dist/SegmentedControl-BcwfLuHA.mjs.map +1 -0
- package/dist/{SegmentedControl-vCnGsdXo.d.mts → SegmentedControl-Crr_aHAs.d.mts} +2 -1
- package/dist/SegmentedControl.d.mts +1 -1
- package/dist/{Select-DE7uv9C8.mjs → Select-BstCz8P1.mjs} +2 -2
- package/dist/{Select-DE7uv9C8.mjs.map → Select-BstCz8P1.mjs.map} +1 -1
- package/dist/{Select-sQb4dQwT.d.mts → Select-CJQeuCiF.d.mts} +3 -3
- package/dist/Select.d.mts +1 -1
- package/dist/SingleColumnLayout.d.mts +16 -0
- package/dist/SplitColumnLayout.d.mts +19 -0
- package/dist/{Stack-8KGPQp0u.d.mts → Stack-RVptVTVi.d.mts} +1 -1
- package/dist/Stack.d.mts +1 -1
- package/dist/{Sticker-Bf9rhSkv.d.mts → Sticker-BVX38LKi.d.mts} +4 -4
- package/dist/Sticker.d.mts +1 -1
- package/dist/StringValueControl.d.mts +1 -1
- package/dist/Tab.d.mts +1 -1
- package/dist/{Table-BefytM6w.d.mts → Table-DFiSWroB.d.mts} +1 -1
- package/dist/Table.d.mts +1 -1
- package/dist/{TableBody-BZ34-_wV.d.mts → TableBody-Di9JYHDN.d.mts} +1 -1
- package/dist/TableBody.d.mts +1 -1
- package/dist/{TableBox-NP6bhtKb.mjs → TableBox-DAQ3Plqx.mjs} +3 -3
- package/dist/{TableBox-NP6bhtKb.mjs.map → TableBox-DAQ3Plqx.mjs.map} +1 -1
- package/dist/TableBox.d.mts +2 -2
- package/dist/{TableBoxCell-CHGw9HVj.d.mts → TableBoxCell-D6h1X5ph.d.mts} +6 -6
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/TableBoxField.d.mts +4 -3
- package/dist/{TableBoxRow-BljsXKrL.d.mts → TableBoxRow-C6l6J4mq.d.mts} +3 -3
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-h6HNEv9F.d.mts → TableBoxRowActions-CsLN1b1J.d.mts} +2 -2
- package/dist/TableBoxRowActions.d.mts +1 -1
- package/dist/{TableCell-DorRxyke.d.mts → TableCell-WSDXw79Q.d.mts} +2 -2
- package/dist/TableCell.d.mts +1 -1
- package/dist/{TableControls-CYTpBlQN.mjs → TableControls-BxuPCUQS.mjs} +19 -11
- package/dist/TableControls-BxuPCUQS.mjs.map +1 -0
- package/dist/{TableControls-BtGFiZeD.d.mts → TableControls-cswMgBAr.d.mts} +3 -3
- package/dist/TableControls.d.mts +1 -1
- package/dist/{TableControlsContext-C3DYeUmB.d.mts → TableControlsContext-Cbh8wear.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableHead-B0Fdldgw.d.mts → TableHead-CkL1fEg2.d.mts} +1 -1
- package/dist/TableHead.d.mts +1 -1
- package/dist/{TableHeaderCell-C_7X8QAT.d.mts → TableHeaderCell-K9Ry6YqO.d.mts} +1 -1
- package/dist/TableHeaderCell.d.mts +1 -1
- package/dist/{TableLayout-CXVVzq0e.d.mts → TableLayout-CYRGIFEl.d.mts} +1 -1
- package/dist/TableLayout.d.mts +1 -1
- package/dist/{TableRow-Dr61XJNw.d.mts → TableRow-DMHlo1eg.d.mts} +2 -2
- package/dist/TableRow.d.mts +1 -1
- package/dist/TableTH.d.mts +1 -1
- package/dist/{TableViewConfigurationDropdown-CCtwcB3I.d.mts → TableViewConfigurationDropdown-BRbOcVNc.d.mts} +2 -2
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/{Text-DD_W_ixb.d.mts → Text-B69gp3X_.d.mts} +3 -3
- package/dist/Text.d.mts +1 -1
- package/dist/{TextArea-8TuVvmvj.mjs → TextArea-CcxltuBh.mjs} +2 -2
- package/dist/{TextArea-8TuVvmvj.mjs.map → TextArea-CcxltuBh.mjs.map} +1 -1
- package/dist/{TextArea-DOofaXJi.d.mts → TextArea-Cjsdl07-.d.mts} +2 -2
- package/dist/TextArea.d.mts +1 -1
- package/dist/{TextUnderlineTooltip-BPLKU9wu.d.mts → TextUnderlineTooltip-DDzKLCeX.d.mts} +2 -2
- package/dist/TextUnderlineTooltip.d.mts +1 -1
- package/dist/Tile.d.mts +1 -1
- package/dist/Toast.d.mts +1 -1
- package/dist/{Toggle-2nrUX591.d.mts → Toggle-B5sSdb_q.d.mts} +3 -1
- package/dist/{Toggle-Dcn2Rqgm.mjs → Toggle-DWbJOwf3.mjs} +4 -3
- package/dist/Toggle-DWbJOwf3.mjs.map +1 -0
- package/dist/Toggle.d.mts +1 -1
- package/dist/{Tooltip-Cnqf1-tx.d.mts → Tooltip-x1pFf-Mj.d.mts} +2 -2
- package/dist/Tooltip.d.mts +1 -1
- package/dist/{TruncatedText-g2T5HlqX.d.mts → TruncatedText-BE8FuEQm.d.mts} +1 -1
- package/dist/WizardModal.d.mts +41 -0
- package/dist/accordionTitleTypography-BYhjSN9t.d.mts +17 -0
- package/dist/accordionTitleTypography.d.mts +2 -0
- package/dist/{codec-CoX6LfOY.d.mts → codec-BcgsGCHE.d.mts} +2 -2
- package/dist/codec.d.mts +1 -1
- package/dist/{color-Bt0Lv1e3.d.mts → color-LH7zKfKo.d.mts} +2 -2
- package/dist/components/Accordion/index.d.mts +4 -0
- package/dist/components/Accordion/index.mjs +330 -0
- package/dist/components/Accordion/index.mjs.map +1 -0
- package/dist/components/Breadcrumbs/index.d.mts +1 -1
- package/dist/components/Button/index.d.mts +2 -2
- package/dist/components/ButtonGroup/index.mjs +1 -1
- package/dist/components/Card/index.d.mts +2 -2
- package/dist/components/CardV2/index.d.mts +1 -1
- package/dist/components/Checkbox/index.d.mts +1 -1
- package/dist/components/Checkbox/index.mjs +1 -1
- package/dist/components/Combobox/index.d.mts +2 -2
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/DataTable/TableControls/index.d.mts +19 -19
- package/dist/components/DataTable/TableControls/index.mjs +1 -1
- package/dist/components/DataTable/index.mjs +3 -3
- package/dist/components/DataTable/index.mjs.map +1 -1
- package/dist/components/DataTable/types.d.mts +2 -2
- package/dist/components/DatePicker/index.d.mts +5 -5
- package/dist/components/DatePicker/index.mjs +1 -1
- package/dist/components/DropdownMenu/index.d.mts +1 -1
- package/dist/components/FormControl/index.d.mts +2 -2
- package/dist/components/FormControl/index.mjs +2 -2
- package/dist/components/FormField/index.d.mts +1 -1
- package/dist/components/FormField/index.mjs +1 -1
- package/dist/components/Grid/index.d.mts +2 -2
- package/dist/components/Grid/index.mjs +2 -85
- package/dist/components/ImageTile/index.mjs +1 -1
- package/dist/components/Input/index.d.mts +1 -1
- package/dist/components/Input/index.mjs +1 -1
- package/dist/components/Link/index.mjs.map +1 -1
- package/dist/components/ListBox/index.d.mts +3 -3
- package/dist/components/ListBox/index.mjs +1 -1
- package/dist/components/MaskedInput/index.mjs +1 -1
- package/dist/components/Menu/index.d.mts +1 -1
- package/dist/components/Modal/index.d.mts +1 -1
- package/dist/components/Modal/index.mjs +1 -257
- package/dist/components/PageHeader/index.mjs +1 -1
- package/dist/components/Pagination/index.d.mts +3 -3
- package/dist/components/Pagination/index.mjs +1 -1
- package/dist/components/ProgressIndicator/index.d.mts +2 -2
- package/dist/components/ProgressIndicator/index.mjs +1 -187
- package/dist/components/Radio/index.mjs +1 -1
- package/dist/components/RadioGroup/index.d.mts +1 -1
- package/dist/components/RadioGroup/index.mjs +1 -1
- package/dist/components/SegmentedControl/index.d.mts +1 -1
- package/dist/components/SegmentedControl/index.mjs +1 -1
- package/dist/components/Select/index.d.mts +1 -1
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/Stack/index.d.mts +1 -1
- package/dist/components/Sticker/index.d.mts +1 -1
- package/dist/components/Table/index.d.mts +8 -8
- package/dist/components/TableBox/index.d.mts +2 -2
- package/dist/components/TableBox/index.mjs +1 -1
- package/dist/components/Text/index.d.mts +1 -1
- package/dist/components/TextArea/index.d.mts +1 -1
- package/dist/components/TextArea/index.mjs +1 -1
- package/dist/components/Toggle/index.d.mts +1 -1
- package/dist/components/Toggle/index.mjs +1 -1
- package/dist/components/Tooltip/index.d.mts +3 -3
- package/dist/components/WizardModal/index.d.mts +2 -0
- package/dist/components/WizardModal/index.mjs +106 -0
- package/dist/components/WizardModal/index.mjs.map +1 -0
- package/dist/compound-expression.d.mts +1 -1
- package/dist/{constants-D8bzZ-7B.d.mts → constants-BpwnTzcv.d.mts} +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/{createPath-BDYRvl57.d.mts → createPath-Bst12Uxr.d.mts} +2 -2
- package/dist/createPath.d.mts +1 -1
- package/dist/{date-range-rule-value-jZAHuxZJ.d.mts → date-range-rule-value-C4ir2Y8W.d.mts} +2 -2
- package/dist/date-range-rule-value.d.mts +1 -1
- package/dist/{date-rule-intent-CC1LdkE7.d.mts → date-rule-intent-gKmuxMVA.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-BGczB5R9.d.mts → filter-size-context-BOpH6pBm.d.mts} +2 -2
- package/dist/filter-size-context.d.mts +1 -1
- package/dist/helpers.d.mts +1 -1
- package/dist/{index-BZmGEbsA.d.mts → index-BXdrzR0c.d.mts} +3 -3
- package/dist/{index-DalP_w0c.d.mts → index-C2-PBfN3.d.mts} +2 -2
- package/dist/{index-BRKXhLGa.d.mts → index-c0aXmZV9.d.mts} +2 -2
- package/dist/index-dhjtMp5F.d.mts +1 -0
- package/dist/index-xmouCHX9.d.mts +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index2.d.mts +1 -1
- package/dist/index3.d.mts +3 -3
- package/dist/index4.d.mts +1 -1
- package/dist/index5.d.mts +14 -14
- package/dist/{input-DCJivcWf.d.mts → input-DVJhMlxU.d.mts} +3 -3
- package/dist/inputFields.d.mts +14 -12
- package/dist/{jsonSchema-c_EfAj8y.d.mts → jsonSchema-DmdZYC4a.d.mts} +35 -11
- package/dist/lib/PDSProvider.d.mts +2 -2
- package/dist/lib/TruncatedText.d.mts +1 -1
- package/dist/lib/TruncatedTextWithTooltip.d.mts +1 -1
- package/dist/lib/color.d.mts +1 -1
- package/dist/lib/date-filter/index.d.mts +2 -2
- package/dist/lib/jsonSchema.d.mts +2 -2
- package/dist/lib/jsonSchema.mjs +10 -10
- package/dist/lib/jsonSchema.mjs.map +1 -1
- package/dist/lib/message.d.mts +1 -1
- package/dist/lib/methodChain.d.mts +1 -1
- package/dist/lib/objectSchemaTypes.d.mts +1 -1
- package/dist/lib/pseudoClass.d.mts +1 -1
- package/dist/lib/router/adapters/reactRouter.d.mts +1 -1
- package/dist/lib/router/adapters/tanstack.d.mts +1 -1
- package/dist/lib/router/index.d.mts +5 -5
- package/dist/lib/semanticColor.d.mts +1 -1
- package/dist/{message-CjIHdhX1.d.mts → message-CKSLIKF0.d.mts} +1 -1
- package/dist/mixins/focus.d.mts +1 -1
- package/dist/mixins/hoverable.d.mts +2 -2
- package/dist/mixins/input.d.mts +1 -1
- package/dist/mixins/menuItem.d.mts +2 -2
- package/dist/mixins/text.d.mts +1 -1
- package/dist/{operators-x_ZENhrT.d.mts → operators-1_jTgYRX.d.mts} +2 -2
- package/dist/operators.d.mts +1 -1
- package/dist/{palette-qgPRWgUN.d.mts → palette-CMOEyNPH.d.mts} +3 -3
- package/dist/palette.d.mts +1 -1
- package/dist/patterns/LayoutLoadingShimmer/index.mjs +1 -1
- package/dist/patterns/PageLayout/index.d.mts +4 -1
- package/dist/patterns/PageLayout/index.mjs +99 -2
- package/dist/patterns/PageLayout/index.mjs.map +1 -1
- package/dist/reactRouterFallback.d.mts +1 -1
- package/dist/relative-date-label.d.mts +1 -1
- package/dist/scrollExpandedItemIntoView.d.mts +12 -0
- package/dist/{semantic-DUctmpu_.d.mts → semantic-BXwNUd4a.d.mts} +1 -1
- package/dist/{semanticColor-IAhXS17y.d.mts → semanticColor-Cru2gSys.d.mts} +3 -3
- package/dist/{text-DjTGRUM1.d.mts → text-CxIup7HJ.d.mts} +1 -1
- package/dist/{theme-DKiszVRN.d.mts → theme-CW6qlONZ.d.mts} +3 -3
- package/dist/theme.d.mts +1 -1
- package/dist/tone.d.mts +3 -3
- package/dist/{types-gnF3MPfk2.d.mts → types-3iEDsymE.d.mts} +2 -2
- package/dist/{types-CuQSgl1F.d.mts → types-B-stjYNc.d.mts} +1 -1
- package/dist/{types-N8PYonjD.d.mts → types-BEjWTkZV.d.mts} +2 -2
- package/dist/{types-CcZbBH0e.d.mts → types-ChkiGhjQ.d.mts} +1 -1
- package/dist/{types-D8rWSj3z.d.mts → types-YojUycQK.d.mts} +1 -1
- package/dist/{types-RWjW1d9I.d.mts → types-g-aqbnek.d.mts} +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types2.d.mts +1 -1
- package/dist/types3.d.mts +1 -1
- package/dist/types4.d.mts +1 -1
- package/dist/types5.d.mts +1 -1
- package/dist/types6.d.mts +1 -1
- package/dist/{url-state-C2gl07_y.d.mts → url-state-CHK2N2fA.d.mts} +2 -2
- package/dist/url-state.d.mts +1 -1
- package/dist/useComboboxFooterAction.d.mts +1 -1
- package/dist/{useFilterStateV2-BQYcAdKR.d.mts → useFilterStateV2-B26e5iUx.d.mts} +3 -3
- package/dist/useFilterStateV2.d.mts +1 -1
- package/dist/{useFormField-DsvC5dOb.mjs → useFormField-BzhMbl5P.mjs} +2 -1
- package/dist/useFormField-BzhMbl5P.mjs.map +1 -0
- package/dist/{useFormField-DDbo-ExT.d.mts → useFormField-DPFClB5h.d.mts} +4 -2
- package/dist/useFormField.d.mts +1 -1
- package/dist/{useLocationPathname-K2N4fw8j.d.mts → useLocationPathname-CnRd_Rzn.d.mts} +1 -1
- package/dist/useLocationPathname.d.mts +1 -1
- package/dist/{useTableBoxDragAndDrop-CbbH3pMK.d.mts → useTableBoxDragAndDrop-DWlG5vhl.d.mts} +1 -1
- package/dist/useTableBoxDragAndDrop.d.mts +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/dist/{utilities-D0EhDri-.d.mts → utilities-BcGuP8Fd.d.mts} +1 -1
- package/dist/utilities.d.mts +1 -1
- package/dist/utils/testing.d.mts +1 -1
- package/dist/utils/testing.mjs.map +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/{validation-CMtfUd-R.d.mts → validation-B-Om4ANo.d.mts} +3 -3
- package/dist/validation.d.mts +1 -1
- package/dist/{value-control-resolver-Au9JNS5z.d.mts → value-control-resolver-BiyhB8zt.d.mts} +2 -2
- package/dist/value-control-resolver.d.mts +1 -1
- package/dist/variables/effect.d.mts +1 -1
- package/dist/variables/semantic.d.mts +1 -1
- package/llms.txt +10 -1
- package/package.json +5 -3
- package/skills/ui-authoring/COMPONENTS.md +5 -1
- package/skills/ui-authoring/PATTERNS.md +74 -115
- package/dist/Combobox-1M6EwVmq.mjs.map +0 -1
- package/dist/FormControl-BEk4F1EV.mjs.map +0 -1
- package/dist/FormField-ByT0avVx.mjs.map +0 -1
- package/dist/SegmentedControl-OHrfJiw0.mjs.map +0 -1
- package/dist/TableControls-CYTpBlQN.mjs.map +0 -1
- package/dist/Toggle-Dcn2Rqgm.mjs.map +0 -1
- package/dist/components/Grid/index.mjs.map +0 -1
- package/dist/components/Modal/index.mjs.map +0 -1
- package/dist/components/ProgressIndicator/index.mjs.map +0 -1
- package/dist/fieldSchemaTypes-BVYSm74B.d.mts +0 -39
- package/dist/lib/fieldSchemaTypes.d.mts +0 -2
- package/dist/lib/fieldSchemaTypes.mjs +0 -41
- package/dist/lib/fieldSchemaTypes.mjs.map +0 -1
- package/dist/useFormField-DsvC5dOb.mjs.map +0 -1
- /package/dist/{index-B33elXxm.d.mts → index-BCh-G39Y2.d.mts} +0 -0
- /package/dist/{index-B_BBnMou.d.mts → index-BMBcfD_R.d.mts} +0 -0
- /package/dist/{index-BrGZHEgX.d.mts → index-BOn0AAue.d.mts} +0 -0
- /package/dist/{index-BwAfCVZH2.d.mts → index-BcsXXrHq.d.mts} +0 -0
- /package/dist/{index-C6HcjJiY.d.mts → index-BwFl_eS0.d.mts} +0 -0
- /package/dist/{index-CX869wwk.d.mts → index-C-lwXyQ6.d.mts} +0 -0
- /package/dist/{index-CjDodOH2.d.mts → index-C1o2TFfS.d.mts} +0 -0
- /package/dist/{index-CsuikFeJ.d.mts → index-C3kE54DD.d.mts} +0 -0
- /package/dist/{index-CzItj62a.d.mts → index-CREkvfw9.d.mts} +0 -0
- /package/dist/{index-D13oYj4_.d.mts → index-CfCYi7PF.d.mts} +0 -0
- /package/dist/{index-D4DUvwPf.d.mts → index-DCTy4zg0.d.mts} +0 -0
- /package/dist/{index-DMRtRo7y.d.mts → index-DWIh4oP5.d.mts} +0 -0
- /package/dist/{index-DXJd7-2Z.d.mts → index-De7MV8-j.d.mts} +0 -0
- /package/dist/{index-DZlqSwCF.d.mts → index-DgJfEygr.d.mts} +0 -0
- /package/dist/{index-DeVKzGce.d.mts → index-DrK1_jKY.d.mts} +0 -0
- /package/dist/{index-Deol7ZWO.d.mts → index-Es5nKSSL.d.mts} +0 -0
- /package/dist/{index-DztUdPP_.d.mts → index-Qwqzz3XM.d.mts} +0 -0
- /package/dist/{index-Rvd9MEUQ.d.mts → index-Wc1llEvP.d.mts} +0 -0
package/dist/index4.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-BQC-k7Rl.mjs";
|
|
2
2
|
export { PillShellProps, PillShell as default };
|
package/dist/index5.d.mts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { t as dateRuleIntent } from "./date-rule-intent-
|
|
2
|
-
import { a as FilterField, c as FilterOperator, d as FilterRuleValueChange, f as FilterSize, h as isEmptyState, i as EMPTY_FILTER_STATE, l as FilterRule, m as TopLevelFilterRule, n as CompoundExpression, o as FilterFieldSource, p as FilterStateV2, r as DateRangeFilterValue, s as FilterFieldType, t as AndGroup, u as FilterRuleValue } from "./types-
|
|
3
|
-
import { t as resolveDateRangeRuleValue } from "./date-range-rule-value-
|
|
4
|
-
import { n as RawFieldInfo, r as buildFieldRegistry, t as FieldRegistry } from "./FieldRegistry-
|
|
5
|
-
import { n as ValueControlResolver, r as resolveValueControl, t as ResolveValueControlOptions } from "./value-control-resolver-
|
|
6
|
-
import { t as FilterBar } from "./FilterBar-
|
|
7
|
-
import { t as FilterBarProps } from "./index-
|
|
8
|
-
import { a as useFilterBarSize, i as FilterSizeTokens, t as FILTER_SIZE_TOKENS } from "./filter-size-context-
|
|
9
|
-
import { n as PillShellProps, t as PillShell } from "./PillShell-
|
|
10
|
-
import { a as getDefaultOperatorForType, c as getOperatorsForType, d as isValuelessOperator, f as reconcileValueForOperator, l as isCompleteDateRange, r as emptyValueForRule, s as getOperatorsForField, u as isRangeOperator } from "./operators-
|
|
11
|
-
import { a as decodeFilterStateFromUrl, i as decodeFilterStateFromString, n as UrlStateCodecResult, o as encodeFilterStateToUrlParam, r as applyFilterStateToSearchParams, t as FILTER_STATE_URL_PARAM } from "./url-state-
|
|
12
|
-
import { n as UseFilterStateV2Result, r as useFilterStateV2, t as UseFilterStateV2Options } from "./useFilterStateV2-
|
|
13
|
-
import { n as isFilterStateV2, r as pruneToRegistry, t as hasCompleteValue } from "./validation-
|
|
14
|
-
import { t as ValueControlProps } from "./types-
|
|
1
|
+
import { t as dateRuleIntent } from "./date-rule-intent-gKmuxMVA.mjs";
|
|
2
|
+
import { a as FilterField, c as FilterOperator, d as FilterRuleValueChange, f as FilterSize, h as isEmptyState, i as EMPTY_FILTER_STATE, l as FilterRule, m as TopLevelFilterRule, n as CompoundExpression, o as FilterFieldSource, p as FilterStateV2, r as DateRangeFilterValue, s as FilterFieldType, t as AndGroup, u as FilterRuleValue } from "./types-BEjWTkZV.mjs";
|
|
3
|
+
import { t as resolveDateRangeRuleValue } from "./date-range-rule-value-C4ir2Y8W.mjs";
|
|
4
|
+
import { n as RawFieldInfo, r as buildFieldRegistry, t as FieldRegistry } from "./FieldRegistry-bKxrF1gC.mjs";
|
|
5
|
+
import { n as ValueControlResolver, r as resolveValueControl, t as ResolveValueControlOptions } from "./value-control-resolver-BiyhB8zt.mjs";
|
|
6
|
+
import { t as FilterBar } from "./FilterBar-DhlBLWxw.mjs";
|
|
7
|
+
import { t as FilterBarProps } from "./index-c0aXmZV9.mjs";
|
|
8
|
+
import { a as useFilterBarSize, i as FilterSizeTokens, t as FILTER_SIZE_TOKENS } from "./filter-size-context-BOpH6pBm.mjs";
|
|
9
|
+
import { n as PillShellProps, t as PillShell } from "./PillShell-BQC-k7Rl.mjs";
|
|
10
|
+
import { a as getDefaultOperatorForType, c as getOperatorsForType, d as isValuelessOperator, f as reconcileValueForOperator, l as isCompleteDateRange, r as emptyValueForRule, s as getOperatorsForField, u as isRangeOperator } from "./operators-1_jTgYRX.mjs";
|
|
11
|
+
import { a as decodeFilterStateFromUrl, i as decodeFilterStateFromString, n as UrlStateCodecResult, o as encodeFilterStateToUrlParam, r as applyFilterStateToSearchParams, t as FILTER_STATE_URL_PARAM } from "./url-state-CHK2N2fA.mjs";
|
|
12
|
+
import { n as UseFilterStateV2Result, r as useFilterStateV2, t as UseFilterStateV2Options } from "./useFilterStateV2-B26e5iUx.mjs";
|
|
13
|
+
import { n as isFilterStateV2, r as pruneToRegistry, t as hasCompleteValue } from "./validation-B-Om4ANo.mjs";
|
|
14
|
+
import { t as ValueControlProps } from "./types-3iEDsymE.mjs";
|
|
15
15
|
export { AndGroup, CompoundExpression, DateRangeFilterValue, EMPTY_FILTER_STATE, FILTER_SIZE_TOKENS, FILTER_STATE_URL_PARAM, FieldRegistry, FilterBar, FilterBarProps, FilterField, FilterFieldSource, FilterFieldType, FilterOperator, FilterRule, FilterRuleValue, FilterRuleValueChange, FilterSize, FilterSizeTokens, FilterStateV2, PillShell, PillShellProps, RawFieldInfo, ResolveValueControlOptions, TopLevelFilterRule, UrlStateCodecResult, UseFilterStateV2Options, UseFilterStateV2Result, ValueControlProps, ValueControlResolver, applyFilterStateToSearchParams, buildFieldRegistry, dateRuleIntent, decodeFilterStateFromString, decodeFilterStateFromUrl, emptyValueForRule, encodeFilterStateToUrlParam, getDefaultOperatorForType, getOperatorsForField, getOperatorsForType, hasCompleteValue, isCompleteDateRange, isEmptyState, isFilterStateV2, isRangeOperator, isValuelessOperator, pruneToRegistry, reconcileValueForOperator, resolveDateRangeRuleValue, resolveValueControl, useFilterBarSize, useFilterStateV2 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as PseudoClassProps } from "./PseudoClassProps-
|
|
2
|
-
import { t as ErrorProps } from "./ErrorProps-
|
|
1
|
+
import { t as PseudoClassProps } from "./PseudoClassProps-CHtBNv8B.mjs";
|
|
2
|
+
import { t as ErrorProps } from "./ErrorProps-BA0-m_Wp.mjs";
|
|
3
3
|
import * as _$styled_components0 from "styled-components";
|
|
4
4
|
|
|
5
5
|
//#region mixins/input.d.ts
|
|
@@ -14,4 +14,4 @@ interface InputMixinProps extends ErrorProps, PseudoClassProps {
|
|
|
14
14
|
declare const inputMixin: _$styled_components0.FlattenInterpolation<_$styled_components0.ThemedStyledProps<InputMixinProps, any>>;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { InputSizes as n, inputMixin as r, InputMixinProps as t };
|
|
17
|
-
//# sourceMappingURL=input-
|
|
17
|
+
//# sourceMappingURL=input-DVJhMlxU.d.mts.map
|
package/dist/inputFields.d.mts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { n as CheckboxProps } from "./Checkbox-
|
|
2
|
-
import { n as ComboboxMultiSelectProps } from "./ComboboxMultiSelect-
|
|
3
|
-
import { n as ComboboxSingleSelectProps } from "./ComboboxSingleSelect-
|
|
4
|
-
import { n as FormFieldBaseProps } from "./FormField-
|
|
5
|
-
import { a as InputProps } from "./Input-
|
|
6
|
-
import { n as RadioGroupProps } from "./RadioGroup-
|
|
7
|
-
import { i as SegmentedControlProps } from "./SegmentedControl-
|
|
8
|
-
import { i as SelectProps } from "./Select-
|
|
9
|
-
import { t as TextAreaProps } from "./TextArea-
|
|
10
|
-
import { n as ToggleProps } from "./Toggle-
|
|
1
|
+
import { n as CheckboxProps } from "./Checkbox-fWj7GkBl.mjs";
|
|
2
|
+
import { n as ComboboxMultiSelectProps } from "./ComboboxMultiSelect-CvAc0FT3.mjs";
|
|
3
|
+
import { n as ComboboxSingleSelectProps } from "./ComboboxSingleSelect-CBm7x0oh.mjs";
|
|
4
|
+
import { n as FormFieldBaseProps } from "./FormField-BJZUj6jg.mjs";
|
|
5
|
+
import { a as InputProps } from "./Input-CZ_6KWDN.mjs";
|
|
6
|
+
import { n as RadioGroupProps } from "./RadioGroup-BjrfVPZQ.mjs";
|
|
7
|
+
import { i as SegmentedControlProps } from "./SegmentedControl-Crr_aHAs.mjs";
|
|
8
|
+
import { i as SelectProps } from "./Select-CJQeuCiF.mjs";
|
|
9
|
+
import { t as TextAreaProps } from "./TextArea-Cjsdl07-.mjs";
|
|
10
|
+
import { n as ToggleProps } from "./Toggle-B5sSdb_q.mjs";
|
|
11
11
|
import * as _$react from "react";
|
|
12
12
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
13
13
|
|
|
14
14
|
//#region components/FormField/inputFields.d.ts
|
|
15
15
|
type ImplementsFormField = Omit<FormFieldBaseProps, 'children'>;
|
|
16
|
-
type ExtractFormFieldProps<T extends ImplementsFormField> = Pick<T, 'label' | 'inputId' | 'helperText' | 'errorText' | 'warningText' | 'labelProps' | 'helperProps' | 'warningProps' | 'errorProps' | 'configField' | 'configFieldInputWidth' | 'rightActions'>;
|
|
17
|
-
type OmitFormFieldProps<T extends ImplementsFormField> = Omit<T, keyof ExtractFormFieldProps<T>>;
|
|
16
|
+
type ExtractFormFieldProps<T extends ImplementsFormField> = Pick<T, 'label' | 'inputId' | 'required' | 'helperText' | 'errorText' | 'warningText' | 'labelProps' | 'helperProps' | 'warningProps' | 'errorProps' | 'configField' | 'configFieldInputWidth' | 'rightActions'>;
|
|
17
|
+
type OmitFormFieldProps<T extends ImplementsFormField> = Omit<T, Exclude<keyof ExtractFormFieldProps<T>, 'required'>>;
|
|
18
18
|
/**
|
|
19
19
|
* Helper to split out props that are sent to the FormField component from props sent
|
|
20
20
|
* to the underlying input component.
|
|
@@ -39,6 +39,7 @@ declare const RadioGroupField: ({
|
|
|
39
39
|
helperText,
|
|
40
40
|
errorText,
|
|
41
41
|
warningText,
|
|
42
|
+
required,
|
|
42
43
|
children,
|
|
43
44
|
...props
|
|
44
45
|
}: RadioGroupFieldProps) => _$react_jsx_runtime0.JSX.Element;
|
|
@@ -53,6 +54,7 @@ declare const CheckboxField: ({
|
|
|
53
54
|
checkboxLabel,
|
|
54
55
|
configField,
|
|
55
56
|
labelProps,
|
|
57
|
+
required,
|
|
56
58
|
...props
|
|
57
59
|
}: CheckboxFieldProps) => _$react_jsx_runtime0.JSX.Element;
|
|
58
60
|
interface ToggleFieldProps extends ImplementsFormField, ToggleProps {}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { t as FieldSchemaType } from "./fieldSchemaTypes-BVYSm74B.mjs";
|
|
2
|
-
|
|
3
1
|
//#region lib/objectSchemaTypes.d.ts
|
|
4
2
|
interface FunctionJsonSchema extends JsonSchemaObject {
|
|
5
3
|
properties: {
|
|
@@ -73,6 +71,32 @@ interface JsonSchemaObjectKeyRegistry {}
|
|
|
73
71
|
type JsonSchemaObjectKey = JsonSchemaObjectKeyRegistry extends {
|
|
74
72
|
objectKey: infer K extends string;
|
|
75
73
|
} ? K : string;
|
|
74
|
+
/**
|
|
75
|
+
* Field types are consumer-defined. Register them by mapping each field type to the JSON type it
|
|
76
|
+
* serializes as (`null` when it has no fixed JSON type); PDS derives the full `fieldType` set and
|
|
77
|
+
* each JSON schema interface's allowed `fieldType`s from the map:
|
|
78
|
+
*
|
|
79
|
+
* const FIELD_TYPE_JSON_TYPES = {
|
|
80
|
+
* [MyFieldType.File]: 'object',
|
|
81
|
+
* [MyFieldType.Alias]: null,
|
|
82
|
+
* } as const satisfies Record<MyFieldType, `${JsonSchemaTypes}` | null>;
|
|
83
|
+
*
|
|
84
|
+
* declare module '@persona/design-system/lib/jsonSchema' {
|
|
85
|
+
* interface JsonSchemaFieldTypeRegistry { fieldTypes: typeof FIELD_TYPE_JSON_TYPES }
|
|
86
|
+
* }
|
|
87
|
+
*
|
|
88
|
+
* See the "Lib/JSON Schema" docs page for the full guide.
|
|
89
|
+
*/
|
|
90
|
+
interface JsonSchemaFieldTypeRegistry {}
|
|
91
|
+
type JsonSchemaFieldType = JsonSchemaFieldTypeRegistry extends {
|
|
92
|
+
fieldTypes: infer M;
|
|
93
|
+
} ? keyof M & string : string;
|
|
94
|
+
type FieldTypeKind = `${Exclude<JsonSchemaTypes, JsonSchemaTypes.Null>}`;
|
|
95
|
+
type FieldTypeFor<K extends FieldTypeKind> = JsonSchemaFieldTypeRegistry extends {
|
|
96
|
+
fieldTypes: infer M;
|
|
97
|
+
} ? { [P in keyof M]: M[P] extends K ? P : never }[keyof M] & string : string;
|
|
98
|
+
/** A field type this module gives runtime meaning to, as the consumer's type spells it. */
|
|
99
|
+
type KnownFieldType<V extends string> = string extends JsonSchemaFieldType ? V : Extract<JsonSchemaFieldType, V>;
|
|
76
100
|
declare enum JsonSchemaTypes {
|
|
77
101
|
Array = "array",
|
|
78
102
|
Boolean = "boolean",
|
|
@@ -101,13 +125,13 @@ interface JsonSchemaArray<ItemSchema = JsonSchema> extends JsonSchemaBase {
|
|
|
101
125
|
type: JsonSchemaTypes.Array;
|
|
102
126
|
items: ItemSchema;
|
|
103
127
|
uniqueItems?: boolean;
|
|
104
|
-
fieldType?:
|
|
128
|
+
fieldType?: FieldTypeFor<'array'>;
|
|
105
129
|
default?: unknown[];
|
|
106
130
|
supportedFunctions?: string[];
|
|
107
131
|
}
|
|
108
132
|
interface JsonSchemaBoolean extends JsonSchemaBase {
|
|
109
133
|
type: JsonSchemaTypes.Boolean;
|
|
110
|
-
fieldType?:
|
|
134
|
+
fieldType?: FieldTypeFor<'boolean'>;
|
|
111
135
|
default?: boolean;
|
|
112
136
|
}
|
|
113
137
|
interface JsonSchemaInteger extends JsonSchemaBase {
|
|
@@ -115,7 +139,7 @@ interface JsonSchemaInteger extends JsonSchemaBase {
|
|
|
115
139
|
enum?: number[];
|
|
116
140
|
minimum?: number;
|
|
117
141
|
maximum?: number;
|
|
118
|
-
fieldType?:
|
|
142
|
+
fieldType?: FieldTypeFor<'integer'>;
|
|
119
143
|
default?: number;
|
|
120
144
|
}
|
|
121
145
|
interface JsonSchemaNumber extends JsonSchemaBase {
|
|
@@ -123,7 +147,7 @@ interface JsonSchemaNumber extends JsonSchemaBase {
|
|
|
123
147
|
enum?: number[];
|
|
124
148
|
minimum?: number;
|
|
125
149
|
maximum?: number;
|
|
126
|
-
fieldType?:
|
|
150
|
+
fieldType?: FieldTypeFor<'number'>;
|
|
127
151
|
default?: number;
|
|
128
152
|
}
|
|
129
153
|
interface JsonSchemaNull extends JsonSchemaBase {
|
|
@@ -135,7 +159,7 @@ interface JsonSchemaObject<PropertySchema = JsonSchema> extends JsonSchemaBase {
|
|
|
135
159
|
properties: Record<string, PropertySchema>;
|
|
136
160
|
required?: string[];
|
|
137
161
|
objectKey?: JsonSchemaObjectKey;
|
|
138
|
-
fieldType?:
|
|
162
|
+
fieldType?: FieldTypeFor<'object'>;
|
|
139
163
|
isVariable?: boolean;
|
|
140
164
|
rootDescription?: string;
|
|
141
165
|
additionalProperties?: boolean;
|
|
@@ -151,7 +175,7 @@ interface JsonSchemaString extends JsonSchemaBase {
|
|
|
151
175
|
group?: string;
|
|
152
176
|
labels?: string[];
|
|
153
177
|
maxLength?: number | null;
|
|
154
|
-
fieldType?:
|
|
178
|
+
fieldType?: FieldTypeFor<'string'>;
|
|
155
179
|
default?: string;
|
|
156
180
|
}
|
|
157
181
|
interface JsonSchemaAnyOf extends JsonSchemaBase {
|
|
@@ -172,7 +196,7 @@ declare const isJsonSchemaObject: (schema: JsonSchema) => schema is JsonSchemaOb
|
|
|
172
196
|
declare const isJsonSchemaArray: (schema: JsonSchema) => schema is JsonSchemaArray;
|
|
173
197
|
/** Returns true for non-primitive schemas (object, array, or $ref to a platform object). */
|
|
174
198
|
declare const isNonPrimitiveSchema: (schema: JsonSchema) => boolean;
|
|
175
|
-
declare const isFileType: (fieldType:
|
|
199
|
+
declare const isFileType: (fieldType: JsonSchemaFieldType | undefined) => fieldType is KnownFieldType<"file">;
|
|
176
200
|
declare const isFileField: (schema: JsonSchema) => boolean;
|
|
177
201
|
declare const isArrayWithFileItems: (schema: JsonSchema) => boolean;
|
|
178
202
|
/** ImageGallery accepts file schemas or arrays of file items. */
|
|
@@ -218,5 +242,5 @@ declare const getNonNullableRefSchema: (schema: JsonSchema | null | undefined) =
|
|
|
218
242
|
declare const isSchemaTypeAllowed: (schema: JsonSchema | FunctionJsonSchema | null | undefined, allowedTypes: readonly string[]) => boolean;
|
|
219
243
|
declare const extendSchema: (schemaMap: ObjectSchemaMap, schemaToAdd: Partial<Record<keyof typeof schemaMap, Record<string, JsonSchema>>>) => ObjectSchemaMap;
|
|
220
244
|
//#endregion
|
|
221
|
-
export {
|
|
222
|
-
//# sourceMappingURL=jsonSchema-
|
|
245
|
+
export { isSchemaTypeAllowed as $, isArrayWithFileItems as A, isJsonSchemaDate as B, extendSchema as C, getNonNullableRefSchema as D, getArrayItemType as E, isFunctionSchema as F, isJsonSchemaPlatformObject as G, isJsonSchemaInteger as H, isGenericParameterSchema as I, isJsonSchemaString as J, isJsonSchemaRef as K, isJsonSchemaArray as L, isFileField as M, isFileSchema as N, getNonNullableType as O, isFileType as P, isPrecedingSchema as Q, isJsonSchemaBoolean as R, JsonSchemaTypes as S, genericArrayItemSchema as T, isJsonSchemaNumber as U, isJsonSchemaDateTime as V, isJsonSchemaObject as W, isOneOfSchema as X, isNonPrimitiveSchema as Y, isOneOfStringSchema as Z, JsonSchemaObject as _, JsonSchemaBase as a, FunctionReturnTypeJsonSchema as at, JsonSchemaRef as b, JsonSchemaBoolean as c, JsonSchemaEmpty as d, CollectionMetaJsonSchema as et, JsonSchemaFieldType as f, JsonSchemaNumber as g, JsonSchemaNull as h, JsonSchemaArray as i, FunctionParameterJsonSchema as it, isConvertedTypeSchema as j, humanizeSchemaType as k, JsonSchemaConst as l, JsonSchemaInteger as m, JsonSchema as n, FunctionGenericParameterSchema as nt, JsonSchemaBasic as o, GenericType as ot, JsonSchemaFieldTypeRegistry as p, isJsonSchemaSecret as q, JsonSchemaAnyOf as r, FunctionJsonSchema as rt, JsonSchemaBasicTypes as s, ObjectSchemaMap as st, EMPTY_JSON_SCHEMA_OBJECT as t, FunctionConvertedTypeSchema as tt, JsonSchemaCore as u, JsonSchemaObjectKey as v, functionParametersFromJsonSchema as w, JsonSchemaString as x, JsonSchemaObjectKeyRegistry as y, isJsonSchemaChoices as z };
|
|
246
|
+
//# sourceMappingURL=jsonSchema-DmdZYC4a.d.mts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as PersonaTheme } from "../theme-
|
|
2
|
-
import { n as RouterAdapter } from "../types-
|
|
1
|
+
import { i as PersonaTheme } from "../theme-CW6qlONZ.mjs";
|
|
2
|
+
import { n as RouterAdapter } from "../types-B-stjYNc.mjs";
|
|
3
3
|
import { FC, PropsWithChildren } from "react";
|
|
4
4
|
|
|
5
5
|
//#region lib/PDSProvider.d.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TruncatedText, r as TruncatedTextProps, t as OverflowEllipsisSpan } from "../TruncatedText-
|
|
1
|
+
import { n as TruncatedText, r as TruncatedTextProps, t as OverflowEllipsisSpan } from "../TruncatedText-BE8FuEQm.mjs";
|
|
2
2
|
export { OverflowEllipsisSpan, TruncatedText, TruncatedText as default, TruncatedTextProps };
|
package/dist/lib/color.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as withAlpha, i as transparent, n as PdsColor, r as opacityOf, t as CssColor } from "../color-
|
|
1
|
+
import { a as withAlpha, i as transparent, n as PdsColor, r as opacityOf, t as CssColor } from "../color-LH7zKfKo.mjs";
|
|
2
2
|
export { CssColor, PdsColor, opacityOf, transparent, withAlpha };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as DateFilterPreset, c as RelativeDateFilterValue, n as AbsoluteDateRange, o as DateFilterValue } from "../../types-
|
|
2
|
-
import { a as selectedPresetFor, i as resolveDateFilterValue, r as parseDateFilterValue } from "../../codec-
|
|
1
|
+
import { a as DateFilterPreset, c as RelativeDateFilterValue, n as AbsoluteDateRange, o as DateFilterValue } from "../../types-YojUycQK.mjs";
|
|
2
|
+
import { a as selectedPresetFor, i as resolveDateFilterValue, r as parseDateFilterValue } from "../../codec-BcgsGCHE.mjs";
|
|
3
3
|
export { AbsoluteDateRange, DateFilterPreset, DateFilterValue, RelativeDateFilterValue, parseDateFilterValue, resolveDateFilterValue, selectedPresetFor };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { EMPTY_JSON_SCHEMA_OBJECT, JsonSchema, JsonSchemaAnyOf, JsonSchemaArray, JsonSchemaBase, JsonSchemaBasic, JsonSchemaBasicTypes, JsonSchemaBoolean, JsonSchemaConst, JsonSchemaCore, JsonSchemaEmpty, JsonSchemaInteger, JsonSchemaNull, JsonSchemaNumber, JsonSchemaObject, JsonSchemaObjectKey, JsonSchemaObjectKeyRegistry, JsonSchemaRef, JsonSchemaString, JsonSchemaTypes, extendSchema, functionParametersFromJsonSchema, genericArrayItemSchema, getArrayItemType, getNonNullableRefSchema, getNonNullableType, humanizeSchemaType, isArrayWithFileItems, isConvertedTypeSchema, isFileField, isFileSchema, isFileType, isFunctionSchema, isGenericParameterSchema, isJsonSchemaArray, isJsonSchemaBoolean, isJsonSchemaChoices, isJsonSchemaDate, isJsonSchemaDateTime, isJsonSchemaInteger, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPlatformObject, isJsonSchemaRef, isJsonSchemaSecret, isJsonSchemaString, isNonPrimitiveSchema, isOneOfSchema, isOneOfStringSchema, isPrecedingSchema, isSchemaTypeAllowed };
|
|
1
|
+
import { $ as isSchemaTypeAllowed, A as isArrayWithFileItems, B as isJsonSchemaDate, C as extendSchema, D as getNonNullableRefSchema, E as getArrayItemType, F as isFunctionSchema, G as isJsonSchemaPlatformObject, H as isJsonSchemaInteger, I as isGenericParameterSchema, J as isJsonSchemaString, K as isJsonSchemaRef, L as isJsonSchemaArray, M as isFileField, N as isFileSchema, O as getNonNullableType, P as isFileType, Q as isPrecedingSchema, R as isJsonSchemaBoolean, S as JsonSchemaTypes, T as genericArrayItemSchema, U as isJsonSchemaNumber, V as isJsonSchemaDateTime, W as isJsonSchemaObject, X as isOneOfSchema, Y as isNonPrimitiveSchema, Z as isOneOfStringSchema, _ as JsonSchemaObject, a as JsonSchemaBase, b as JsonSchemaRef, c as JsonSchemaBoolean, d as JsonSchemaEmpty, f as JsonSchemaFieldType, g as JsonSchemaNumber, h as JsonSchemaNull, i as JsonSchemaArray, j as isConvertedTypeSchema, k as humanizeSchemaType, l as JsonSchemaConst, m as JsonSchemaInteger, n as JsonSchema, o as JsonSchemaBasic, p as JsonSchemaFieldTypeRegistry, q as isJsonSchemaSecret, r as JsonSchemaAnyOf, s as JsonSchemaBasicTypes, t as EMPTY_JSON_SCHEMA_OBJECT, u as JsonSchemaCore, v as JsonSchemaObjectKey, w as functionParametersFromJsonSchema, x as JsonSchemaString, y as JsonSchemaObjectKeyRegistry, z as isJsonSchemaChoices } from "../jsonSchema-DmdZYC4a.mjs";
|
|
2
|
+
export { EMPTY_JSON_SCHEMA_OBJECT, JsonSchema, JsonSchemaAnyOf, JsonSchemaArray, JsonSchemaBase, JsonSchemaBasic, JsonSchemaBasicTypes, JsonSchemaBoolean, JsonSchemaConst, JsonSchemaCore, JsonSchemaEmpty, JsonSchemaFieldType, JsonSchemaFieldTypeRegistry, JsonSchemaInteger, JsonSchemaNull, JsonSchemaNumber, JsonSchemaObject, JsonSchemaObjectKey, JsonSchemaObjectKeyRegistry, JsonSchemaRef, JsonSchemaString, JsonSchemaTypes, extendSchema, functionParametersFromJsonSchema, genericArrayItemSchema, getArrayItemType, getNonNullableRefSchema, getNonNullableType, humanizeSchemaType, isArrayWithFileItems, isConvertedTypeSchema, isFileField, isFileSchema, isFileType, isFunctionSchema, isGenericParameterSchema, isJsonSchemaArray, isJsonSchemaBoolean, isJsonSchemaChoices, isJsonSchemaDate, isJsonSchemaDateTime, isJsonSchemaInteger, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPlatformObject, isJsonSchemaRef, isJsonSchemaSecret, isJsonSchemaString, isNonPrimitiveSchema, isOneOfSchema, isOneOfStringSchema, isPrecedingSchema, isSchemaTypeAllowed };
|
package/dist/lib/jsonSchema.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "./fieldSchemaTypes.mjs";
|
|
2
1
|
import { startCase } from "lodash-es";
|
|
3
2
|
//#region lib/jsonSchema.ts
|
|
4
3
|
let JsonSchemaTypes = /* @__PURE__ */ function(JsonSchemaTypes) {
|
|
@@ -114,7 +113,7 @@ const getArrayItemType = (schema) => {
|
|
|
114
113
|
*
|
|
115
114
|
* Values follow `FIELD_SCHEMA_TYPE_DISPLAY` in `front-end/lib/fields` so the same field reads the same in the
|
|
116
115
|
* field-schema editor and in these pickers. They are duplicated rather than imported because
|
|
117
|
-
* `front-end/lib/fields` imports this module, and
|
|
116
|
+
* `front-end/lib/fields` imports this module, and this label map is deliberately dependency-free.
|
|
118
117
|
*
|
|
119
118
|
* These are names, so they are intentionally finer-grained than `getDataTypeFromJsonSchema`, which
|
|
120
119
|
* resolves the same schemas to a rendering strategy: it has no relation case (base `Field::Relation`
|
|
@@ -125,14 +124,15 @@ const getArrayItemType = (schema) => {
|
|
|
125
124
|
* vague but still truer than the bare JSON type.
|
|
126
125
|
*/
|
|
127
126
|
const FIELD_TYPE_LABELS = {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
"Field::Relation::Document::Generic": "Document",
|
|
128
|
+
file: "File",
|
|
129
|
+
"Field::Relation::Document::GovernmentId": "Government ID",
|
|
130
|
+
"Field::Relation::Document::GovernmentIdNfc": "Government ID NFC",
|
|
131
|
+
hash: "Hash",
|
|
132
|
+
json: "JSON",
|
|
133
|
+
"platform-file": "Platform File",
|
|
134
|
+
"Field::Relation": "Relation",
|
|
135
|
+
"Field::Relation::Selfie": "Selfie"
|
|
136
136
|
};
|
|
137
137
|
/**
|
|
138
138
|
* Names the field types that are all `type: 'string'` in JSON Schema and are told apart only by a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonSchema.mjs","names":[],"sources":["../../lib/jsonSchema.ts"],"sourcesContent":["import { startCase } from 'lodash-es';\n\nimport { FieldSchemaType } from './fieldSchemaTypes';\nimport type {\n FunctionConvertedTypeSchema,\n FunctionGenericParameterSchema,\n FunctionJsonSchema,\n FunctionParameterJsonSchema,\n FunctionReturnTypeJsonSchema,\n ObjectSchemaMap,\n} from './objectSchemaTypes';\n/**\n * Consumers with a known set of platform object keys can narrow `objectKey`\n * via declaration merging:\n *\n * declare module '@persona/design-system/lib/jsonSchema' {\n * interface JsonSchemaObjectKeyRegistry { objectKey: MyObjectKeyEnum }\n * }\n */\nexport interface JsonSchemaObjectKeyRegistry {}\n\nexport type JsonSchemaObjectKey = JsonSchemaObjectKeyRegistry extends {\n objectKey: infer K extends string;\n}\n ? K\n : string;\n\nexport enum JsonSchemaTypes {\n Array = 'array',\n Boolean = 'boolean',\n Integer = 'integer',\n Number = 'number',\n Object = 'object',\n String = 'string',\n Null = 'null',\n}\n\nexport type JsonSchemaBasicTypes =\n | JsonSchemaTypes.Boolean\n | JsonSchemaTypes.Integer\n | JsonSchemaTypes.Number\n | JsonSchemaTypes.String;\n\nexport interface JsonSchemaBase {\n title?: string;\n description?: string;\n examples?: (string | number)[];\n oneOf?: JsonSchema[];\n $ref?: string;\n $id?: string;\n id?: string; // custom\n // TODO: This likely should be a `JsonSchema` not an object containing only `type` but currently\n // only simple objects with a `type` property are expected.\n // Setting the correct type causes too-deep type recursion errors elsewhere.\n serializedSchema?: { type: JsonSchemaTypes } | null; // custom;\n default?: unknown;\n readOnly?: boolean;\n}\n\nexport interface JsonSchemaArray<ItemSchema = JsonSchema> extends JsonSchemaBase {\n type: JsonSchemaTypes.Array;\n items: ItemSchema;\n uniqueItems?: boolean;\n fieldType?: FieldSchemaType.Array | FieldSchemaType.MultiChoices; // custom\n default?: unknown[];\n supportedFunctions?: string[];\n}\n\nexport interface JsonSchemaBoolean extends JsonSchemaBase {\n type: JsonSchemaTypes.Boolean;\n fieldType?: FieldSchemaType.Boolean; // custom\n default?: boolean;\n}\n\nexport interface JsonSchemaInteger extends JsonSchemaBase {\n type: JsonSchemaTypes.Integer;\n enum?: number[];\n minimum?: number;\n maximum?: number;\n fieldType?: FieldSchemaType.Integer; // custom\n default?: number;\n}\n\nexport interface JsonSchemaNumber extends JsonSchemaBase {\n type: JsonSchemaTypes.Number;\n enum?: number[];\n minimum?: number;\n maximum?: number;\n fieldType?: FieldSchemaType.Number; // custom\n default?: number;\n}\n\nexport interface JsonSchemaNull extends JsonSchemaBase {\n type: JsonSchemaTypes.Null;\n default?: null;\n}\n\nexport interface JsonSchemaObject<PropertySchema = JsonSchema> extends JsonSchemaBase {\n type: JsonSchemaTypes.Object;\n properties: Record<string, PropertySchema>;\n required?: string[];\n // custom\n objectKey?: JsonSchemaObjectKey;\n // custom\n fieldType?:\n | FieldSchemaType.File\n | FieldSchemaType.Hash\n | FieldSchemaType.Json\n | FieldSchemaType.Relation\n | FieldSchemaType.DocumentGeneric\n | FieldSchemaType.GovernmentId\n | FieldSchemaType.GovernmentIdNfc\n | FieldSchemaType.Selfie;\n // custom\n isVariable?: boolean;\n // custom: picker subtitle for a chain root; generated root `description`s\n // otherwise just repeat the label and are hidden\n rootDescription?: string;\n additionalProperties?: boolean;\n baseSupportedFunctions?: string[];\n}\n\nexport const EMPTY_JSON_SCHEMA_OBJECT: JsonSchemaObject = {\n type: JsonSchemaTypes.Object,\n properties: {},\n};\n\nexport interface JsonSchemaString extends JsonSchemaBase {\n type: JsonSchemaTypes.String;\n enum?: string[];\n oneOf?: JsonSchemaConst[];\n const?: string;\n format?: string;\n group?: string; // custom\n labels?: string[]; // custom\n maxLength?: number | null;\n fieldType?:\n | FieldSchemaType.Choices\n | FieldSchemaType.Date\n | FieldSchemaType.Datetime\n | FieldSchemaType.EmailAddress\n | FieldSchemaType.String; // custom\n default?: string;\n}\n\nexport interface JsonSchemaAnyOf extends JsonSchemaBase {\n anyOf: JsonSchema[];\n}\n\nexport interface JsonSchemaConst extends JsonSchemaBase {\n const: string;\n}\n\nexport interface JsonSchemaRef extends JsonSchemaBase {\n $ref: string;\n // custom\n objectKey?: JsonSchemaObjectKey;\n}\n\nexport type JsonSchemaEmpty = Record<string, never>;\n\nexport type JsonSchemaBasic =\n | JsonSchemaBoolean\n | JsonSchemaInteger\n | JsonSchemaNumber\n | JsonSchemaString;\n\n// This is an explicit type for json schemas that only use the standard types.\n// e.g. All subschemas will have a `type` attribute.\n// This is useful for when you know you won't be dealing with any uncommon schemas like anyOf.\nexport type JsonSchemaCore =\n | JsonSchemaArray<JsonSchemaCore>\n | JsonSchemaBoolean\n | JsonSchemaInteger\n | JsonSchemaNumber\n | JsonSchemaObject<JsonSchemaCore>\n | JsonSchemaString;\n\nexport type JsonSchema =\n | JsonSchemaArray\n | JsonSchemaBoolean\n | JsonSchemaInteger\n | JsonSchemaNumber\n | JsonSchemaObject\n | JsonSchemaString\n | JsonSchemaAnyOf\n | JsonSchemaConst\n | JsonSchemaRef\n | JsonSchemaBase;\n\nexport const isJsonSchemaObject = (schema: JsonSchema): schema is JsonSchemaObject => {\n return 'type' in schema && schema.type === JsonSchemaTypes.Object;\n};\n\nexport const isJsonSchemaArray = (schema: JsonSchema): schema is JsonSchemaArray => {\n return 'type' in schema && schema.type === JsonSchemaTypes.Array;\n};\n\n/** Returns true for non-primitive schemas (object, array, or $ref to a platform object). */\nexport const isNonPrimitiveSchema = (schema: JsonSchema): boolean =>\n isJsonSchemaObject(schema) || isJsonSchemaArray(schema) || isJsonSchemaRef(schema);\n\nexport const isFileType = (\n fieldType: FieldSchemaType | undefined,\n): fieldType is FieldSchemaType.File => fieldType === FieldSchemaType.File;\n\nexport const isFileField = (schema: JsonSchema): boolean =>\n 'fieldType' in schema && isFileType(schema.fieldType);\n\nexport const isArrayWithFileItems = (schema: JsonSchema): boolean =>\n isJsonSchemaArray(schema) &&\n !!schema.items &&\n typeof schema.items === 'object' &&\n 'fieldType' in schema.items &&\n isFileType(schema.items.fieldType);\n\n/** ImageGallery accepts file schemas or arrays of file items. */\nexport const isFileSchema = (schema: JsonSchema): boolean =>\n isFileField(schema) || isArrayWithFileItems(schema);\n\nexport const isJsonSchemaRef = (schema: JsonSchema): schema is JsonSchemaRef => {\n return '$ref' in schema;\n};\n\nexport const isJsonSchemaPlatformObject = (schema: JsonSchema): schema is JsonSchemaRef => {\n return isJsonSchemaRef(schema) && 'objectKey' in schema;\n};\n\nexport const isJsonSchemaString = (schema: JsonSchema): schema is JsonSchemaString => {\n return 'type' in schema && schema.type === JsonSchemaTypes.String;\n};\n\nexport const isJsonSchemaDate = (schema: JsonSchema): schema is JsonSchemaString => {\n return (\n 'type' in schema &&\n schema.type === JsonSchemaTypes.String &&\n 'format' in schema &&\n schema.format === 'date'\n );\n};\n\nexport const isJsonSchemaDateTime = (schema: JsonSchema): schema is JsonSchemaString => {\n return (\n 'type' in schema &&\n schema.type === JsonSchemaTypes.String &&\n 'format' in schema &&\n schema.format === 'date-time'\n );\n};\n\nexport const isJsonSchemaSecret = (schema: JsonSchema): schema is JsonSchemaString => {\n return (\n 'type' in schema &&\n schema.type === JsonSchemaTypes.String &&\n 'format' in schema &&\n schema.format === 'secret'\n );\n};\n\nexport const isOneOfSchema = (\n schema: JsonSchema,\n): schema is JsonSchemaBase & { oneOf: JsonSchemaConst[] } => {\n return 'oneOf' in schema && schema.oneOf != null && Array.isArray(schema.oneOf);\n};\n\nexport const isOneOfStringSchema = (\n schema: JsonSchema,\n): schema is JsonSchemaString & { oneOf: JsonSchemaConst[] } => {\n return (\n isJsonSchemaString(schema) &&\n 'oneOf' in schema &&\n schema.oneOf != null &&\n Array.isArray(schema.oneOf)\n );\n};\n\nexport const isFunctionSchema = (schema: JsonSchema): schema is FunctionJsonSchema => {\n return schema && 'function' in schema && !!schema.function;\n};\n\nexport const genericArrayItemSchema = (\n object: JsonSchema,\n schema: FunctionParameterJsonSchema | FunctionReturnTypeJsonSchema,\n): JsonSchema | null => {\n if (!('genericType' in schema) || schema.genericType !== 'array_item_schema') {\n return null;\n }\n const array = withNameableType(object);\n return array != null && isJsonSchemaArray(array) && isSubschema(array.items) ? array.items : null;\n};\n\nexport const isPrecedingSchema = (\n schema: FunctionParameterJsonSchema | FunctionReturnTypeJsonSchema,\n) => {\n return 'genericType' in schema && schema.genericType === 'preceding_schema';\n};\n\nexport const isGenericParameterSchema = (\n schema: FunctionParameterJsonSchema | FunctionReturnTypeJsonSchema,\n): schema is FunctionGenericParameterSchema => {\n return (\n 'genericType' in schema && schema.genericType === 'parameter_schema' && 'position' in schema\n );\n};\n\nexport const isConvertedTypeSchema = (\n schema: FunctionParameterJsonSchema | FunctionReturnTypeJsonSchema,\n): schema is FunctionConvertedTypeSchema => {\n return (\n 'genericType' in schema && schema.genericType === 'converted_type' && 'schemaByValue' in schema\n );\n};\n\nexport const isJsonSchemaChoices = (schema: JsonSchema): schema is JsonSchemaString => {\n return 'type' in schema && schema.type === JsonSchemaTypes.String && 'enum' in schema;\n};\n\nexport const isJsonSchemaInteger = (schema: JsonSchema): schema is JsonSchemaInteger => {\n return 'type' in schema && schema.type === JsonSchemaTypes.Integer;\n};\n\nexport const isJsonSchemaNumber = (schema: JsonSchema): schema is JsonSchemaNumber => {\n return 'type' in schema && schema.type === JsonSchemaTypes.Number;\n};\n\nexport const isJsonSchemaBoolean = (schema: JsonSchema): schema is JsonSchemaBoolean => {\n return 'type' in schema && schema.type === JsonSchemaTypes.Boolean;\n};\n\nexport const functionParametersFromJsonSchema = (\n functionSchema: JsonSchema,\n currentSchema: JsonSchema,\n): JsonSchema[] => {\n if (!isFunctionSchema(functionSchema)) {\n return [];\n }\n\n const paramTypes = functionSchema.properties.parameterTypes;\n const orderedParams: JsonSchema[] = [];\n Object.entries(paramTypes.properties).forEach(([title, paramObject]) => {\n orderedParams[paramObject.position] = {\n title,\n ...(genericArrayItemSchema(currentSchema, paramObject) ?? paramObject),\n };\n });\n return orderedParams;\n};\n\nexport const getArrayItemType = (schema: JsonSchema): JsonSchemaTypes | null => {\n if (!isJsonSchemaArray(schema) || !('type' in schema.items) || schema.items.type == null) {\n return null;\n }\n\n const itemType = schema.items.type;\n\n switch (itemType) {\n case JsonSchemaTypes.Boolean:\n case JsonSchemaTypes.Integer:\n case JsonSchemaTypes.Number:\n case JsonSchemaTypes.Object:\n case JsonSchemaTypes.String:\n return itemType;\n case JsonSchemaTypes.Array:\n // Nested arrays are not supported for simple array item types\n return null;\n default:\n return null;\n }\n};\n\n/**\n * Display labels for field-backed schemas, whose JSON type alone is too coarse to identify them:\n * every file and relation field serializes as `object`, so only `fieldType` distinguishes a document\n * from a selfie from a plain hash. Shared by both the array-item and object branches below so a type\n * can't be labelled two ways depending on whether it is wrapped in an array.\n *\n * Values follow `FIELD_SCHEMA_TYPE_DISPLAY` in `front-end/lib/fields` so the same field reads the same in the\n * field-schema editor and in these pickers. They are duplicated rather than imported because\n * `front-end/lib/fields` imports this module, and `fieldSchemaTypes` is deliberately dependency-free.\n *\n * These are names, so they are intentionally finer-grained than `getDataTypeFromJsonSchema`, which\n * resolves the same schemas to a rendering strategy: it has no relation case (base `Field::Relation`\n * lands on `DataType.Hash`) and folds NFC into `DataType.GovernmentId`. A label wants to be as\n * specific as the schema allows; a DataType wants to be as specific as the renderer supports.\n *\n * The base `Field::Relation` appears when a producer erases the concrete subtype; \"Relation\" is\n * vague but still truer than the bare JSON type.\n */\nconst FIELD_TYPE_LABELS: Partial<Record<FieldSchemaType, string>> = {\n [FieldSchemaType.DocumentGeneric]: 'Document',\n [FieldSchemaType.File]: 'File',\n [FieldSchemaType.GovernmentId]: 'Government ID',\n [FieldSchemaType.GovernmentIdNfc]: 'Government ID NFC',\n [FieldSchemaType.Hash]: 'Hash',\n [FieldSchemaType.Json]: 'JSON',\n [FieldSchemaType.Relation]: 'Relation',\n [FieldSchemaType.Selfie]: 'Selfie',\n};\n\n/**\n * Names the field types that are all `type: 'string'` in JSON Schema and are told apart only by a\n * marker, so an item inside an array reads the same as it would on its own. Returns null for a\n * plain string, leaving the caller to fall back to the JSON type.\n */\nconst stringSubtypeLabel = (schema: JsonSchema): string | null => {\n if (!isJsonSchemaString(schema)) {\n return null;\n }\n if (schema.fieldType === FieldSchemaType.Choices) {\n return 'Choices';\n }\n // The backend platform-object schema sends both markers for an email address; a schema built\n // from a field schema on the client sends `format` alone.\n if (schema.fieldType === FieldSchemaType.EmailAddress || schema.format === 'email') {\n return 'Email Address';\n }\n if (schema.format === 'date-time') {\n return 'Datetime';\n }\n if (schema.format === 'date') {\n return 'Date';\n }\n if (schema.format === 'secret') {\n return 'Secret';\n }\n return null;\n};\n\n/**\n * An `items` slot holds a boolean in JSON Schema 2020-12, and anything at all in a hand-written\n * schema, so a label rule can only treat it as a schema once it is an object.\n */\nconst isSubschema = (items: unknown): items is JsonSchema =>\n items != null && typeof items === 'object';\n\n/**\n * Restates a `type` union as the single type it names, so a caller can apply one label rule to a\n * nullable schema and its non-nullable form alike. Returns null when the type names nothing a label\n * can use: no `type` at all, or a union wider than nullable.\n */\nconst withNameableType = (\n schema: JsonSchema | FunctionJsonSchema,\n): (JsonSchema & { type: JsonSchemaTypes }) | null => {\n if (!('type' in schema)) {\n return null;\n }\n const type = schema.type as JsonSchemaTypes | JsonSchemaTypes[];\n const nameable = typeof type === 'string' ? type : getNonNullableType(schema);\n if (nameable == null) {\n return null;\n }\n const named = { ...schema, type: nameable };\n return named as JsonSchema & { type: JsonSchemaTypes };\n};\n\nexport const humanizeSchemaType = ({\n schema,\n parentSchema = {},\n}: {\n schema: JsonSchema | FunctionJsonSchema;\n parentSchema?: JsonSchema;\n}): string => {\n if ('function' in schema && schema.function) {\n return 'Function';\n }\n\n const format = (typeName: string, { asArray = false }: { asArray?: boolean } = {}): string => {\n return startCase(typeName.split('/')[0]) + (asArray ? '[]' : '');\n };\n\n // Unlike a `type`, an `objectKey` is never narrowed before it gets here, and a customer-authored\n // schema can hold anything in it.\n const formatObjectKey = (objectKey: unknown, options: { asArray?: boolean } = {}): string =>\n typeof objectKey === 'string' ? format(objectKey, options) : 'Unsupported';\n\n if ('genericType' in schema && schema.genericType === 'array_item_schema') {\n const parent = withNameableType(parentSchema);\n\n if (parent != null && isJsonSchemaArray(parent) && isSubschema(parent.items)) {\n if ('objectKey' in parent.items && parent.items.objectKey) {\n return formatObjectKey(parent.items.objectKey);\n }\n\n if ('type' in parent.items) {\n // The option here is the item itself, so an item type that names nothing leaves no outer\n // type to fall back on.\n const items = withNameableType(parent.items);\n return items == null ? 'Unsupported' : (stringSubtypeLabel(items) ?? format(items.type));\n }\n }\n }\n\n if (isJsonSchemaRef(schema) && schema.objectKey) {\n return formatObjectKey(schema.objectKey);\n }\n\n if (!('type' in schema)) {\n return '';\n }\n\n // Resolved before any rule reads the type, so a nullable schema is labelled the same way whether\n // it stands alone or sits in an array.\n const named = withNameableType(schema);\n if (named == null) {\n // TODO(PLO-345): return one label per non-null type for multi-non-null schemas.\n return 'Unsupported';\n }\n\n if (isJsonSchemaArray(named)) {\n if (named.fieldType === FieldSchemaType.MultiChoices) {\n return 'Multi Choices';\n }\n\n if (isSubschema(named.items)) {\n if ('objectKey' in named.items && named.items.objectKey) {\n return formatObjectKey(named.items.objectKey, { asArray: true });\n }\n\n // An item schema with no nameable type leaves the array reading as its own `Array` type,\n // which is still true of the value.\n const items = withNameableType(named.items);\n if (items != null) {\n // Object items are named by their `fieldType`; ones without a recognized marker read as\n // `Hash[]` rather than `Object[]`, since a bare `object` says nothing useful to a reader.\n if (isJsonSchemaObject(items)) {\n const itemLabel = items.fieldType && FIELD_TYPE_LABELS[items.fieldType];\n return `${itemLabel ?? 'Hash'}[]`;\n }\n\n const itemLabel = stringSubtypeLabel(items);\n if (itemLabel) {\n return `${itemLabel}[]`;\n }\n\n return format(items.type, { asArray: true });\n }\n }\n }\n\n if (isJsonSchemaString(named)) {\n if ('objectKey' in named && named.objectKey != null) {\n return formatObjectKey(named.objectKey);\n }\n const label = stringSubtypeLabel(named);\n if (label) {\n return label;\n }\n }\n\n if (isJsonSchemaObject(named)) {\n if (named.objectKey) {\n return formatObjectKey(named.objectKey);\n }\n\n // An untagged object has no field type to name it, so it falls through to its JSON type.\n const label = named.fieldType && FIELD_TYPE_LABELS[named.fieldType];\n if (label) {\n return label;\n }\n }\n\n return format(named.type);\n};\n\nexport const getNonNullableType = (\n schema: JsonSchema | FunctionJsonSchema | null | undefined,\n): JsonSchemaTypes | null => {\n if (!schema || !('type' in schema)) {\n return null;\n }\n const type = schema.type as JsonSchemaTypes | JsonSchemaTypes[];\n if (!Array.isArray(type)) {\n return null;\n }\n if (type.length !== 2 || !type.includes(JsonSchemaTypes.Null)) {\n return null;\n }\n // Only the cast above makes a member a `JsonSchemaTypes`; a hand-written schema can put anything\n // in the union, and callers splat this into a `type` their own callers then read as a name.\n const nonNullable = type.find((t) => t !== JsonSchemaTypes.Null);\n return typeof nonNullable === 'string' ? nonNullable : null;\n};\n\n/**\n * Unwraps an exactly-nullable platform-object union — a `oneOf` of one `$ref`\n * member and one `null` member — to its `$ref` member. Any other shape\n * (arbitrary unions, multiple refs, inline members) returns null so it is\n * never treated as a single receiver type.\n */\nexport const getNonNullableRefSchema = (\n schema: JsonSchema | null | undefined,\n): JsonSchemaRef | null => {\n if (!schema || !('oneOf' in schema) || !Array.isArray(schema.oneOf)) {\n return null;\n }\n if ('type' in schema || schema.oneOf.length !== 2) {\n return null;\n }\n const nullMembers: JsonSchema[] = schema.oneOf.filter(\n (member) => 'type' in member && (member.type as JsonSchemaTypes) === JsonSchemaTypes.Null,\n );\n if (nullMembers.length !== 1) {\n return null;\n }\n const refMember = schema.oneOf.find((member) => !nullMembers.includes(member));\n return refMember && isJsonSchemaRef(refMember) ? refMember : null;\n};\n\nexport const isSchemaTypeAllowed = (\n schema: JsonSchema | FunctionJsonSchema | null | undefined,\n allowedTypes: readonly string[],\n): boolean => {\n if (!schema) {\n return false;\n }\n const nonNullable = getNonNullableType(schema);\n if (nonNullable) {\n return allowedTypes.includes(nonNullable);\n }\n if ('type' in schema && !Array.isArray(schema.type) && allowedTypes.includes(schema.type)) {\n return true;\n }\n if ('format' in schema && typeof schema.format === 'string') {\n return allowedTypes.includes(schema.format);\n }\n return false;\n};\n\nexport const extendSchema = (\n schemaMap: ObjectSchemaMap,\n schemaToAdd: Partial<Record<keyof typeof schemaMap, Record<string, JsonSchema>>>,\n): ObjectSchemaMap => {\n return Object.fromEntries(\n Object.entries(schemaMap).map(([key, schema]) => {\n return [\n key,\n {\n ...schema,\n properties: {\n ...schema?.properties,\n ...schemaToAdd[key],\n },\n },\n ];\n }),\n );\n};\n"],"mappings":";;;AA2BA,IAAY,kBAAL,yBAAA,iBAAA;AACL,iBAAA,WAAA;AACA,iBAAA,aAAA;AACA,iBAAA,aAAA;AACA,iBAAA,YAAA;AACA,iBAAA,YAAA;AACA,iBAAA,YAAA;AACA,iBAAA,UAAA;;KACD;AAuFD,MAAa,2BAA6C;CACxD,MAAA;CACA,YAAY,EAAE;CACf;AAiED,MAAa,sBAAsB,WAAmD;AACpF,QAAO,UAAU,UAAU,OAAO,SAAA;;AAGpC,MAAa,qBAAqB,WAAkD;AAClF,QAAO,UAAU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,KAAK,CACtB,QAAO;AAET,KAAI,KAAK,WAAW,KAAK,CAAC,KAAK,SAAA,OAA8B,CAC3D,QAAO;CAIT,MAAM,cAAc,KAAK,MAAM,MAAM,MAAA,OAA2B;AAChE,QAAO,OAAO,gBAAgB,WAAW,cAAc;;;;;;;;AASzD,MAAa,2BACX,WACyB;AACzB,KAAI,CAAC,UAAU,EAAE,WAAW,WAAW,CAAC,MAAM,QAAQ,OAAO,MAAM,CACjE,QAAO;AAET,KAAI,UAAU,UAAU,OAAO,MAAM,WAAW,EAC9C,QAAO;CAET,MAAM,cAA4B,OAAO,MAAM,QAC5C,WAAW,UAAU,UAAW,OAAO,SAAA,OACzC;AACD,KAAI,YAAY,WAAW,EACzB,QAAO;CAET,MAAM,YAAY,OAAO,MAAM,MAAM,WAAW,CAAC,YAAY,SAAS,OAAO,CAAC;AAC9E,QAAO,aAAa,gBAAgB,UAAU,GAAG,YAAY;;AAG/D,MAAa,uBACX,QACA,iBACY;AACZ,KAAI,CAAC,OACH,QAAO;CAET,MAAM,cAAc,mBAAmB,OAAO;AAC9C,KAAI,YACF,QAAO,aAAa,SAAS,YAAY;AAE3C,KAAI,UAAU,UAAU,CAAC,MAAM,QAAQ,OAAO,KAAK,IAAI,aAAa,SAAS,OAAO,KAAK,CACvF,QAAO;AAET,KAAI,YAAY,UAAU,OAAO,OAAO,WAAW,SACjD,QAAO,aAAa,SAAS,OAAO,OAAO;AAE7C,QAAO;;AAGT,MAAa,gBACX,WACA,gBACoB;AACpB,QAAO,OAAO,YACZ,OAAO,QAAQ,UAAU,CAAC,KAAK,CAAC,KAAK,YAAY;AAC/C,SAAO,CACL,KACA;GACE,GAAG;GACH,YAAY;IACV,GAAG,QAAQ;IACX,GAAG,YAAY;IAChB;GACF,CACF;GACD,CACH"}
|
|
1
|
+
{"version":3,"file":"jsonSchema.mjs","names":[],"sources":["../../lib/jsonSchema.ts"],"sourcesContent":["import { startCase } from 'lodash-es';\n\nimport type {\n FunctionConvertedTypeSchema,\n FunctionGenericParameterSchema,\n FunctionJsonSchema,\n FunctionParameterJsonSchema,\n FunctionReturnTypeJsonSchema,\n ObjectSchemaMap,\n} from './objectSchemaTypes';\n/**\n * Consumers with a known set of platform object keys can narrow `objectKey`\n * via declaration merging:\n *\n * declare module '@persona/design-system/lib/jsonSchema' {\n * interface JsonSchemaObjectKeyRegistry { objectKey: MyObjectKeyEnum }\n * }\n */\nexport interface JsonSchemaObjectKeyRegistry {}\n\nexport type JsonSchemaObjectKey = JsonSchemaObjectKeyRegistry extends {\n objectKey: infer K extends string;\n}\n ? K\n : string;\n\n/**\n * Field types are consumer-defined. Register them by mapping each field type to the JSON type it\n * serializes as (`null` when it has no fixed JSON type); PDS derives the full `fieldType` set and\n * each JSON schema interface's allowed `fieldType`s from the map:\n *\n * const FIELD_TYPE_JSON_TYPES = {\n * [MyFieldType.File]: 'object',\n * [MyFieldType.Alias]: null,\n * } as const satisfies Record<MyFieldType, `${JsonSchemaTypes}` | null>;\n *\n * declare module '@persona/design-system/lib/jsonSchema' {\n * interface JsonSchemaFieldTypeRegistry { fieldTypes: typeof FIELD_TYPE_JSON_TYPES }\n * }\n *\n * See the \"Lib/JSON Schema\" docs page for the full guide.\n */\nexport interface JsonSchemaFieldTypeRegistry {}\n\nexport type JsonSchemaFieldType = JsonSchemaFieldTypeRegistry extends { fieldTypes: infer M }\n ? keyof M & string\n : string;\n\ntype FieldTypeKind = `${Exclude<JsonSchemaTypes, JsonSchemaTypes.Null>}`;\n\ntype FieldTypeFor<K extends FieldTypeKind> = JsonSchemaFieldTypeRegistry extends {\n fieldTypes: infer M;\n}\n ? { [P in keyof M]: M[P] extends K ? P : never }[keyof M] & string\n : string;\n\n/** A field type this module gives runtime meaning to, as the consumer's type spells it. */\ntype KnownFieldType<V extends string> = string extends JsonSchemaFieldType\n ? V\n : Extract<JsonSchemaFieldType, V>;\n\nexport enum JsonSchemaTypes {\n Array = 'array',\n Boolean = 'boolean',\n Integer = 'integer',\n Number = 'number',\n Object = 'object',\n String = 'string',\n Null = 'null',\n}\n\nexport type JsonSchemaBasicTypes =\n | JsonSchemaTypes.Boolean\n | JsonSchemaTypes.Integer\n | JsonSchemaTypes.Number\n | JsonSchemaTypes.String;\n\nexport interface JsonSchemaBase {\n title?: string;\n description?: string;\n examples?: (string | number)[];\n oneOf?: JsonSchema[];\n $ref?: string;\n $id?: string;\n id?: string; // custom\n // TODO: This likely should be a `JsonSchema` not an object containing only `type` but currently\n // only simple objects with a `type` property are expected.\n // Setting the correct type causes too-deep type recursion errors elsewhere.\n serializedSchema?: { type: JsonSchemaTypes } | null; // custom;\n default?: unknown;\n readOnly?: boolean;\n}\n\nexport interface JsonSchemaArray<ItemSchema = JsonSchema> extends JsonSchemaBase {\n type: JsonSchemaTypes.Array;\n items: ItemSchema;\n uniqueItems?: boolean;\n fieldType?: FieldTypeFor<'array'>; // custom\n default?: unknown[];\n supportedFunctions?: string[];\n}\n\nexport interface JsonSchemaBoolean extends JsonSchemaBase {\n type: JsonSchemaTypes.Boolean;\n fieldType?: FieldTypeFor<'boolean'>; // custom\n default?: boolean;\n}\n\nexport interface JsonSchemaInteger extends JsonSchemaBase {\n type: JsonSchemaTypes.Integer;\n enum?: number[];\n minimum?: number;\n maximum?: number;\n fieldType?: FieldTypeFor<'integer'>; // custom\n default?: number;\n}\n\nexport interface JsonSchemaNumber extends JsonSchemaBase {\n type: JsonSchemaTypes.Number;\n enum?: number[];\n minimum?: number;\n maximum?: number;\n fieldType?: FieldTypeFor<'number'>; // custom\n default?: number;\n}\n\nexport interface JsonSchemaNull extends JsonSchemaBase {\n type: JsonSchemaTypes.Null;\n default?: null;\n}\n\nexport interface JsonSchemaObject<PropertySchema = JsonSchema> extends JsonSchemaBase {\n type: JsonSchemaTypes.Object;\n properties: Record<string, PropertySchema>;\n required?: string[];\n // custom\n objectKey?: JsonSchemaObjectKey;\n // custom\n fieldType?: FieldTypeFor<'object'>;\n // custom\n isVariable?: boolean;\n // custom: picker subtitle for a chain root; generated root `description`s\n // otherwise just repeat the label and are hidden\n rootDescription?: string;\n additionalProperties?: boolean;\n baseSupportedFunctions?: string[];\n}\n\nexport const EMPTY_JSON_SCHEMA_OBJECT: JsonSchemaObject = {\n type: JsonSchemaTypes.Object,\n properties: {},\n};\n\nexport interface JsonSchemaString extends JsonSchemaBase {\n type: JsonSchemaTypes.String;\n enum?: string[];\n oneOf?: JsonSchemaConst[];\n const?: string;\n format?: string;\n group?: string; // custom\n labels?: string[]; // custom\n maxLength?: number | null;\n fieldType?: FieldTypeFor<'string'>; // custom\n default?: string;\n}\n\nexport interface JsonSchemaAnyOf extends JsonSchemaBase {\n anyOf: JsonSchema[];\n}\n\nexport interface JsonSchemaConst extends JsonSchemaBase {\n const: string;\n}\n\nexport interface JsonSchemaRef extends JsonSchemaBase {\n $ref: string;\n // custom\n objectKey?: JsonSchemaObjectKey;\n}\n\nexport type JsonSchemaEmpty = Record<string, never>;\n\nexport type JsonSchemaBasic =\n | JsonSchemaBoolean\n | JsonSchemaInteger\n | JsonSchemaNumber\n | JsonSchemaString;\n\n// This is an explicit type for json schemas that only use the standard types.\n// e.g. All subschemas will have a `type` attribute.\n// This is useful for when you know you won't be dealing with any uncommon schemas like anyOf.\nexport type JsonSchemaCore =\n | JsonSchemaArray<JsonSchemaCore>\n | JsonSchemaBoolean\n | JsonSchemaInteger\n | JsonSchemaNumber\n | JsonSchemaObject<JsonSchemaCore>\n | JsonSchemaString;\n\nexport type JsonSchema =\n | JsonSchemaArray\n | JsonSchemaBoolean\n | JsonSchemaInteger\n | JsonSchemaNumber\n | JsonSchemaObject\n | JsonSchemaString\n | JsonSchemaAnyOf\n | JsonSchemaConst\n | JsonSchemaRef\n | JsonSchemaBase;\n\nexport const isJsonSchemaObject = (schema: JsonSchema): schema is JsonSchemaObject => {\n return 'type' in schema && schema.type === JsonSchemaTypes.Object;\n};\n\nexport const isJsonSchemaArray = (schema: JsonSchema): schema is JsonSchemaArray => {\n return 'type' in schema && schema.type === JsonSchemaTypes.Array;\n};\n\n/** Returns true for non-primitive schemas (object, array, or $ref to a platform object). */\nexport const isNonPrimitiveSchema = (schema: JsonSchema): boolean =>\n isJsonSchemaObject(schema) || isJsonSchemaArray(schema) || isJsonSchemaRef(schema);\n\nexport const isFileType = (\n fieldType: JsonSchemaFieldType | undefined,\n): fieldType is KnownFieldType<'file'> => fieldType === 'file';\n\nexport const isFileField = (schema: JsonSchema): boolean =>\n 'fieldType' in schema && isFileType(schema.fieldType);\n\nexport const isArrayWithFileItems = (schema: JsonSchema): boolean =>\n isJsonSchemaArray(schema) &&\n !!schema.items &&\n typeof schema.items === 'object' &&\n 'fieldType' in schema.items &&\n isFileType(schema.items.fieldType);\n\n/** ImageGallery accepts file schemas or arrays of file items. */\nexport const isFileSchema = (schema: JsonSchema): boolean =>\n isFileField(schema) || isArrayWithFileItems(schema);\n\nexport const isJsonSchemaRef = (schema: JsonSchema): schema is JsonSchemaRef => {\n return '$ref' in schema;\n};\n\nexport const isJsonSchemaPlatformObject = (schema: JsonSchema): schema is JsonSchemaRef => {\n return isJsonSchemaRef(schema) && 'objectKey' in schema;\n};\n\nexport const isJsonSchemaString = (schema: JsonSchema): schema is JsonSchemaString => {\n return 'type' in schema && schema.type === JsonSchemaTypes.String;\n};\n\nexport const isJsonSchemaDate = (schema: JsonSchema): schema is JsonSchemaString => {\n return (\n 'type' in schema &&\n schema.type === JsonSchemaTypes.String &&\n 'format' in schema &&\n schema.format === 'date'\n );\n};\n\nexport const isJsonSchemaDateTime = (schema: JsonSchema): schema is JsonSchemaString => {\n return (\n 'type' in schema &&\n schema.type === JsonSchemaTypes.String &&\n 'format' in schema &&\n schema.format === 'date-time'\n );\n};\n\nexport const isJsonSchemaSecret = (schema: JsonSchema): schema is JsonSchemaString => {\n return (\n 'type' in schema &&\n schema.type === JsonSchemaTypes.String &&\n 'format' in schema &&\n schema.format === 'secret'\n );\n};\n\nexport const isOneOfSchema = (\n schema: JsonSchema,\n): schema is JsonSchemaBase & { oneOf: JsonSchemaConst[] } => {\n return 'oneOf' in schema && schema.oneOf != null && Array.isArray(schema.oneOf);\n};\n\nexport const isOneOfStringSchema = (\n schema: JsonSchema,\n): schema is JsonSchemaString & { oneOf: JsonSchemaConst[] } => {\n return (\n isJsonSchemaString(schema) &&\n 'oneOf' in schema &&\n schema.oneOf != null &&\n Array.isArray(schema.oneOf)\n );\n};\n\nexport const isFunctionSchema = (schema: JsonSchema): schema is FunctionJsonSchema => {\n return schema && 'function' in schema && !!schema.function;\n};\n\nexport const genericArrayItemSchema = (\n object: JsonSchema,\n schema: FunctionParameterJsonSchema | FunctionReturnTypeJsonSchema,\n): JsonSchema | null => {\n if (!('genericType' in schema) || schema.genericType !== 'array_item_schema') {\n return null;\n }\n const array = withNameableType(object);\n return array != null && isJsonSchemaArray(array) && isSubschema(array.items) ? array.items : null;\n};\n\nexport const isPrecedingSchema = (\n schema: FunctionParameterJsonSchema | FunctionReturnTypeJsonSchema,\n) => {\n return 'genericType' in schema && schema.genericType === 'preceding_schema';\n};\n\nexport const isGenericParameterSchema = (\n schema: FunctionParameterJsonSchema | FunctionReturnTypeJsonSchema,\n): schema is FunctionGenericParameterSchema => {\n return (\n 'genericType' in schema && schema.genericType === 'parameter_schema' && 'position' in schema\n );\n};\n\nexport const isConvertedTypeSchema = (\n schema: FunctionParameterJsonSchema | FunctionReturnTypeJsonSchema,\n): schema is FunctionConvertedTypeSchema => {\n return (\n 'genericType' in schema && schema.genericType === 'converted_type' && 'schemaByValue' in schema\n );\n};\n\nexport const isJsonSchemaChoices = (schema: JsonSchema): schema is JsonSchemaString => {\n return 'type' in schema && schema.type === JsonSchemaTypes.String && 'enum' in schema;\n};\n\nexport const isJsonSchemaInteger = (schema: JsonSchema): schema is JsonSchemaInteger => {\n return 'type' in schema && schema.type === JsonSchemaTypes.Integer;\n};\n\nexport const isJsonSchemaNumber = (schema: JsonSchema): schema is JsonSchemaNumber => {\n return 'type' in schema && schema.type === JsonSchemaTypes.Number;\n};\n\nexport const isJsonSchemaBoolean = (schema: JsonSchema): schema is JsonSchemaBoolean => {\n return 'type' in schema && schema.type === JsonSchemaTypes.Boolean;\n};\n\nexport const functionParametersFromJsonSchema = (\n functionSchema: JsonSchema,\n currentSchema: JsonSchema,\n): JsonSchema[] => {\n if (!isFunctionSchema(functionSchema)) {\n return [];\n }\n\n const paramTypes = functionSchema.properties.parameterTypes;\n const orderedParams: JsonSchema[] = [];\n Object.entries(paramTypes.properties).forEach(([title, paramObject]) => {\n orderedParams[paramObject.position] = {\n title,\n ...(genericArrayItemSchema(currentSchema, paramObject) ?? paramObject),\n };\n });\n return orderedParams;\n};\n\nexport const getArrayItemType = (schema: JsonSchema): JsonSchemaTypes | null => {\n if (!isJsonSchemaArray(schema) || !('type' in schema.items) || schema.items.type == null) {\n return null;\n }\n\n const itemType = schema.items.type;\n\n switch (itemType) {\n case JsonSchemaTypes.Boolean:\n case JsonSchemaTypes.Integer:\n case JsonSchemaTypes.Number:\n case JsonSchemaTypes.Object:\n case JsonSchemaTypes.String:\n return itemType;\n case JsonSchemaTypes.Array:\n // Nested arrays are not supported for simple array item types\n return null;\n default:\n return null;\n }\n};\n\n/**\n * Display labels for field-backed schemas, whose JSON type alone is too coarse to identify them:\n * every file and relation field serializes as `object`, so only `fieldType` distinguishes a document\n * from a selfie from a plain hash. Shared by both the array-item and object branches below so a type\n * can't be labelled two ways depending on whether it is wrapped in an array.\n *\n * Values follow `FIELD_SCHEMA_TYPE_DISPLAY` in `front-end/lib/fields` so the same field reads the same in the\n * field-schema editor and in these pickers. They are duplicated rather than imported because\n * `front-end/lib/fields` imports this module, and this label map is deliberately dependency-free.\n *\n * These are names, so they are intentionally finer-grained than `getDataTypeFromJsonSchema`, which\n * resolves the same schemas to a rendering strategy: it has no relation case (base `Field::Relation`\n * lands on `DataType.Hash`) and folds NFC into `DataType.GovernmentId`. A label wants to be as\n * specific as the schema allows; a DataType wants to be as specific as the renderer supports.\n *\n * The base `Field::Relation` appears when a producer erases the concrete subtype; \"Relation\" is\n * vague but still truer than the bare JSON type.\n */\nconst FIELD_TYPE_LABELS: Partial<Record<string, string>> = {\n 'Field::Relation::Document::Generic': 'Document',\n file: 'File',\n 'Field::Relation::Document::GovernmentId': 'Government ID',\n 'Field::Relation::Document::GovernmentIdNfc': 'Government ID NFC',\n hash: 'Hash',\n json: 'JSON',\n 'platform-file': 'Platform File',\n 'Field::Relation': 'Relation',\n 'Field::Relation::Selfie': 'Selfie',\n};\n\n/**\n * Names the field types that are all `type: 'string'` in JSON Schema and are told apart only by a\n * marker, so an item inside an array reads the same as it would on its own. Returns null for a\n * plain string, leaving the caller to fall back to the JSON type.\n */\nconst stringSubtypeLabel = (schema: JsonSchema): string | null => {\n if (!isJsonSchemaString(schema)) {\n return null;\n }\n if (schema.fieldType === 'choices') {\n return 'Choices';\n }\n // The backend platform-object schema sends both markers for an email address; a schema built\n // from a field schema on the client sends `format` alone.\n if (schema.fieldType === 'email-address' || schema.format === 'email') {\n return 'Email Address';\n }\n if (schema.format === 'date-time') {\n return 'Datetime';\n }\n if (schema.format === 'date') {\n return 'Date';\n }\n if (schema.format === 'secret') {\n return 'Secret';\n }\n return null;\n};\n\n/**\n * An `items` slot holds a boolean in JSON Schema 2020-12, and anything at all in a hand-written\n * schema, so a label rule can only treat it as a schema once it is an object.\n */\nconst isSubschema = (items: unknown): items is JsonSchema =>\n items != null && typeof items === 'object';\n\n/**\n * Restates a `type` union as the single type it names, so a caller can apply one label rule to a\n * nullable schema and its non-nullable form alike. Returns null when the type names nothing a label\n * can use: no `type` at all, or a union wider than nullable.\n */\nconst withNameableType = (\n schema: JsonSchema | FunctionJsonSchema,\n): (JsonSchema & { type: JsonSchemaTypes }) | null => {\n if (!('type' in schema)) {\n return null;\n }\n const type = schema.type as JsonSchemaTypes | JsonSchemaTypes[];\n const nameable = typeof type === 'string' ? type : getNonNullableType(schema);\n if (nameable == null) {\n return null;\n }\n const named = { ...schema, type: nameable };\n return named as JsonSchema & { type: JsonSchemaTypes };\n};\n\nexport const humanizeSchemaType = ({\n schema,\n parentSchema = {},\n}: {\n schema: JsonSchema | FunctionJsonSchema;\n parentSchema?: JsonSchema;\n}): string => {\n if ('function' in schema && schema.function) {\n return 'Function';\n }\n\n const format = (typeName: string, { asArray = false }: { asArray?: boolean } = {}): string => {\n return startCase(typeName.split('/')[0]) + (asArray ? '[]' : '');\n };\n\n // Unlike a `type`, an `objectKey` is never narrowed before it gets here, and a customer-authored\n // schema can hold anything in it.\n const formatObjectKey = (objectKey: unknown, options: { asArray?: boolean } = {}): string =>\n typeof objectKey === 'string' ? format(objectKey, options) : 'Unsupported';\n\n if ('genericType' in schema && schema.genericType === 'array_item_schema') {\n const parent = withNameableType(parentSchema);\n\n if (parent != null && isJsonSchemaArray(parent) && isSubschema(parent.items)) {\n if ('objectKey' in parent.items && parent.items.objectKey) {\n return formatObjectKey(parent.items.objectKey);\n }\n\n if ('type' in parent.items) {\n // The option here is the item itself, so an item type that names nothing leaves no outer\n // type to fall back on.\n const items = withNameableType(parent.items);\n return items == null ? 'Unsupported' : (stringSubtypeLabel(items) ?? format(items.type));\n }\n }\n }\n\n if (isJsonSchemaRef(schema) && schema.objectKey) {\n return formatObjectKey(schema.objectKey);\n }\n\n if (!('type' in schema)) {\n return '';\n }\n\n // Resolved before any rule reads the type, so a nullable schema is labelled the same way whether\n // it stands alone or sits in an array.\n const named = withNameableType(schema);\n if (named == null) {\n // TODO(PLO-345): return one label per non-null type for multi-non-null schemas.\n return 'Unsupported';\n }\n\n if (isJsonSchemaArray(named)) {\n if (named.fieldType === 'multi-choices') {\n return 'Multi Choices';\n }\n\n if (isSubschema(named.items)) {\n if ('objectKey' in named.items && named.items.objectKey) {\n return formatObjectKey(named.items.objectKey, { asArray: true });\n }\n\n // An item schema with no nameable type leaves the array reading as its own `Array` type,\n // which is still true of the value.\n const items = withNameableType(named.items);\n if (items != null) {\n // Object items are named by their `fieldType`; ones without a recognized marker read as\n // `Hash[]` rather than `Object[]`, since a bare `object` says nothing useful to a reader.\n if (isJsonSchemaObject(items)) {\n const itemLabel = items.fieldType && FIELD_TYPE_LABELS[items.fieldType];\n return `${itemLabel ?? 'Hash'}[]`;\n }\n\n const itemLabel = stringSubtypeLabel(items);\n if (itemLabel) {\n return `${itemLabel}[]`;\n }\n\n return format(items.type, { asArray: true });\n }\n }\n }\n\n if (isJsonSchemaString(named)) {\n if ('objectKey' in named && named.objectKey != null) {\n return formatObjectKey(named.objectKey);\n }\n const label = stringSubtypeLabel(named);\n if (label) {\n return label;\n }\n }\n\n if (isJsonSchemaObject(named)) {\n if (named.objectKey) {\n return formatObjectKey(named.objectKey);\n }\n\n // An untagged object has no field type to name it, so it falls through to its JSON type.\n const label = named.fieldType && FIELD_TYPE_LABELS[named.fieldType];\n if (label) {\n return label;\n }\n }\n\n return format(named.type);\n};\n\nexport const getNonNullableType = (\n schema: JsonSchema | FunctionJsonSchema | null | undefined,\n): JsonSchemaTypes | null => {\n if (!schema || !('type' in schema)) {\n return null;\n }\n const type = schema.type as JsonSchemaTypes | JsonSchemaTypes[];\n if (!Array.isArray(type)) {\n return null;\n }\n if (type.length !== 2 || !type.includes(JsonSchemaTypes.Null)) {\n return null;\n }\n // Only the cast above makes a member a `JsonSchemaTypes`; a hand-written schema can put anything\n // in the union, and callers splat this into a `type` their own callers then read as a name.\n const nonNullable = type.find((t) => t !== JsonSchemaTypes.Null);\n return typeof nonNullable === 'string' ? nonNullable : null;\n};\n\n/**\n * Unwraps an exactly-nullable platform-object union — a `oneOf` of one `$ref`\n * member and one `null` member — to its `$ref` member. Any other shape\n * (arbitrary unions, multiple refs, inline members) returns null so it is\n * never treated as a single receiver type.\n */\nexport const getNonNullableRefSchema = (\n schema: JsonSchema | null | undefined,\n): JsonSchemaRef | null => {\n if (!schema || !('oneOf' in schema) || !Array.isArray(schema.oneOf)) {\n return null;\n }\n if ('type' in schema || schema.oneOf.length !== 2) {\n return null;\n }\n const nullMembers: JsonSchema[] = schema.oneOf.filter(\n (member) => 'type' in member && (member.type as JsonSchemaTypes) === JsonSchemaTypes.Null,\n );\n if (nullMembers.length !== 1) {\n return null;\n }\n const refMember = schema.oneOf.find((member) => !nullMembers.includes(member));\n return refMember && isJsonSchemaRef(refMember) ? refMember : null;\n};\n\nexport const isSchemaTypeAllowed = (\n schema: JsonSchema | FunctionJsonSchema | null | undefined,\n allowedTypes: readonly string[],\n): boolean => {\n if (!schema) {\n return false;\n }\n const nonNullable = getNonNullableType(schema);\n if (nonNullable) {\n return allowedTypes.includes(nonNullable);\n }\n if ('type' in schema && !Array.isArray(schema.type) && allowedTypes.includes(schema.type)) {\n return true;\n }\n if ('format' in schema && typeof schema.format === 'string') {\n return allowedTypes.includes(schema.format);\n }\n return false;\n};\n\nexport const extendSchema = (\n schemaMap: ObjectSchemaMap,\n schemaToAdd: Partial<Record<keyof typeof schemaMap, Record<string, JsonSchema>>>,\n): ObjectSchemaMap => {\n return Object.fromEntries(\n Object.entries(schemaMap).map(([key, schema]) => {\n return [\n key,\n {\n ...schema,\n properties: {\n ...schema?.properties,\n ...schemaToAdd[key],\n },\n },\n ];\n }),\n );\n};\n"],"mappings":";;AA6DA,IAAY,kBAAL,yBAAA,iBAAA;AACL,iBAAA,WAAA;AACA,iBAAA,aAAA;AACA,iBAAA,aAAA;AACA,iBAAA,YAAA;AACA,iBAAA,YAAA;AACA,iBAAA,YAAA;AACA,iBAAA,UAAA;;KACD;AA+ED,MAAa,2BAA6C;CACxD,MAAA;CACA,YAAY,EAAE;CACf;AA4DD,MAAa,sBAAsB,WAAmD;AACpF,QAAO,UAAU,UAAU,OAAO,SAAA;;AAGpC,MAAa,qBAAqB,WAAkD;AAClF,QAAO,UAAU,UAAU,OAAO,SAAA;;;AAIpC,MAAa,wBAAwB,WACnC,mBAAmB,OAAO,IAAI,kBAAkB,OAAO,IAAI,gBAAgB,OAAO;AAEpF,MAAa,cACX,cACwC,cAAc;AAExD,MAAa,eAAe,WAC1B,eAAe,UAAU,WAAW,OAAO,UAAU;AAEvD,MAAa,wBAAwB,WACnC,kB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AAO,OAAO,gBAAgB,WAAW,cAAc;;;;;;;;AASzD,MAAa,2BACX,WACyB;AACzB,KAAI,CAAC,UAAU,EAAE,WAAW,WAAW,CAAC,MAAM,QAAQ,OAAO,MAAM,CACjE,QAAO;AAET,KAAI,UAAU,UAAU,OAAO,MAAM,WAAW,EAC9C,QAAO;CAET,MAAM,cAA4B,OAAO,MAAM,QAC5C,WAAW,UAAU,UAAW,OAAO,SAAA,OACzC;AACD,KAAI,YAAY,WAAW,EACzB,QAAO;CAET,MAAM,YAAY,OAAO,MAAM,MAAM,WAAW,CAAC,YAAY,SAAS,OAAO,CAAC;AAC9E,QAAO,aAAa,gBAAgB,UAAU,GAAG,YAAY;;AAG/D,MAAa,uBACX,QACA,iBACY;AACZ,KAAI,CAAC,OACH,QAAO;CAET,MAAM,cAAc,mBAAmB,OAAO;AAC9C,KAAI,YACF,QAAO,aAAa,SAAS,YAAY;AAE3C,KAAI,UAAU,UAAU,CAAC,MAAM,QAAQ,OAAO,KAAK,IAAI,aAAa,SAAS,OAAO,KAAK,CACvF,QAAO;AAET,KAAI,YAAY,UAAU,OAAO,OAAO,WAAW,SACjD,QAAO,aAAa,SAAS,OAAO,OAAO;AAE7C,QAAO;;AAGT,MAAa,gBACX,WACA,gBACoB;AACpB,QAAO,OAAO,YACZ,OAAO,QAAQ,UAAU,CAAC,KAAK,CAAC,KAAK,YAAY;AAC/C,SAAO,CACL,KACA;GACE,GAAG;GACH,YAAY;IACV,GAAG,QAAQ;IACX,GAAG,YAAY;IAChB;GACF,CACF;GACD,CACH"}
|
package/dist/lib/message.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as MessageType } from "../message-
|
|
1
|
+
import { t as MessageType } from "../message-CKSLIKF0.mjs";
|
|
2
2
|
export { MessageType };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ASTNodeType } from "../components/SmartTextInput/parser/method-chain/types.mjs";
|
|
2
|
-
import { n as JsonSchema } from "../jsonSchema-
|
|
2
|
+
import { n as JsonSchema } from "../jsonSchema-DmdZYC4a.mjs";
|
|
3
3
|
import { ArrayNode, Chain, CustomFunctionNode, FunctionNode, FunctionParamType, IdentifierNode, MethodChainNode, NumberNode, StringNode } from "./methodChainTypes.mjs";
|
|
4
4
|
|
|
5
5
|
//#region components/SmartTextInput/parser/method-chain/parser.d.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { at as FunctionReturnTypeJsonSchema, et as CollectionMetaJsonSchema, it as FunctionParameterJsonSchema, nt as FunctionGenericParameterSchema, ot as GenericType, rt as FunctionJsonSchema, st as ObjectSchemaMap, tt as FunctionConvertedTypeSchema } from "../jsonSchema-DmdZYC4a.mjs";
|
|
2
2
|
export { CollectionMetaJsonSchema, FunctionConvertedTypeSchema, FunctionGenericParameterSchema, FunctionJsonSchema, FunctionParameterJsonSchema, FunctionReturnTypeJsonSchema, GenericType, ObjectSchemaMap };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as To, n as RouterAdapter, r as RouterLinkComponentProps, t as NavigateOptions } from "../../types-
|
|
2
|
-
import { n as RouterProvider, r as useRouter, t as RouterContext } from "../../RouterContext-
|
|
3
|
-
import { t as createPath } from "../../createPath-
|
|
4
|
-
import { t as RouterLink } from "../../RouterLink-
|
|
5
|
-
import { t as usePathname } from "../../useLocationPathname-
|
|
1
|
+
import { i as To, n as RouterAdapter, r as RouterLinkComponentProps, t as NavigateOptions } from "../../types-B-stjYNc.mjs";
|
|
2
|
+
import { n as RouterProvider, r as useRouter, t as RouterContext } from "../../RouterContext-CbvHIl4K.mjs";
|
|
3
|
+
import { t as createPath } from "../../createPath-Bst12Uxr.mjs";
|
|
4
|
+
import { t as RouterLink } from "../../RouterLink-v9AG9fYa.mjs";
|
|
5
|
+
import { t as usePathname } from "../../useLocationPathname-CnRd_Rzn.mjs";
|
|
6
6
|
export { NavigateOptions, RouterAdapter, RouterContext, RouterLink, RouterLinkComponentProps, RouterProvider, To, createPath, usePathname, useRouter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as semanticTokens, i as semanticOnly, n as SemanticFallback, r as semanticColor, t as MaybeSemanticTheme } from "../semanticColor-
|
|
1
|
+
import { a as semanticTokens, i as semanticOnly, n as SemanticFallback, r as semanticColor, t as MaybeSemanticTheme } from "../semanticColor-Cru2gSys.mjs";
|
|
2
2
|
export { MaybeSemanticTheme, SemanticFallback, semanticColor, semanticOnly, semanticTokens };
|
package/dist/mixins/focus.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as Variant } from "../theme-
|
|
2
|
-
import { t as PseudoClassProps } from "../PseudoClassProps-
|
|
1
|
+
import { o as Variant } from "../theme-CW6qlONZ.mjs";
|
|
2
|
+
import { t as PseudoClassProps } from "../PseudoClassProps-CHtBNv8B.mjs";
|
|
3
3
|
import * as _$styled_components0 from "styled-components";
|
|
4
4
|
|
|
5
5
|
//#region mixins/hoverable.d.ts
|
package/dist/mixins/input.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as InputSizes, r as inputMixin, t as InputMixinProps } from "../input-
|
|
1
|
+
import { n as InputSizes, r as inputMixin, t as InputMixinProps } from "../input-DVJhMlxU.mjs";
|
|
2
2
|
export { InputMixinProps, InputSizes, inputMixin as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as Variant } from "../theme-
|
|
2
|
-
import { t as PseudoClassProps } from "../PseudoClassProps-
|
|
1
|
+
import { o as Variant } from "../theme-CW6qlONZ.mjs";
|
|
2
|
+
import { t as PseudoClassProps } from "../PseudoClassProps-CHtBNv8B.mjs";
|
|
3
3
|
import * as _$styled_components0 from "styled-components";
|
|
4
4
|
|
|
5
5
|
//#region mixins/menuItem.d.ts
|
package/dist/mixins/text.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as displayMixins, c as paragraphMixins, i as ParagraphSize, n as HeadingSize, o as fontFamilyMixin, r as ParagraphMixinSize, s as headingMixins, t as DisplaySize } from "../text-
|
|
1
|
+
import { a as displayMixins, c as paragraphMixins, i as ParagraphSize, n as HeadingSize, o as fontFamilyMixin, r as ParagraphMixinSize, s as headingMixins, t as DisplaySize } from "../text-CxIup7HJ.mjs";
|
|
2
2
|
export { DisplaySize, HeadingSize, ParagraphMixinSize, ParagraphSize, displayMixins, fontFamilyMixin, headingMixins, paragraphMixins };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as FilterField, c as FilterOperator, l as FilterRule, r as DateRangeFilterValue, s as FilterFieldType, u as FilterRuleValue } from "./types-
|
|
1
|
+
import { a as FilterField, c as FilterOperator, l as FilterRule, r as DateRangeFilterValue, s as FilterFieldType, u as FilterRuleValue } from "./types-BEjWTkZV.mjs";
|
|
2
2
|
|
|
3
3
|
//#region components/DataTable/TableControls/FiltersV2/operators.d.ts
|
|
4
4
|
declare function getOperatorsForType(type: FilterFieldType): ReadonlyArray<FilterOperator>;
|
|
@@ -68,4 +68,4 @@ declare function emptyValueForRule(field: Pick<FilterField, 'type'>, operator: F
|
|
|
68
68
|
declare function reconcileValueForOperator(field: Pick<FilterField, 'type'>, nextOperator: FilterOperator, previousOperator: FilterOperator, value: FilterRuleValue): FilterRuleValue;
|
|
69
69
|
//#endregion
|
|
70
70
|
export { getDefaultOperatorForType as a, getOperatorsForType as c, isValuelessOperator as d, reconcileValueForOperator as f, fieldHasMultipleOperators as i, isCompleteDateRange as l, emptyValueForFieldType as n, getOperatorLabel as o, withValue as p, emptyValueForRule as r, getOperatorsForField as s, carriesDateRange as t, isRangeOperator as u };
|
|
71
|
-
//# sourceMappingURL=operators-
|
|
71
|
+
//# sourceMappingURL=operators-1_jTgYRX.d.mts.map
|
package/dist/operators.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as getDefaultOperatorForType, c as getOperatorsForType, d as isValuelessOperator, f as reconcileValueForOperator, i as fieldHasMultipleOperators, l as isCompleteDateRange, n as emptyValueForFieldType, o as getOperatorLabel, p as withValue, r as emptyValueForRule, s as getOperatorsForField, t as carriesDateRange, u as isRangeOperator } from "./operators-
|
|
1
|
+
import { a as getDefaultOperatorForType, c as getOperatorsForType, d as isValuelessOperator, f as reconcileValueForOperator, i as fieldHasMultipleOperators, l as isCompleteDateRange, n as emptyValueForFieldType, o as getOperatorLabel, p as withValue, r as emptyValueForRule, s as getOperatorsForField, t as carriesDateRange, u as isRangeOperator } from "./operators-1_jTgYRX.mjs";
|
|
2
2
|
export { carriesDateRange, emptyValueForFieldType, emptyValueForRule, fieldHasMultipleOperators, getDefaultOperatorForType, getOperatorLabel, getOperatorsForField, getOperatorsForType, isCompleteDateRange, isRangeOperator, isValuelessOperator, reconcileValueForOperator, withValue };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as PdsColor } from "./color-
|
|
2
|
-
import { i as PersonaTheme } from "./theme-
|
|
1
|
+
import { n as PdsColor } from "./color-LH7zKfKo.mjs";
|
|
2
|
+
import { i as PersonaTheme } from "./theme-CW6qlONZ.mjs";
|
|
3
3
|
import { Color } from "@persona/design-tokens";
|
|
4
4
|
|
|
5
5
|
//#region components/Button/palette.d.ts
|
|
@@ -18,4 +18,4 @@ interface ButtonPalette {
|
|
|
18
18
|
declare const buttonPalette: (theme: PersonaTheme, variant: ButtonVariant) => ButtonPalette;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { ButtonVariant as n, buttonPalette as r, ButtonPalette as t };
|
|
21
|
-
//# sourceMappingURL=palette-
|
|
21
|
+
//# sourceMappingURL=palette-CMOEyNPH.d.mts.map
|
package/dist/palette.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ButtonVariant, r as buttonPalette, t as ButtonPalette } from "./palette-
|
|
1
|
+
import { n as ButtonVariant, r as buttonPalette, t as ButtonPalette } from "./palette-CMOEyNPH.mjs";
|
|
2
2
|
export { ButtonPalette, ButtonVariant, buttonPalette };
|