@cdx-ui/components 0.3.11 → 0.3.13
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/docs/components/data-grid/content.md +966 -15
- package/docs/components/list-item/content.md +1 -1
- package/docs/components/table/content.md +84 -0
- package/docs/foundations/expressions/icons/content.md +1 -1
- package/docs/llms.txt +2 -0
- package/docs/resources/release-notes/0.3.11/content.md +7 -0
- package/docs/resources/release-notes/0.3.12/content.md +15 -0
- package/docs/resources/release-notes/content.md +2 -0
- package/lib/commonjs/components/CurrencyInput/styles.js +1 -1
- package/lib/commonjs/components/DatePicker/index.js +2 -0
- package/lib/commonjs/components/DatePicker/index.js.map +1 -1
- package/lib/commonjs/components/DateRangePicker/index.js +2 -0
- package/lib/commonjs/components/DateRangePicker/index.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js +8 -8
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/ListItem/styles.js +1 -1
- package/lib/commonjs/components/ListItem/styles.js.map +1 -1
- package/lib/commonjs/components/SystemAlert/styles.js +4 -1
- package/lib/commonjs/components/SystemAlert/styles.js.map +1 -1
- package/lib/commonjs/components/picker/styles.js +8 -1
- package/lib/commonjs/components/picker/styles.js.map +1 -1
- package/lib/commonjs/components/picker/surfaces.js +4 -2
- package/lib/commonjs/components/picker/surfaces.js.map +1 -1
- package/lib/commonjs/figma/CurrencyInput.figma.js +4 -4
- package/lib/commonjs/figma/CurrencyInput.figma.js.map +1 -1
- package/lib/commonjs/figma/ProgressBar.figma.js +8 -5
- package/lib/commonjs/figma/ProgressBar.figma.js.map +1 -1
- package/lib/commonjs/figma/ProgressCircle.figma.js +8 -2
- package/lib/commonjs/figma/ProgressCircle.figma.js.map +1 -1
- package/lib/module/components/CurrencyInput/styles.js +1 -1
- package/lib/module/components/DatePicker/index.js +2 -0
- package/lib/module/components/DatePicker/index.js.map +1 -1
- package/lib/module/components/DateRangePicker/index.js +2 -0
- package/lib/module/components/DateRangePicker/index.js.map +1 -1
- package/lib/module/components/Icon/index.js +8 -8
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/ListItem/styles.js +1 -1
- package/lib/module/components/ListItem/styles.js.map +1 -1
- package/lib/module/components/SystemAlert/styles.js +4 -1
- package/lib/module/components/SystemAlert/styles.js.map +1 -1
- package/lib/module/components/picker/styles.js +7 -0
- package/lib/module/components/picker/styles.js.map +1 -1
- package/lib/module/components/picker/surfaces.js +4 -2
- package/lib/module/components/picker/surfaces.js.map +1 -1
- package/lib/module/figma/CurrencyInput.figma.js +4 -4
- package/lib/module/figma/CurrencyInput.figma.js.map +1 -1
- package/lib/module/figma/ProgressBar.figma.js +8 -5
- package/lib/module/figma/ProgressBar.figma.js.map +1 -1
- package/lib/module/figma/ProgressCircle.figma.js +8 -2
- package/lib/module/figma/ProgressCircle.figma.js.map +1 -1
- package/lib/typescript/components/ColorSwatch/styles.d.ts +1 -1
- package/lib/typescript/components/DatePicker/index.d.ts.map +1 -1
- package/lib/typescript/components/DateRangePicker/index.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/index.d.ts +2 -2
- package/lib/typescript/components/SystemAlert/styles.d.ts.map +1 -1
- package/lib/typescript/components/picker/styles.d.ts +6 -0
- package/lib/typescript/components/picker/styles.d.ts.map +1 -1
- package/lib/typescript/components/picker/surfaces.d.ts +2 -1
- package/lib/typescript/components/picker/surfaces.d.ts.map +1 -1
- package/lib/typescript/figma/CurrencyInput.figma.d.ts.map +1 -1
- package/lib/typescript/figma/ProgressBar.figma.d.ts.map +1 -1
- package/lib/typescript/figma/ProgressCircle.figma.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/CurrencyInput/styles.ts +1 -1
- package/src/components/DatePicker/index.tsx +2 -0
- package/src/components/DateRangePicker/index.tsx +2 -0
- package/src/components/Icon/index.tsx +8 -8
- package/src/components/ListItem/index.tsx +2 -2
- package/src/components/ListItem/styles.ts +1 -1
- package/src/components/SystemAlert/styles.ts +13 -7
- package/src/components/picker/styles.ts +7 -0
- package/src/components/picker/surfaces.tsx +3 -0
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
PickerDialogSurface,
|
|
21
21
|
PickerPopoverSurface,
|
|
22
22
|
} from '../picker/surfaces';
|
|
23
|
+
import { PICKER_CALENDAR_POPOVER_MIN_WIDTH } from '../picker/styles';
|
|
23
24
|
|
|
24
25
|
export type { DateRangeValue } from '@cdx-ui/primitives';
|
|
25
26
|
|
|
@@ -202,6 +203,7 @@ function DateRangePickerPopover({
|
|
|
202
203
|
registerSurface={ctx.registerSurface}
|
|
203
204
|
anchorRef={ctx.anchorRef}
|
|
204
205
|
triggerRef={ctx.triggerRef}
|
|
206
|
+
minWidth={PICKER_CALENDAR_POPOVER_MIN_WIDTH}
|
|
205
207
|
className={className}
|
|
206
208
|
>
|
|
207
209
|
<DateRangePickerContext.Provider value={ctx}>{children}</DateRangePickerContext.Provider>
|
|
@@ -30,14 +30,11 @@ function IconImpl({ as: IconComponent, ...props }: IconImplProps) {
|
|
|
30
30
|
return <IconComponent {...props} />;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
// layout classes like `mt-3` are dropped on native (they still apply on web,
|
|
39
|
-
// where RNW keeps `className` as a real CSS class).
|
|
40
|
-
const StyledIcon = withUniwind(withUniwind(IconImpl), {
|
|
33
|
+
// `size` and `color` are extracted from `className`; the `style` mapping carries
|
|
34
|
+
// the remaining utilities (margin, positioning, etc.) to the SVG. A manual
|
|
35
|
+
// mapping consumes `className` on web, so placement must be mapped here rather
|
|
36
|
+
// than left to a nested auto `withUniwind`.
|
|
37
|
+
const StyledIcon = withUniwind(IconImpl, {
|
|
41
38
|
size: {
|
|
42
39
|
fromClassName: 'className',
|
|
43
40
|
styleProperty: 'width',
|
|
@@ -46,6 +43,9 @@ const StyledIcon = withUniwind(withUniwind(IconImpl), {
|
|
|
46
43
|
fromClassName: 'className',
|
|
47
44
|
styleProperty: 'color',
|
|
48
45
|
},
|
|
46
|
+
style: {
|
|
47
|
+
fromClassName: 'className',
|
|
48
|
+
},
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
/**
|
|
@@ -521,8 +521,8 @@ export interface ListItemSectionHeaderProps extends ViewProps {
|
|
|
521
521
|
/** Optional right-aligned adornment (e.g. section Chip). */
|
|
522
522
|
trailing?: ReactNode;
|
|
523
523
|
/**
|
|
524
|
-
* Background treatment. `ghost` has no fill and a bottom border; `subtle` adds a neutral
|
|
525
|
-
* (
|
|
524
|
+
* Background treatment. `ghost` has no fill and a bottom border; `subtle` adds a light neutral
|
|
525
|
+
* fill (`surface-neutral-tint`) and drops the bottom border. `gradient`
|
|
526
526
|
* fades from the primary surface into a brand tint, left to right, and keeps the bottom border.
|
|
527
527
|
* Label typography is the same for all three.
|
|
528
528
|
* @default 'ghost'
|
|
@@ -153,7 +153,7 @@ export const listItemSectionHeaderVariants = cva(
|
|
|
153
153
|
variant: {
|
|
154
154
|
ghost: [],
|
|
155
155
|
// The fill separates the header from its rows, so the bottom border is dropped.
|
|
156
|
-
subtle: 'bg-surface-neutral-
|
|
156
|
+
subtle: 'bg-surface-neutral-tint border-b-0',
|
|
157
157
|
gradient: 'bg-gradient-to-r from-surface-primary to-surface-brand-tint',
|
|
158
158
|
},
|
|
159
159
|
showDivider: {
|
|
@@ -121,14 +121,20 @@ export const systemAlertIconVariants = cva(['size-5 shrink-0 mt-3 me-3'], {
|
|
|
121
121
|
|
|
122
122
|
// ── Description ──────────────────────────────────────────────────────────────
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
// Web: react-native-web clamps `numberOfLines` with `overflow: clip` on this element, which
|
|
125
|
+
// clips at the padding edge, so the next line would show through bottom padding. Margin
|
|
126
|
+
// keeps the same box outside the clip.
|
|
127
|
+
export const systemAlertDescriptionVariants = cva(
|
|
128
|
+
['flex-1 min-w-0 py-3 web:py-0 web:my-3 body-md font-medium'],
|
|
129
|
+
{
|
|
130
|
+
variants: {
|
|
131
|
+
color: ON_STRONG_CONTENT,
|
|
132
|
+
},
|
|
133
|
+
defaultVariants: {
|
|
134
|
+
color: 'info',
|
|
135
|
+
},
|
|
130
136
|
},
|
|
131
|
-
|
|
137
|
+
);
|
|
132
138
|
|
|
133
139
|
// ── Actions ──────────────────────────────────────────────────────────────────
|
|
134
140
|
|
|
@@ -8,6 +8,13 @@ import { cva } from '@cdx-ui/utils';
|
|
|
8
8
|
*/
|
|
9
9
|
export const PICKER_POPOVER_Z_INDEX = MODAL_OVERLAY_Z_INDEX;
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Narrowest calendar popover that fits seven day columns, weekday labels, and the month
|
|
13
|
+
* header. The calendar grid has no intrinsic width, so an anchor-width popover on a narrow
|
|
14
|
+
* field would otherwise squeeze it.
|
|
15
|
+
*/
|
|
16
|
+
export const PICKER_CALENDAR_POPOVER_MIN_WIDTH = 320;
|
|
17
|
+
|
|
11
18
|
export const pickerPopoverContentVariants = cva([
|
|
12
19
|
'bg-surface-primary',
|
|
13
20
|
'border border-stroke-secondary',
|
|
@@ -142,6 +142,7 @@ interface PickerPopoverSurfaceProps {
|
|
|
142
142
|
contentClassName?: string;
|
|
143
143
|
dataSlot?: string;
|
|
144
144
|
width?: OverlayWidthPolicy;
|
|
145
|
+
minWidth?: number;
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
export function PickerPopoverSurface({
|
|
@@ -155,6 +156,7 @@ export function PickerPopoverSurface({
|
|
|
155
156
|
contentClassName,
|
|
156
157
|
dataSlot,
|
|
157
158
|
width = 'anchor',
|
|
159
|
+
minWidth,
|
|
158
160
|
}: PickerPopoverSurfaceProps) {
|
|
159
161
|
const contentRef = useRef<View>(null);
|
|
160
162
|
const [dismissEnabled, setDismissEnabled] = useState(false);
|
|
@@ -183,6 +185,7 @@ export function PickerPopoverSurface({
|
|
|
183
185
|
offset: 4,
|
|
184
186
|
collisionBehavior: 'flip-shift',
|
|
185
187
|
width,
|
|
188
|
+
minWidth,
|
|
186
189
|
});
|
|
187
190
|
|
|
188
191
|
const excludeRefs = triggerRef ? [anchorRef, triggerRef] : [anchorRef];
|