@persona/design-system 0.10.1 → 0.10.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 +12 -0
- package/dist/{CheckboxGroupField-4dc7YXJY.d.mts → CheckboxGroupField-BrPGNIyD.d.mts} +2 -2
- package/dist/CheckboxGroupField.d.mts +1 -1
- package/dist/{Combobox-CcFJo68g.mjs → Combobox-BXHCfVpE.mjs} +2 -2
- package/dist/{Combobox-CcFJo68g.mjs.map → Combobox-BXHCfVpE.mjs.map} +1 -1
- package/dist/{Combobox-Bm2eSg56.d.mts → Combobox-D0dMN5eY.d.mts} +3 -3
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-B7ZcqU9p.d.mts → ComboboxBase-BlNi9OnF.d.mts} +2 -2
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-BkdRrH6K.d.mts → ComboboxMultiSelect-DbTYO-Yz.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-DIBRZmvS.d.mts → ComboboxSingleSelect-Cd6VYdwr.d.mts} +3 -3
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/{ConfigFormGroup-CidT_cE9.mjs → ConfigFormGroup-BE3yR_VU.mjs} +1 -1
- package/dist/{ConfigFormGroup-CidT_cE9.mjs.map → ConfigFormGroup-BE3yR_VU.mjs.map} +1 -1
- package/dist/{DataTable--_f1Obhj.d.mts → DataTable-BdKUCgcZ.d.mts} +5 -5
- package/dist/{DataTable-BoAAKhVH.mjs → DataTable-F9R-aQCg.mjs} +7 -7
- package/dist/{DataTable-BoAAKhVH.mjs.map → DataTable-F9R-aQCg.mjs.map} +1 -1
- package/dist/DataTable.d.mts +1 -1
- package/dist/{DatePicker-D0cvVbzq.mjs → DatePicker-CkNQjfCN.mjs} +2 -2
- package/dist/{DatePicker-D0cvVbzq.mjs.map → DatePicker-CkNQjfCN.mjs.map} +1 -1
- package/dist/DropdownButton.d.mts +1 -1
- package/dist/{DropdownMenu-Bie2cWjb.d.mts → DropdownMenu-nxFNS1kH.d.mts} +2 -2
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{FormField-C4B2qFgh.mjs → FormField-D0y1uRV5.mjs} +5 -5
- package/dist/{FormField-C4B2qFgh.mjs.map → FormField-D0y1uRV5.mjs.map} +1 -1
- package/dist/{HoverCopyableField-D-BubaRd.mjs → HoverCopyableField-DkOosH8z.mjs} +2 -2
- package/dist/{HoverCopyableField-D-BubaRd.mjs.map → HoverCopyableField-DkOosH8z.mjs.map} +1 -1
- package/dist/ImageThumbnail.d.mts +43 -0
- package/dist/IndexTableLayout.d.mts +3 -3
- package/dist/InlineCombobox.d.mts +1 -1
- package/dist/InlineInput.d.mts +1 -1
- package/dist/{Link-Cf__H8gD.mjs → Link-BSuXrvTu.mjs} +1 -1
- package/dist/{Link-Cf__H8gD.mjs.map → Link-BSuXrvTu.mjs.map} +1 -1
- package/dist/{ListBox-eoyBHtnJ.mjs → ListBox-BLoJVezh.mjs} +2 -2
- package/dist/{ListBox-eoyBHtnJ.mjs.map → ListBox-BLoJVezh.mjs.map} +1 -1
- package/dist/{ListBox-DIk8suJM.d.mts → ListBox-CXFI-0nG.d.mts} +2 -2
- package/dist/ListBox.d.mts +1 -1
- package/dist/{ListBoxField-DF8rqPsu.d.mts → ListBoxField-BCOrph2k.d.mts} +4 -4
- package/dist/ListBoxField.d.mts +1 -1
- package/dist/{LogicRow-uxpe1vZ1.d.mts → LogicRow-8oYRkwz5.d.mts} +2 -2
- package/dist/LogicRow.d.mts +1 -1
- package/dist/MaskedInput.d.mts +1 -1
- package/dist/{Menu-CrThaUX2.d.mts → Menu-DHnQZ5yN.d.mts} +2 -2
- package/dist/Menu.d.mts +1 -1
- package/dist/{Modal-kjUptzg1.mjs → Modal-IJdbLORi.mjs} +1 -1
- package/dist/{Modal-kjUptzg1.mjs.map → Modal-IJdbLORi.mjs.map} +1 -1
- package/dist/{Pagination-DtK-jbEY.mjs → Pagination-C5ANr9M0.mjs} +2 -2
- package/dist/{Pagination-DtK-jbEY.mjs.map → Pagination-C5ANr9M0.mjs.map} +1 -1
- package/dist/{Pii-DueIK287.mjs → Pii-G16_b7Yk.mjs} +1 -1
- package/dist/{Pii-DueIK287.mjs.map → Pii-G16_b7Yk.mjs.map} +1 -1
- package/dist/{Popover-BcII7usF.mjs → Popover-532iYFek.mjs} +1 -1
- package/dist/{Popover-BcII7usF.mjs.map → Popover-532iYFek.mjs.map} +1 -1
- package/dist/{Select-CsxK6A5m.d.mts → Select-CSbamhJO.d.mts} +2 -2
- package/dist/{Select-BJ9ACmRD.mjs → Select-hnXfPywt.mjs} +1 -1
- package/dist/{Select-BJ9ACmRD.mjs.map → Select-hnXfPywt.mjs.map} +1 -1
- package/dist/Select.d.mts +1 -1
- package/dist/SelectionCard.d.mts +51 -0
- package/dist/SelectionCardGroup.d.mts +37 -0
- package/dist/SmartTextInputField.d.mts +2 -2
- package/dist/{Spinner-uVZyOh1T.mjs → Spinner-AnIk8d9M.mjs} +1 -1
- package/dist/{Spinner-uVZyOh1T.mjs.map → Spinner-AnIk8d9M.mjs.map} +1 -1
- package/dist/{Table--o4ZLRbb.mjs → Table-CmuWqmVN.mjs} +2 -2
- package/dist/{Table--o4ZLRbb.mjs.map → Table-CmuWqmVN.mjs.map} +1 -1
- package/dist/{TableBox-3qunC9Nl.mjs → TableBox-BRJunn09.mjs} +4 -4
- package/dist/{TableBox-3qunC9Nl.mjs.map → TableBox-BRJunn09.mjs.map} +1 -1
- package/dist/TableBox.d.mts +1 -1
- package/dist/{TableBoxCell-okcOQ5Ec.d.mts → TableBoxCell-Cag3ZYRs.d.mts} +4 -4
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/{TableBoxField-DR-SJY9z.d.mts → TableBoxField-C3Cg6Lv5.d.mts} +5 -5
- package/dist/TableBoxField.d.mts +1 -1
- package/dist/{TableBoxRow-DiuAB_rV.d.mts → TableBoxRow-y5ay5lMt.d.mts} +2 -2
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-Cm4KJsAD.d.mts → TableBoxRowActions-CDdVjAPQ.d.mts} +2 -2
- package/dist/TableBoxRowActions.d.mts +1 -1
- package/dist/{TableControls-n16XKO9S.mjs → TableControls-C5fNNdmT.mjs} +64 -25
- package/dist/TableControls-C5fNNdmT.mjs.map +1 -0
- package/dist/{TableControls-B9bvsNUc.d.mts → TableControls-DCtTiWk6.d.mts} +3 -3
- package/dist/TableControls.d.mts +1 -1
- package/dist/{TableControlsContext-CZThYoj5.d.mts → TableControlsContext-CzJCMrSe.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableViewConfigurationDropdown-CvN7tE98.d.mts → TableViewConfigurationDropdown-BvOlDkJy.d.mts} +2 -2
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/{clientFilterUtils-BXEpzorX.d.mts → clientFilterUtils-BqDn44aM.d.mts} +2 -2
- package/dist/clientFilterUtils.d.mts +1 -1
- package/dist/components/Combobox/index.d.mts +2 -2
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/ConfigFormGroup/index.mjs +1 -1
- package/dist/components/DataTable/TableControls/index.d.mts +5 -5
- package/dist/components/DataTable/TableControls/index.mjs +1 -1
- package/dist/components/DataTable/index.d.mts +5 -5
- package/dist/components/DataTable/index.mjs +1 -1
- package/dist/components/DataTable/types.d.mts +1 -1
- package/dist/components/DatePicker/index.mjs +1 -1
- package/dist/components/DropdownMenu/index.d.mts +1 -1
- package/dist/components/FormField/index.d.mts +4 -4
- package/dist/components/FormField/index.mjs +1 -1
- package/dist/components/HoverCopyableField/index.mjs +1 -1
- package/dist/components/ImageTile/index.mjs +82 -52
- package/dist/components/ImageTile/index.mjs.map +1 -1
- package/dist/components/Link/index.mjs +1 -1
- package/dist/components/ListBox/index.d.mts +3 -3
- package/dist/components/ListBox/index.mjs +1 -1
- package/dist/components/Menu/index.d.mts +1 -1
- package/dist/components/Modal/index.mjs +1 -1
- package/dist/components/Pagination/index.mjs +1 -1
- package/dist/components/Pii/index.mjs +1 -1
- package/dist/components/Popover/index.mjs +1 -1
- package/dist/components/Select/index.d.mts +1 -1
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/SelectionCard/index.d.mts +3 -0
- package/dist/components/SelectionCard/index.mjs +264 -0
- package/dist/components/SelectionCard/index.mjs.map +1 -0
- package/dist/components/SmartTextInput/index.mjs +1 -1
- package/dist/components/Spinner/index.mjs +1 -1
- package/dist/components/Table/index.mjs +1 -1
- package/dist/components/TableBox/index.d.mts +1 -1
- package/dist/components/TableBox/index.mjs +1 -1
- package/dist/components/VersionHistory/index.mjs +2 -2
- package/dist/fieldPickerOptions.d.mts +1 -1
- package/dist/{filters-ogUUmLEf.d.mts → filters-jG9Y3UKb.d.mts} +2 -2
- package/dist/filters.d.mts +1 -1
- package/dist/{helpers-Dqw5PEva.d.mts → helpers-DCIto6aY.d.mts} +2 -2
- package/dist/helpers.d.mts +1 -1
- package/dist/{index-Ck939aXd.d.mts → index-C3uFHTo0.d.mts} +3 -3
- package/dist/{inputFields-DVLg_2wz.d.mts → inputFields-mUsms2tO.d.mts} +4 -4
- package/dist/inputFields.d.mts +1 -1
- package/dist/patterns/IndexTableLayout/index.mjs +1 -1
- package/dist/patterns/LayoutLoadingShimmer/index.mjs +1 -1
- package/dist/patterns/WizardModal/index.mjs +1 -1
- package/dist/{types-Bdi8Y7ll.d.mts → types-CrRWZ0Ia.d.mts} +3 -3
- package/dist/{types-BQP14Fng.d.mts → types-DxJyE_U8.d.mts} +2 -2
- package/dist/types5.d.mts +1 -1
- package/dist/useColumnConfiguration.d.mts +2 -2
- package/dist/useComboboxFooterAction.d.mts +1 -1
- package/dist/{useTableColumns-DdU0CLcU.d.mts → useTableColumns-DSXRInPb.d.mts} +2 -2
- package/dist/useTableColumns.d.mts +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/package.json +3 -1
- package/skills/ui-authoring/COMPONENTS.md +1 -0
- package/skills/ui-authoring/PATTERNS.md +5 -1
- package/dist/TableControls-n16XKO9S.mjs.map +0 -1
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { a as styled, r as css } from "../../styledComponentsInterop-NxwFjeA4.mjs";
|
|
2
|
+
import { semanticColor, semanticOnly, semanticTokens } from "../../lib/semanticColor.mjs";
|
|
3
|
+
import { i as Paragraph } from "../../Text-CSwFifQF.mjs";
|
|
4
|
+
import { a as Tooltip } from "../../Tooltip-B-0VRuKT.mjs";
|
|
5
|
+
import { opacityOf, withAlpha } from "../../lib/color.mjs";
|
|
6
|
+
import useControlled from "../../lib/useControlled.mjs";
|
|
7
|
+
import { focusStyle } from "../../mixins/focus.mjs";
|
|
8
|
+
import { n as Stack, t as HStack } from "../../Stack-BkC7FCdF.mjs";
|
|
9
|
+
import { n as useFormField, t as FormControlContext } from "../../useFormField-CbNYbDdp.mjs";
|
|
10
|
+
import { t as Checkbox } from "../../Checkbox-BaJ-dGdX.mjs";
|
|
11
|
+
import { Color, Spacing } from "@persona/design-tokens";
|
|
12
|
+
import { Children, cloneElement, isValidElement, useContext } from "react";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
//#region components/SelectionCard/SelectionCard.tsx
|
|
15
|
+
const CardRoot = styled.label`
|
|
16
|
+
position: relative;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
flex: 1 1 auto;
|
|
20
|
+
width: 100%;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
cursor: ${({ $disabled }) => $disabled ? "default" : "pointer"};
|
|
24
|
+
pointer-events: ${({ $disabled }) => $disabled ? "none" : "auto"};
|
|
25
|
+
border-radius: ${({ theme }) => theme.card.borderRadius};
|
|
26
|
+
outline: none;
|
|
27
|
+
|
|
28
|
+
/* Keyboard focus only. A click focuses the input too, and should not draw this ring. */
|
|
29
|
+
&:has(:focus-visible) {
|
|
30
|
+
${focusStyle}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
border: 1px solid
|
|
34
|
+
${({ theme, $selected, $disabled }) => {
|
|
35
|
+
if ($disabled) return semanticColor(theme, "InputBorderDisabled", Color.BorderInputDisabled);
|
|
36
|
+
if ($selected) return semanticColor(theme, "BorderAccent", theme.color.primary.brand);
|
|
37
|
+
return semanticColor(theme, "BorderDefault", theme.color.border.input);
|
|
38
|
+
}};
|
|
39
|
+
|
|
40
|
+
background-color: ${({ theme, $selected, $disabled }) => {
|
|
41
|
+
if ($disabled) return semanticColor(theme, "InputSurfaceDisabled", Color.BackgroundInputDisabled);
|
|
42
|
+
if ($selected) {
|
|
43
|
+
const tokens = semanticTokens(theme);
|
|
44
|
+
return tokens ? withAlpha(tokens.SurfaceAccent, tokens.Opacity25) : theme.color.background.highlight;
|
|
45
|
+
}
|
|
46
|
+
return semanticColor(theme, "SurfacePrimary", theme.color.background.primary);
|
|
47
|
+
}};
|
|
48
|
+
|
|
49
|
+
${({ $disabled, $selected }) => !$disabled && !$selected && css`
|
|
50
|
+
&:hover {
|
|
51
|
+
background-color: ${({ theme }) => semanticColor(theme, "SurfaceHover", Color.BackgroundInteractiveHover)};
|
|
52
|
+
}
|
|
53
|
+
`}
|
|
54
|
+
|
|
55
|
+
${({ $disabled }) => $disabled && css`
|
|
56
|
+
${semanticOnly((tokens) => `opacity: ${opacityOf(tokens.Opacity65)};`)}
|
|
57
|
+
`}
|
|
58
|
+
`;
|
|
59
|
+
const Body = styled.div`
|
|
60
|
+
padding: ${Spacing[4]};
|
|
61
|
+
`;
|
|
62
|
+
const Copy = styled(Stack)`
|
|
63
|
+
flex: 1 1 auto;
|
|
64
|
+
min-width: 0;
|
|
65
|
+
`;
|
|
66
|
+
/** Centers a 16px icon on the label line. `iconBackground` gives it a 32px well. */
|
|
67
|
+
const IconSlot = styled.span`
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
flex: 0 0 auto;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
align-self: flex-start;
|
|
73
|
+
min-height: ${Spacing[5]};
|
|
74
|
+
color: ${({ theme }) => semanticColor(theme, "FgPrimary", theme.color.text.primary)};
|
|
75
|
+
|
|
76
|
+
svg {
|
|
77
|
+
width: 16px;
|
|
78
|
+
height: 16px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
${({ $background, theme }) => $background && css`
|
|
82
|
+
width: ${Spacing[6]};
|
|
83
|
+
height: ${Spacing[6]};
|
|
84
|
+
border-radius: ${theme.card.borderRadius};
|
|
85
|
+
background-color: ${semanticColor(theme, "SurfaceSecondary", theme.color.background.secondary)};
|
|
86
|
+
`}
|
|
87
|
+
`;
|
|
88
|
+
const Marker = styled.span`
|
|
89
|
+
display: inline-flex;
|
|
90
|
+
flex: 0 0 auto;
|
|
91
|
+
align-items: center;
|
|
92
|
+
height: ${Spacing[5]};
|
|
93
|
+
|
|
94
|
+
/* The card draws the only focus ring and the only disabled fade. */
|
|
95
|
+
&& input:focus-visible ~ [aria-hidden] {
|
|
96
|
+
outline: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&& input ~ [aria-hidden] {
|
|
100
|
+
opacity: 1;
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
103
|
+
const NativeRadio = styled.input`
|
|
104
|
+
cursor: inherit;
|
|
105
|
+
position: absolute;
|
|
106
|
+
inset: 0;
|
|
107
|
+
margin: 0;
|
|
108
|
+
opacity: 0;
|
|
109
|
+
border: 0;
|
|
110
|
+
outline: none;
|
|
111
|
+
pointer-events: none;
|
|
112
|
+
`;
|
|
113
|
+
const TooltipTrigger = styled.span`
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
width: 100%;
|
|
117
|
+
align-self: stretch;
|
|
118
|
+
`;
|
|
119
|
+
const SelectionCard = ({ value, label, description, icon, iconBackground = false, disabled: disabledProp, disabledReason, name, checked = false, onChange, multiple = false, className }) => {
|
|
120
|
+
const disabled = !!useFormField({ disabled: disabledProp || void 0 }).disabled;
|
|
121
|
+
const card = /* @__PURE__ */ jsxs(CardRoot, {
|
|
122
|
+
className,
|
|
123
|
+
$selected: checked,
|
|
124
|
+
$disabled: disabled,
|
|
125
|
+
children: [/* @__PURE__ */ jsx(Body, { children: /* @__PURE__ */ jsxs(HStack, {
|
|
126
|
+
align: "flex-start",
|
|
127
|
+
spacing: icon ? Spacing[3] : Spacing[2],
|
|
128
|
+
children: [
|
|
129
|
+
multiple && /* @__PURE__ */ jsx(Marker, { children: /* @__PURE__ */ jsx(Checkbox, {
|
|
130
|
+
name,
|
|
131
|
+
value,
|
|
132
|
+
checked,
|
|
133
|
+
disabled,
|
|
134
|
+
onChange: (event) => onChange?.(event.target.checked)
|
|
135
|
+
}) }),
|
|
136
|
+
icon && /* @__PURE__ */ jsx(IconSlot, {
|
|
137
|
+
$background: iconBackground,
|
|
138
|
+
children: icon
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ jsxs(Copy, {
|
|
141
|
+
spacing: Spacing[1],
|
|
142
|
+
children: [/* @__PURE__ */ jsx(Paragraph, {
|
|
143
|
+
as: "span",
|
|
144
|
+
size: "lg",
|
|
145
|
+
weight: "bold",
|
|
146
|
+
color: disabled ? "disabled" : "primary",
|
|
147
|
+
children: label
|
|
148
|
+
}), description && /* @__PURE__ */ jsx(Paragraph, {
|
|
149
|
+
as: "span",
|
|
150
|
+
size: "md",
|
|
151
|
+
color: disabled ? "disabled" : checked ? "primary" : "secondary",
|
|
152
|
+
children: description
|
|
153
|
+
})]
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
}) }), !multiple && /* @__PURE__ */ jsx(NativeRadio, {
|
|
157
|
+
type: "radio",
|
|
158
|
+
name,
|
|
159
|
+
value,
|
|
160
|
+
checked,
|
|
161
|
+
disabled,
|
|
162
|
+
onChange: () => onChange?.(true)
|
|
163
|
+
})]
|
|
164
|
+
});
|
|
165
|
+
if (disabled && disabledReason) return /* @__PURE__ */ jsx(Tooltip, {
|
|
166
|
+
trigger: /* @__PURE__ */ jsx(TooltipTrigger, { children: card }),
|
|
167
|
+
children: disabledReason
|
|
168
|
+
});
|
|
169
|
+
return card;
|
|
170
|
+
};
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region components/SelectionCard/SelectionCardGroup.tsx
|
|
173
|
+
const selectionCards = (children) => Children.toArray(children).filter((child) => isValidElement(child) && child.type === SelectionCard);
|
|
174
|
+
const firstSelectableValue = (children) => selectionCards(children).find((card) => !card.props.disabled)?.props.value;
|
|
175
|
+
const groupLayout = (children, stack) => {
|
|
176
|
+
const inline = selectionCards(children).length === 2 && !stack;
|
|
177
|
+
return {
|
|
178
|
+
$inline: inline,
|
|
179
|
+
direction: inline ? "horizontal" : "vertical",
|
|
180
|
+
equal: inline,
|
|
181
|
+
align: inline ? "stretch" : void 0
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
const Group = styled(Stack)`
|
|
185
|
+
${({ $inline }) => $inline && css`
|
|
186
|
+
> * {
|
|
187
|
+
width: auto;
|
|
188
|
+
min-width: 0;
|
|
189
|
+
align-self: stretch;
|
|
190
|
+
}
|
|
191
|
+
`}
|
|
192
|
+
`;
|
|
193
|
+
const renderCards = (children, getProps) => Children.map(children, (child) => {
|
|
194
|
+
if (!isValidElement(child) || child.type !== SelectionCard) return child;
|
|
195
|
+
const card = child;
|
|
196
|
+
return cloneElement(card, getProps(card.props));
|
|
197
|
+
});
|
|
198
|
+
const SingleGroup = ({ name, className, stack, children, value: valueProp, defaultValue, onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-required": ariaRequired }) => {
|
|
199
|
+
const field = useContext(FormControlContext);
|
|
200
|
+
const [value, setValue] = useControlled({
|
|
201
|
+
controlledValue: valueProp,
|
|
202
|
+
default: defaultValue ?? (field.disabled ? void 0 : firstSelectableValue(children))
|
|
203
|
+
});
|
|
204
|
+
return /* @__PURE__ */ jsx(Group, {
|
|
205
|
+
...groupLayout(children, stack),
|
|
206
|
+
className,
|
|
207
|
+
spacing: Spacing[2],
|
|
208
|
+
role: "radiogroup",
|
|
209
|
+
"aria-label": ariaLabel,
|
|
210
|
+
"aria-labelledby": ariaLabelledby,
|
|
211
|
+
"aria-required": ariaRequired,
|
|
212
|
+
children: renderCards(children, (card) => ({
|
|
213
|
+
name,
|
|
214
|
+
multiple: false,
|
|
215
|
+
checked: card.value === value,
|
|
216
|
+
onChange: () => {
|
|
217
|
+
if (field.disabled || card.disabled) return;
|
|
218
|
+
setValue(card.value);
|
|
219
|
+
onChange?.(card.value);
|
|
220
|
+
}
|
|
221
|
+
}))
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
const MultipleGroup = ({ name, className, stack, children, value: valueProp, defaultValue, onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby }) => {
|
|
225
|
+
const field = useContext(FormControlContext);
|
|
226
|
+
const [value, setValue] = useControlled({
|
|
227
|
+
controlledValue: valueProp,
|
|
228
|
+
default: defaultValue ?? []
|
|
229
|
+
});
|
|
230
|
+
const selected = value ?? [];
|
|
231
|
+
return /* @__PURE__ */ jsx(Group, {
|
|
232
|
+
...groupLayout(children, stack),
|
|
233
|
+
className,
|
|
234
|
+
spacing: Spacing[2],
|
|
235
|
+
role: "group",
|
|
236
|
+
"aria-label": ariaLabel,
|
|
237
|
+
"aria-labelledby": ariaLabelledby,
|
|
238
|
+
children: renderCards(children, (card) => ({
|
|
239
|
+
name,
|
|
240
|
+
multiple: true,
|
|
241
|
+
checked: selected.includes(card.value),
|
|
242
|
+
onChange: (checked) => {
|
|
243
|
+
if (field.disabled || card.disabled) return;
|
|
244
|
+
const next = checked ? selected.includes(card.value) ? selected : [...selected, card.value] : selected.filter((item) => item !== card.value);
|
|
245
|
+
setValue(next);
|
|
246
|
+
onChange?.(next);
|
|
247
|
+
}
|
|
248
|
+
}))
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
const SelectionCardGroup = (props) => {
|
|
252
|
+
const field = useContext(FormControlContext);
|
|
253
|
+
return /* @__PURE__ */ jsx(FormControlContext.Provider, {
|
|
254
|
+
value: {
|
|
255
|
+
...field,
|
|
256
|
+
inputId: void 0
|
|
257
|
+
},
|
|
258
|
+
children: props.multiple ? /* @__PURE__ */ jsx(MultipleGroup, { ...props }) : /* @__PURE__ */ jsx(SingleGroup, { ...props })
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
//#endregion
|
|
262
|
+
export { SelectionCard, SelectionCard as default, SelectionCardGroup };
|
|
263
|
+
|
|
264
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../components/SelectionCard/SelectionCard.tsx","../../../components/SelectionCard/SelectionCardGroup.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Checkbox from '@persona/design-system/components/Checkbox';\nimport { HStack, Stack } from '@persona/design-system/components/Stack';\nimport { Paragraph } from '@persona/design-system/components/Text';\nimport { Tooltip } from '@persona/design-system/components/Tooltip';\nimport { focusStyle } from '@persona/design-system/mixins/focus';\nimport { Color, Spacing } from '@persona/design-tokens';\nimport useFormField from 'design-system/components/FormControl/useFormField';\nimport { opacityOf, withAlpha } from 'design-system/lib/color';\nimport { semanticColor, semanticOnly, semanticTokens } from 'design-system/lib/semanticColor';\n\nexport interface SelectionCardProps {\n /** Value submitted with the group when this card is selected. */\n value: string;\n /** Required visible name. Left-aligned with `description`. */\n label: string;\n /** Optional supporting copy under the label. Omitted when not passed. */\n description?: string;\n /**\n * Optional icon to the left of the label. Leave it off when it does not add\n * meaning, including in multiple mode.\n */\n icon?: ReactElement;\n /**\n * Draw a secondary background behind `icon`. Ignored when `icon` is omitted.\n */\n iconBackground?: boolean;\n disabled?: boolean;\n /** Tooltip shown on hover only while `disabled` is set. */\n disabledReason?: string;\n /** Injected by `SelectionCardGroup`. */\n name?: string;\n /** Injected by `SelectionCardGroup`. */\n checked?: boolean;\n /** Injected by `SelectionCardGroup`. */\n onChange?: (checked: boolean) => void;\n /** Injected by `SelectionCardGroup`. */\n multiple?: boolean;\n /** Layout hook for this card. */\n className?: string;\n}\n\nconst CardRoot = styled.label<{ $selected: boolean; $disabled: boolean }>`\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n box-sizing: border-box;\n overflow: hidden;\n cursor: ${({ $disabled }) => ($disabled ? 'default' : 'pointer')};\n pointer-events: ${({ $disabled }) => ($disabled ? 'none' : 'auto')};\n border-radius: ${({ theme }) => theme.card.borderRadius};\n outline: none;\n\n /* Keyboard focus only. A click focuses the input too, and should not draw this ring. */\n &:has(:focus-visible) {\n ${focusStyle}\n }\n\n border: 1px solid\n ${({ theme, $selected, $disabled }) => {\n if ($disabled) {\n return semanticColor(theme, 'InputBorderDisabled', Color.BorderInputDisabled);\n }\n if ($selected) {\n return semanticColor(theme, 'BorderAccent', theme.color.primary.brand);\n }\n return semanticColor(theme, 'BorderDefault', theme.color.border.input);\n }};\n\n background-color: ${({ theme, $selected, $disabled }) => {\n if ($disabled) {\n return semanticColor(theme, 'InputSurfaceDisabled', Color.BackgroundInputDisabled);\n }\n if ($selected) {\n const tokens = semanticTokens(theme);\n return tokens\n ? withAlpha(tokens.SurfaceAccent, tokens.Opacity25)\n : theme.color.background.highlight;\n }\n return semanticColor(theme, 'SurfacePrimary', theme.color.background.primary);\n }};\n\n ${({ $disabled, $selected }) =>\n !$disabled &&\n !$selected &&\n css`\n &:hover {\n background-color: ${({ theme }) =>\n semanticColor(theme, 'SurfaceHover', Color.BackgroundInteractiveHover)};\n }\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n ${semanticOnly((tokens) => `opacity: ${opacityOf(tokens.Opacity65)};`)}\n `}\n`;\n\nconst Body = styled.div`\n padding: ${Spacing[4]};\n`;\n\nconst Copy = styled(Stack)`\n flex: 1 1 auto;\n min-width: 0;\n`;\n\n/** Centers a 16px icon on the label line. `iconBackground` gives it a 32px well. */\nconst IconSlot = styled.span<{ $background: boolean }>`\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n justify-content: center;\n align-self: flex-start;\n min-height: ${Spacing[5]};\n color: ${({ theme }) => semanticColor(theme, 'FgPrimary', theme.color.text.primary)};\n\n svg {\n width: 16px;\n height: 16px;\n }\n\n ${({ $background, theme }) =>\n $background &&\n css`\n width: ${Spacing[6]};\n height: ${Spacing[6]};\n border-radius: ${theme.card.borderRadius};\n background-color: ${semanticColor(theme, 'SurfaceSecondary', theme.color.background.secondary)};\n `}\n`;\nconst Marker = styled.span`\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n height: ${Spacing[5]};\n\n /* The card draws the only focus ring and the only disabled fade. */\n && input:focus-visible ~ [aria-hidden] {\n outline: none;\n }\n\n && input ~ [aria-hidden] {\n opacity: 1;\n }\n`;\n\nconst NativeRadio = styled.input`\n cursor: inherit;\n position: absolute;\n inset: 0;\n margin: 0;\n opacity: 0;\n border: 0;\n outline: none;\n pointer-events: none;\n`;\n\nconst TooltipTrigger = styled.span`\n display: flex;\n flex-direction: column;\n width: 100%;\n align-self: stretch;\n`;\n\nexport const SelectionCard = ({\n value,\n label,\n description,\n icon,\n iconBackground = false,\n disabled: disabledProp,\n disabledReason,\n name,\n checked = false,\n onChange,\n multiple = false,\n className,\n}: SelectionCardProps) => {\n const field = useFormField({ disabled: disabledProp || undefined });\n const disabled = !!field.disabled;\n const card = (\n <CardRoot className={className} $selected={checked} $disabled={disabled}>\n <Body>\n <HStack align='flex-start' spacing={icon ? Spacing[3] : Spacing[2]}>\n {multiple && (\n <Marker>\n <Checkbox\n name={name}\n value={value}\n checked={checked}\n disabled={disabled}\n onChange={(event) => onChange?.(event.target.checked)}\n />\n </Marker>\n )}\n {icon && <IconSlot $background={iconBackground}>{icon}</IconSlot>}\n <Copy spacing={Spacing[1]}>\n <Paragraph as='span' size='lg' weight='bold' color={disabled ? 'disabled' : 'primary'}>\n {label}\n </Paragraph>\n {description && (\n <Paragraph\n as='span'\n size='md'\n color={disabled ? 'disabled' : checked ? 'primary' : 'secondary'}\n >\n {description}\n </Paragraph>\n )}\n </Copy>\n </HStack>\n </Body>\n {!multiple && (\n <NativeRadio\n type='radio'\n name={name}\n value={value}\n checked={checked}\n disabled={disabled}\n onChange={() => onChange?.(true)}\n />\n )}\n </CardRoot>\n );\n\n if (disabled && disabledReason) {\n return <Tooltip trigger={<TooltipTrigger>{card}</TooltipTrigger>}>{disabledReason}</Tooltip>;\n }\n\n return card;\n};\n\nexport default SelectionCard;\n","import {\n Children,\n cloneElement,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useContext,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Stack from '@persona/design-system/components/Stack';\nimport { Spacing } from '@persona/design-tokens';\nimport { FormControlContext } from 'design-system/components/FormControl/useFormField';\nimport useControlled from 'design-system/lib/useControlled';\n\nimport SelectionCard, { type SelectionCardProps } from './SelectionCard';\n\ninterface SelectionCardGroupBaseProps {\n /** Shared input name. Radios in a single group arrow-key together. */\n name?: string;\n /** Layout hook for the group. Not forwarded onto each card. */\n className?: string;\n /** Place two cards in a column. Two cards sit side by side when this is omitted. Three or more always stack. */\n stack?: boolean;\n /** Accessible name for the group. */\n 'aria-label'?: string;\n /** Id of the element that names the group, such as a field label. */\n 'aria-labelledby'?: string;\n children: ReactNode;\n}\n\nexport interface SelectionCardGroupSingleProps extends SelectionCardGroupBaseProps {\n /** One card may be selected. Cards render no radio mark. */\n multiple?: false;\n 'aria-required'?: boolean;\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n}\n\nexport interface SelectionCardGroupMultipleProps extends SelectionCardGroupBaseProps {\n /** Several cards may be selected. Each card shows a checkbox. */\n multiple: true;\n value?: string[];\n defaultValue?: string[];\n onChange?: (value: string[]) => void;\n}\n\nexport type SelectionCardGroupProps =\n | SelectionCardGroupSingleProps\n | SelectionCardGroupMultipleProps;\n\nconst selectionCards = (children: ReactNode) =>\n Children.toArray(children).filter(\n (child): child is ReactElement<SelectionCardProps> =>\n isValidElement(child) && child.type === SelectionCard,\n );\n\nconst firstSelectableValue = (children: ReactNode) =>\n selectionCards(children).find((card) => !card.props.disabled)?.props.value;\n\nconst groupLayout = (children: ReactNode, stack?: boolean) => {\n const inline = selectionCards(children).length === 2 && !stack;\n return {\n $inline: inline,\n direction: inline ? ('horizontal' as const) : ('vertical' as const),\n equal: inline,\n align: inline ? ('stretch' as const) : undefined,\n };\n};\n\nconst Group = styled(Stack)<{ $inline: boolean }>`\n ${({ $inline }) =>\n $inline &&\n css`\n > * {\n width: auto;\n min-width: 0;\n align-self: stretch;\n }\n `}\n`;\nconst renderCards = (\n children: ReactNode,\n getProps: (card: SelectionCardProps) => Partial<SelectionCardProps>,\n) =>\n Children.map(children, (child) => {\n if (!isValidElement(child) || child.type !== SelectionCard) {\n return child;\n }\n const card = child as ReactElement<SelectionCardProps>;\n return cloneElement(card, getProps(card.props));\n });\n\nconst SingleGroup = ({\n name,\n className,\n stack,\n children,\n value: valueProp,\n defaultValue,\n onChange,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-required': ariaRequired,\n}: SelectionCardGroupSingleProps) => {\n const field = useContext(FormControlContext);\n const [value, setValue] = useControlled({\n controlledValue: valueProp,\n default: defaultValue ?? (field.disabled ? undefined : firstSelectableValue(children)),\n });\n\n return (\n <Group\n {...groupLayout(children, stack)}\n className={className}\n spacing={Spacing[2]}\n role='radiogroup'\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-required={ariaRequired}\n >\n {renderCards(children, (card) => ({\n name,\n multiple: false,\n checked: card.value === value,\n onChange: () => {\n if (field.disabled || card.disabled) {\n return;\n }\n setValue(card.value);\n onChange?.(card.value);\n },\n }))}\n </Group>\n );\n};\n\nconst MultipleGroup = ({\n name,\n className,\n stack,\n children,\n value: valueProp,\n defaultValue,\n onChange,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n}: SelectionCardGroupMultipleProps) => {\n const field = useContext(FormControlContext);\n const [value, setValue] = useControlled({\n controlledValue: valueProp,\n default: defaultValue ?? [],\n });\n const selected = value ?? [];\n\n return (\n <Group\n {...groupLayout(children, stack)}\n className={className}\n spacing={Spacing[2]}\n role='group'\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n >\n {renderCards(children, (card) => ({\n name,\n multiple: true,\n checked: selected.includes(card.value),\n onChange: (checked: boolean) => {\n if (field.disabled || card.disabled) {\n return;\n }\n const next = checked\n ? selected.includes(card.value)\n ? selected\n : [...selected, card.value]\n : selected.filter((item) => item !== card.value);\n setValue(next);\n onChange?.(next);\n },\n }))}\n </Group>\n );\n};\n\nexport const SelectionCardGroup = (props: SelectionCardGroupProps) => {\n const field = useContext(FormControlContext);\n /* Each card's checkbox would otherwise take the enclosing field's shared input id. */\n return (\n <FormControlContext.Provider value={{ ...field, inputId: undefined }}>\n {props.multiple ? <MultipleGroup {...props} /> : <SingleGroup {...props} />}\n </FormControlContext.Provider>\n );\n};\n\nexport default SelectionCardGroup;\n"],"mappings":"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"}
|
|
@@ -16,7 +16,7 @@ import { n as Button } from "../../IconButton-HWx5Hlmi.mjs";
|
|
|
16
16
|
import { n as useFormField } from "../../useFormField-CbNYbDdp.mjs";
|
|
17
17
|
import Input_default from "../Input/index.mjs";
|
|
18
18
|
import { n as ErrorText } from "../../FormControl-C4CiA0H-.mjs";
|
|
19
|
-
import { m as FormField, n as TableBoxField, p as splitOutFormFieldProps } from "../../FormField-
|
|
19
|
+
import { m as FormField, n as TableBoxField, p as splitOutFormFieldProps } from "../../FormField-D0y1uRV5.mjs";
|
|
20
20
|
import PillType from "./PillType.mjs";
|
|
21
21
|
import { ErrorMessageByKind, NodeType, isASTChainNode, isASTContainerNode, isMethodChainNode } from "./parser/smart-text/types.mjs";
|
|
22
22
|
import { parse as peg$parse } from "./parser/smart-text/parser.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Spinner } from "../../Spinner-
|
|
1
|
+
import { t as Spinner } from "../../Spinner-AnIk8d9M.mjs";
|
|
2
2
|
export { Spinner, Spinner as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as StickyTH, c as TableCellTitle, d as TableTR, f as TableTH, h as Table, i as StickyTD, l as TableIconTD, m as TableHeaderCell, n as TableBody, o as TableActionTD, p as TableRow, r as TableHead, s as TableCell, t as TableLayout, u as TableTD } from "../../Table
|
|
1
|
+
import { a as StickyTH, c as TableCellTitle, d as TableTR, f as TableTH, h as Table, i as StickyTD, l as TableIconTD, m as TableHeaderCell, n as TableBody, o as TableActionTD, p as TableRow, r as TableHead, s as TableCell, t as TableLayout, u as TableTD } from "../../Table-CmuWqmVN.mjs";
|
|
2
2
|
export { StickyTD, StickyTH, Table, Table as default, TableActionTD, TableBody, TableCell, TableCellTitle, TableHead, TableHeaderCell, TableIconTD, TableLayout, TableRow, TableTD, TableTH, TableTR };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as DragDirection } from "../../useTableBoxDragAndDrop-CKPIY98e.mjs";
|
|
2
|
-
import { a as TableBox, o as TableBoxContext, r as InlineEditConfig, s as TableBoxProps } from "../../TableBoxCell-
|
|
2
|
+
import { a as TableBox, o as TableBoxContext, r as InlineEditConfig, s as TableBoxProps } from "../../TableBoxCell-Cag3ZYRs.mjs";
|
|
3
3
|
export { DragDirection, InlineEditConfig, TableBoxContext, TableBoxProps, TableBox as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TableBoxContext, t as TableBox } from "../../TableBox-
|
|
1
|
+
import { n as TableBoxContext, t as TableBox } from "../../TableBox-BRJunn09.mjs";
|
|
2
2
|
export { TableBoxContext, TableBox as default };
|
|
@@ -6,8 +6,8 @@ import { semanticScrollbar } from "../../mixins/scrollbar.mjs";
|
|
|
6
6
|
import { n as Stack, t as HStack } from "../../Stack-BkC7FCdF.mjs";
|
|
7
7
|
import { n as Button, t as IconButton } from "../../IconButton-HWx5Hlmi.mjs";
|
|
8
8
|
import { n as DropdownMenu_default } from "../../DropdownMenu-CedsmO5h.mjs";
|
|
9
|
-
import { t as Spinner } from "../../Spinner-
|
|
10
|
-
import { i as Modal_default } from "../../Modal-
|
|
9
|
+
import { t as Spinner } from "../../Spinner-AnIk8d9M.mjs";
|
|
10
|
+
import { i as Modal_default } from "../../Modal-IJdbLORi.mjs";
|
|
11
11
|
import { t as TextAreaWithStyle } from "../../TextArea-CaIEBz8d.mjs";
|
|
12
12
|
import { n as StatusIndicator } from "../../StatusIndicator-Bunn9YLV.mjs";
|
|
13
13
|
import { Color, Spacing } from "@persona/design-tokens";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as ComboboxOptionsOrGroups } from "./ComboboxBase-
|
|
1
|
+
import { o as ComboboxOptionsOrGroups } from "./ComboboxBase-BlNi9OnF.mjs";
|
|
2
2
|
import { t as FieldRegistry } from "./FieldRegistry-B5E-GN91.mjs";
|
|
3
3
|
|
|
4
4
|
//#region components/DataTable/TableControls/FiltersV2/fieldPickerOptions.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as BaseFilterConfig, l as FilterTypeDefinition, t as ActiveFilter, u as FilterTypeResolver } from "./types-
|
|
1
|
+
import { i as BaseFilterConfig, l as FilterTypeDefinition, t as ActiveFilter, u as FilterTypeResolver } from "./types-CrRWZ0Ia.mjs";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
import * as _$styled_components0 from "styled-components";
|
|
4
4
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -19,4 +19,4 @@ declare const Filters: <TFilter extends BaseFilterConfig>({
|
|
|
19
19
|
}) => _$react_jsx_runtime0.JSX.Element;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { resolveFilterTypeDefinition as a, isFilterActive as i, FiltersContainer as n, synchronizeActiveFilters as o, getActiveFilters as r, Filters as t };
|
|
22
|
-
//# sourceMappingURL=filters-
|
|
22
|
+
//# sourceMappingURL=filters-jG9Y3UKb.d.mts.map
|
package/dist/filters.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveFilterTypeDefinition, i as isFilterActive, n as FiltersContainer, o as synchronizeActiveFilters, r as getActiveFilters, t as Filters } from "./filters-
|
|
1
|
+
import { a as resolveFilterTypeDefinition, i as isFilterActive, n as FiltersContainer, o as synchronizeActiveFilters, r as getActiveFilters, t as Filters } from "./filters-jG9Y3UKb.mjs";
|
|
2
2
|
export { Filters, FiltersContainer, getActiveFilters, isFilterActive, resolveFilterTypeDefinition, synchronizeActiveFilters };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as CheckboxProps } from "./Checkbox-B2MZShdu.mjs";
|
|
2
2
|
import { i as CommonStrings } from "./strings-FWNWdSn1.mjs";
|
|
3
|
-
import { S as RenderValueStickerFormatConfig, b as DatetimeConfig, d as DataTableColumnImageFormat, h as DataTableColumnStringFormat, l as DataTableColumnFormat, p as DataTableColumnPiiFormat, y as DateConfig } from "./types-
|
|
3
|
+
import { S as RenderValueStickerFormatConfig, b as DatetimeConfig, d as DataTableColumnImageFormat, h as DataTableColumnStringFormat, l as DataTableColumnFormat, p as DataTableColumnPiiFormat, y as DateConfig } from "./types-DxJyE_U8.mjs";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
|
|
6
6
|
//#region components/DataTable/helpers.d.ts
|
|
@@ -87,4 +87,4 @@ declare const renderAsLightweightImage: (value: unknown, config?: DataTableColum
|
|
|
87
87
|
declare const renderAsPDSFormat: <TData = unknown>(value: unknown, format?: DataTableColumnFormat<TData>, row?: TData, options?: PDSFormatOptions) => string | ReactNode;
|
|
88
88
|
//#endregion
|
|
89
89
|
export { renderAsDate as a, renderAsNumber as c, renderAsSticker as d, renderAsString as f, renderAsCopyableString as i, renderAsPDSFormat as l, renderAsCheckbox as n, renderAsDatetime as o, renderAsURL as p, renderAsCheckboxHeader as r, renderAsLightweightImage as s, PDSFormatOptions as t, renderAsPii as u };
|
|
90
|
-
//# sourceMappingURL=helpers-
|
|
90
|
+
//# sourceMappingURL=helpers-DCIto6aY.d.mts.map
|
package/dist/helpers.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as renderAsDate, c as renderAsNumber, d as renderAsSticker, f as renderAsString, i as renderAsCopyableString, l as renderAsPDSFormat, n as renderAsCheckbox, o as renderAsDatetime, p as renderAsURL, r as renderAsCheckboxHeader, s as renderAsLightweightImage, t as PDSFormatOptions, u as renderAsPii } from "./helpers-
|
|
1
|
+
import { a as renderAsDate, c as renderAsNumber, d as renderAsSticker, f as renderAsString, i as renderAsCopyableString, l as renderAsPDSFormat, n as renderAsCheckbox, o as renderAsDatetime, p as renderAsURL, r as renderAsCheckboxHeader, s as renderAsLightweightImage, t as PDSFormatOptions, u as renderAsPii } from "./helpers-DCIto6aY.mjs";
|
|
2
2
|
export { PDSFormatOptions, renderAsCheckbox, renderAsCheckboxHeader, renderAsCopyableString, renderAsDate, renderAsDatetime, renderAsLightweightImage, renderAsNumber, renderAsPDSFormat, renderAsPii, renderAsSticker, renderAsString, renderAsURL };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ListBoxItemProps, r as ListBoxProps$1 } from "./ListBox-
|
|
2
|
-
import { n as LogicRowProps } from "./LogicRow-
|
|
1
|
+
import { n as ListBoxItemProps, r as ListBoxProps$1 } from "./ListBox-CXFI-0nG.mjs";
|
|
2
|
+
import { n as LogicRowProps } from "./LogicRow-8oYRkwz5.mjs";
|
|
3
3
|
import * as _$react from "react";
|
|
4
4
|
import * as _$react_aria_components0 from "react-aria-components";
|
|
5
5
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -52,4 +52,4 @@ declare const ListBox: {
|
|
|
52
52
|
};
|
|
53
53
|
//#endregion
|
|
54
54
|
export { ListBox as t };
|
|
55
|
-
//# sourceMappingURL=index-
|
|
55
|
+
//# sourceMappingURL=index-C3uFHTo0.d.mts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { n as CheckboxProps } from "./Checkbox-B2MZShdu.mjs";
|
|
2
|
-
import { n as ComboboxMultiSelectProps } from "./ComboboxMultiSelect-
|
|
3
|
-
import { n as ComboboxSingleSelectProps } from "./ComboboxSingleSelect-
|
|
2
|
+
import { n as ComboboxMultiSelectProps } from "./ComboboxMultiSelect-DbTYO-Yz.mjs";
|
|
3
|
+
import { n as ComboboxSingleSelectProps } from "./ComboboxSingleSelect-Cd6VYdwr.mjs";
|
|
4
4
|
import { n as FormFieldBaseProps } from "./FormField-mLbXDJ9B.mjs";
|
|
5
5
|
import { a as InputProps } from "./Input-Bg4bi6VZ.mjs";
|
|
6
6
|
import { n as RadioGroupProps } from "./RadioGroup-BxEmipHa.mjs";
|
|
7
7
|
import { i as SegmentedControlProps } from "./SegmentedControl-xjU-2IsJ.mjs";
|
|
8
|
-
import { i as SelectProps } from "./Select-
|
|
8
|
+
import { i as SelectProps } from "./Select-CSbamhJO.mjs";
|
|
9
9
|
import { t as TextAreaProps } from "./TextArea-DFn4XuG-.mjs";
|
|
10
10
|
import { n as ToggleProps } from "./Toggle-xtPgGaGD.mjs";
|
|
11
11
|
import * as _$react from "react";
|
|
@@ -68,4 +68,4 @@ type ComboboxMultiSelectFieldProps<T = string> = ImplementsFormField & ComboboxM
|
|
|
68
68
|
declare const ComboboxField: (props: ComboboxSingleSelectFieldProps | ComboboxMultiSelectFieldProps) => _$react_jsx_runtime0.JSX.Element;
|
|
69
69
|
//#endregion
|
|
70
70
|
export { ToggleField as _, ComboboxSingleSelectFieldProps as a, RadioGroupFieldProps as c, SelectField as d, SelectFieldProps as f, TextFieldProps as g, TextField as h, ComboboxMultiSelectFieldProps as i, SegmentedControlField as l, TextAreaFieldProps as m, CheckboxFieldProps as n, ImplementsFormField as o, TextAreaField as p, ComboboxField as r, RadioGroupField as s, CheckboxField as t, SegmentedControlFieldProps as u, ToggleFieldProps as v, splitOutFormFieldProps as y };
|
|
71
|
-
//# sourceMappingURL=inputFields-
|
|
71
|
+
//# sourceMappingURL=inputFields-mUsms2tO.d.mts.map
|
package/dist/inputFields.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as ToggleField, a as ComboboxSingleSelectFieldProps, c as RadioGroupFieldProps, d as SelectField, f as SelectFieldProps, g as TextFieldProps, h as TextField, i as ComboboxMultiSelectFieldProps, l as SegmentedControlField, m as TextAreaFieldProps, n as CheckboxFieldProps, o as ImplementsFormField, p as TextAreaField, r as ComboboxField, s as RadioGroupField, t as CheckboxField, u as SegmentedControlFieldProps, v as ToggleFieldProps, y as splitOutFormFieldProps } from "./inputFields-
|
|
1
|
+
import { _ as ToggleField, a as ComboboxSingleSelectFieldProps, c as RadioGroupFieldProps, d as SelectField, f as SelectFieldProps, g as TextFieldProps, h as TextField, i as ComboboxMultiSelectFieldProps, l as SegmentedControlField, m as TextAreaFieldProps, n as CheckboxFieldProps, o as ImplementsFormField, p as TextAreaField, r as ComboboxField, s as RadioGroupField, t as CheckboxField, u as SegmentedControlFieldProps, v as ToggleFieldProps, y as splitOutFormFieldProps } from "./inputFields-mUsms2tO.mjs";
|
|
2
2
|
export { CheckboxField, CheckboxFieldProps, ComboboxField, ComboboxMultiSelectFieldProps, ComboboxSingleSelectFieldProps, ImplementsFormField, RadioGroupField, RadioGroupFieldProps, SegmentedControlField, SegmentedControlFieldProps, SelectField, SelectFieldProps, TextAreaField, TextAreaFieldProps, TextField, TextFieldProps, ToggleField, ToggleFieldProps, splitOutFormFieldProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as Card_default } from "../../Card-BXNxWX5C.mjs";
|
|
2
|
-
import { t as DataTable } from "../../DataTable-
|
|
2
|
+
import { t as DataTable } from "../../DataTable-F9R-aQCg.mjs";
|
|
3
3
|
import { t as PageHeader } from "../../PageHeader-DJF7nxgN.mjs";
|
|
4
4
|
import { a as Section, i as Container } from "../../PageLayout-fXJW7daI.mjs";
|
|
5
5
|
import { useMemo } from "react";
|
|
@@ -2,7 +2,7 @@ import { a as styled } from "../../styledComponentsInterop-NxwFjeA4.mjs";
|
|
|
2
2
|
import { n as Stack, t as HStack } from "../../Stack-BkC7FCdF.mjs";
|
|
3
3
|
import { t as LoadingShimmer } from "../../LoadingShimmer-Bqjdut7i.mjs";
|
|
4
4
|
import { t as Card_default } from "../../CardV2-Dp4eHSE-.mjs";
|
|
5
|
-
import { h as Table, m as TableHeaderCell, n as TableBody, p as TableRow, r as TableHead, s as TableCell } from "../../Table
|
|
5
|
+
import { h as Table, m as TableHeaderCell, n as TableBody, p as TableRow, r as TableHead, s as TableCell } from "../../Table-CmuWqmVN.mjs";
|
|
6
6
|
import { n as PageHeaderContainer } from "../../PageHeader-DJF7nxgN.mjs";
|
|
7
7
|
import { Color, Spacing } from "@persona/design-tokens";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -2,7 +2,7 @@ import { a as styled } from "../../styledComponentsInterop-NxwFjeA4.mjs";
|
|
|
2
2
|
import { semanticColor } from "../../lib/semanticColor.mjs";
|
|
3
3
|
import { t as HStack } from "../../Stack-BkC7FCdF.mjs";
|
|
4
4
|
import { n as Button } from "../../IconButton-HWx5Hlmi.mjs";
|
|
5
|
-
import { i as Modal_default } from "../../Modal-
|
|
5
|
+
import { i as Modal_default } from "../../Modal-IJdbLORi.mjs";
|
|
6
6
|
import { t as ProgressIndicator } from "../../ProgressIndicator-CM37EU1B.mjs";
|
|
7
7
|
import { Color, Spacing } from "@persona/design-tokens";
|
|
8
8
|
import { useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ComboboxProps } from "./Combobox-
|
|
1
|
+
import { n as ComboboxProps } from "./Combobox-D0dMN5eY.mjs";
|
|
2
2
|
import { n as DateRange } from "./DateRangePicker-CLuBLF1q.mjs";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { DateValue } from "@internationalized/date";
|
|
@@ -67,7 +67,7 @@ interface DateRangeFilterConfig extends BaseFilterConfig {
|
|
|
67
67
|
}
|
|
68
68
|
interface InputFilterConfig extends BaseFilterConfig {
|
|
69
69
|
type: 'input';
|
|
70
|
-
value
|
|
70
|
+
value?: string;
|
|
71
71
|
onChange: (value: string) => void;
|
|
72
72
|
onDelete?: () => void;
|
|
73
73
|
}
|
|
@@ -92,4 +92,4 @@ interface FilterTypeDefinition<TFilter extends BaseFilterConfig = FilterConfig>
|
|
|
92
92
|
type FilterTypeResolver<TFilter extends BaseFilterConfig = FilterConfig> = (config: TFilter) => FilterTypeDefinition<TFilter> | undefined;
|
|
93
93
|
//#endregion
|
|
94
94
|
export { ComboboxFilterConfig as a, FilterRenderOptions as c, InputFilterConfig as d, MultiSelectFilterConfig as f, BaseFilterConfig as i, FilterTypeDefinition as l, AttributeColumn as n, DateRangeFilterConfig as o, SelectFilterConfig as p, BaseActiveFilter as r, FilterConfig as s, ActiveFilter as t, FilterTypeResolver as u };
|
|
95
|
-
//# sourceMappingURL=types-
|
|
95
|
+
//# sourceMappingURL=types-CrRWZ0Ia.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as MenuItemProps } from "./Menu-
|
|
1
|
+
import { l as MenuItemProps } from "./Menu-DHnQZ5yN.mjs";
|
|
2
2
|
import { o as StickerProps } from "./Sticker-CsUSNIH-.mjs";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { Column, DeepKeys, FilterFnOption, Header, RowData, SortingState, Table } from "@tanstack/react-table";
|
|
@@ -177,4 +177,4 @@ type BulkAction = {
|
|
|
177
177
|
};
|
|
178
178
|
//#endregion
|
|
179
179
|
export { RowAction as C, RowDataWithTourTarget as D, RowDataWithSubrowsToAlwaysShowIds as E, SortProps as O, RenderValueStickerFormatConfig as S, RowDataWithSubrows as T, DataTableColumns as _, DataTableColumnBaseFormat as a, DatetimeConfig as b, DataTableColumnDatetimeFormat as c, DataTableColumnImageFormat as d, DataTableColumnNumberFormat as f, DataTableColumnURLFormat as g, DataTableColumnStringFormat as h, ColumnConfig as i, StickerMapping as k, DataTableColumnFormat as l, DataTableColumnStickerFormat as m, ClientFilterConfig as n, DataTableColumnCheckboxFormat as o, DataTableColumnPiiFormat as p, ClientFilterType as r, DataTableColumnDateFormat as s, BulkAction as t, DataTableColumnIDFormat as u, DataTableVariables as v, RowDataWithDetails as w, HeadlessFilterConfig as x, DateConfig as y };
|
|
180
|
-
//# sourceMappingURL=types-
|
|
180
|
+
//# sourceMappingURL=types-DxJyE_U8.d.mts.map
|
package/dist/types5.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ComboboxFilterConfig, c as FilterRenderOptions, d as InputFilterConfig, f as MultiSelectFilterConfig, i as BaseFilterConfig, l as FilterTypeDefinition, n as AttributeColumn, o as DateRangeFilterConfig, p as SelectFilterConfig, r as BaseActiveFilter, s as FilterConfig, t as ActiveFilter, u as FilterTypeResolver } from "./types-
|
|
1
|
+
import { a as ComboboxFilterConfig, c as FilterRenderOptions, d as InputFilterConfig, f as MultiSelectFilterConfig, i as BaseFilterConfig, l as FilterTypeDefinition, n as AttributeColumn, o as DateRangeFilterConfig, p as SelectFilterConfig, r as BaseActiveFilter, s as FilterConfig, t as ActiveFilter, u as FilterTypeResolver } from "./types-CrRWZ0Ia.mjs";
|
|
2
2
|
export { ActiveFilter, AttributeColumn, BaseActiveFilter, BaseFilterConfig, ComboboxFilterConfig, DateRangeFilterConfig, FilterConfig, FilterRenderOptions, FilterTypeDefinition, FilterTypeResolver, InputFilterConfig, MultiSelectFilterConfig, SelectFilterConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as TableViewConfigurationProps } from "./TableViewConfigurationDropdown-
|
|
2
|
-
import { i as ColumnConfig } from "./types-
|
|
1
|
+
import { i as TableViewConfigurationProps } from "./TableViewConfigurationDropdown-BvOlDkJy.mjs";
|
|
2
|
+
import { i as ColumnConfig } from "./types-DxJyE_U8.mjs";
|
|
3
3
|
import { RowData } from "@tanstack/react-table";
|
|
4
4
|
|
|
5
5
|
//#region patterns/IndexTableLayout/useColumnConfiguration.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as RowAction, O as SortProps, _ as DataTableColumns, l as DataTableColumnFormat } from "./types-
|
|
1
|
+
import { C as RowAction, O as SortProps, _ as DataTableColumns, l as DataTableColumnFormat } from "./types-DxJyE_U8.mjs";
|
|
2
2
|
import { ColumnDef, Row, RowData, Table } from "@tanstack/react-table";
|
|
3
3
|
|
|
4
4
|
//#region components/DataTable/useTableColumns.d.ts
|
|
@@ -69,4 +69,4 @@ declare function useTableColumns<TData extends RowData, TFormat extends {
|
|
|
69
69
|
}[]];
|
|
70
70
|
//#endregion
|
|
71
71
|
export { UseTableColumnsParams as n, useTableColumns as r, RenderFormatFn as t };
|
|
72
|
-
//# sourceMappingURL=useTableColumns-
|
|
72
|
+
//# sourceMappingURL=useTableColumns-DSXRInPb.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as UseTableColumnsParams, r as useTableColumns, t as RenderFormatFn } from "./useTableColumns-
|
|
1
|
+
import { n as UseTableColumnsParams, r as useTableColumns, t as RenderFormatFn } from "./useTableColumns-DSXRInPb.mjs";
|
|
2
2
|
export { RenderFormatFn, UseTableColumnsParams, useTableColumns };
|
package/dist/useTruncation.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@persona/design-system",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "React components for Persona UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tanstack-intent"
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"./components/RightPanel": "./dist/components/RightPanel/index.mjs",
|
|
65
65
|
"./components/SegmentedControl": "./dist/components/SegmentedControl/index.mjs",
|
|
66
66
|
"./components/Select": "./dist/components/Select/index.mjs",
|
|
67
|
+
"./components/SelectionCard": "./dist/components/SelectionCard/index.mjs",
|
|
67
68
|
"./components/Slider": "./dist/components/Slider/index.mjs",
|
|
68
69
|
"./components/SmartTextInput": "./dist/components/SmartTextInput/index.mjs",
|
|
69
70
|
"./components/SmartTextInput/parser/method-chain/parser": "./dist/components/SmartTextInput/parser/method-chain/parser.mjs",
|
|
@@ -322,6 +323,7 @@
|
|
|
322
323
|
"./components/RightPanel": "./dist/components/RightPanel/index.mjs",
|
|
323
324
|
"./components/SegmentedControl": "./dist/components/SegmentedControl/index.mjs",
|
|
324
325
|
"./components/Select": "./dist/components/Select/index.mjs",
|
|
326
|
+
"./components/SelectionCard": "./dist/components/SelectionCard/index.mjs",
|
|
325
327
|
"./components/Slider": "./dist/components/Slider/index.mjs",
|
|
326
328
|
"./components/SmartTextInput": "./dist/components/SmartTextInput/index.mjs",
|
|
327
329
|
"./components/SmartTextInput/parser/method-chain/parser": "./dist/components/SmartTextInput/parser/method-chain/parser.mjs",
|
|
@@ -54,6 +54,7 @@ exists. If there is no `.mdx`, use the published type declarations
|
|
|
54
54
|
| `RightPanel` | Complementary side panel for contextual updates while the page stays interactive (no overlay). Use `Modal` when the task needs full attention. See [Panels](../../patterns/Panels/Panels.mdx) | `@persona/design-system/components/RightPanel` |
|
|
55
55
|
| `SegmentedControl` | Picking one option from a compact set of mutually exclusive choices | `@persona/design-system/components/SegmentedControl` |
|
|
56
56
|
| `Select` | Dropdown — picking one value from a short, known list with no search. Use `Combobox` when the list needs search | `@persona/design-system/components/Select` |
|
|
57
|
+
| `SelectionCard` | A visible choice where each option is a card. Single when one may be chosen, `multiple` when several may | `@persona/design-system/components/SelectionCard` |
|
|
57
58
|
| `Slider` | Picking a numeric value or range along a scale | `@persona/design-system/components/Slider` |
|
|
58
59
|
| `SmartTextInput` | Authoring a value that mixes plain text with structured data references — `{{account.id}}` interpolation or a single `account.id` method chain, with autocomplete, syntax highlighting and schema validation. Use `Input` for plain text. Method chains REQUIRE `renderFunctionForm` (otherwise the function dialog is empty) — see its `.mdx` | `@persona/design-system/components/SmartTextInput` |
|
|
59
60
|
| `Spacer` | Prefer `Stack` — leftover gap helper | `@persona/design-system/components/Spacer` |
|
|
@@ -26,7 +26,11 @@ Which pattern to use, and for what. Patterns with a dedicated doc link to
|
|
|
26
26
|
## Page layouts
|
|
27
27
|
|
|
28
28
|
Index pages backed by `DataTable` use `IndexTableLayout`, which owns its `Container`, `PageHeader`,
|
|
29
|
-
`Section`, and `Card` shell.
|
|
29
|
+
`Section`, and `Card` shell. Import it from `@persona/design-system/patterns/IndexTableLayout`;
|
|
30
|
+
never copy it, persona-web's `DashboardDataTable` wrapper (PDS does not ship one), or
|
|
31
|
+
`TableControls`/filter panels into an app. Pass app-specific filters through the `controls` prop
|
|
32
|
+
(`controls={{ filters, filterResolver }}` or `controls={{ filterPanel }}`), and if the pattern lacks
|
|
33
|
+
a slot you need, add it here instead of forking the layout. Other pages render `PageHeader`, then `SingleColumnLayout` or
|
|
30
34
|
`SplitColumnLayout`. Do not wrap those templates in `Container` or `Section`.
|
|
31
35
|
|
|
32
36
|
```tsx
|