@cdx-ui/components 0.3.10 → 0.3.12
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 +419 -14
- package/docs/foundations/expressions/icons/content.md +1 -1
- package/docs/llms.txt +2 -0
- package/docs/resources/release-notes/0.3.10/content.md +15 -0
- package/docs/resources/release-notes/0.3.11/content.md +7 -0
- package/docs/resources/release-notes/content.md +2 -0
- 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/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/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/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/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/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/package.json +6 -6
- 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/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 interface DatePickerProps extends DatePickerRootPrimitiveProps, Omit<ViewProps, 'children'> {
|
|
25
26
|
className?: string;
|
|
@@ -171,6 +172,7 @@ function DatePickerPopover({ children, className }: { children: ReactNode; class
|
|
|
171
172
|
registerSurface={ctx.registerSurface}
|
|
172
173
|
anchorRef={ctx.anchorRef}
|
|
173
174
|
triggerRef={ctx.triggerRef}
|
|
175
|
+
minWidth={PICKER_CALENDAR_POPOVER_MIN_WIDTH}
|
|
174
176
|
className={className}
|
|
175
177
|
>
|
|
176
178
|
<DatePickerContext.Provider value={ctx}>{children}</DatePickerContext.Provider>
|
|
@@ -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
|
/**
|
|
@@ -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];
|