@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.
Files changed (45) hide show
  1. package/docs/components/data-grid/content.md +419 -14
  2. package/docs/foundations/expressions/icons/content.md +1 -1
  3. package/docs/llms.txt +2 -0
  4. package/docs/resources/release-notes/0.3.10/content.md +15 -0
  5. package/docs/resources/release-notes/0.3.11/content.md +7 -0
  6. package/docs/resources/release-notes/content.md +2 -0
  7. package/lib/commonjs/components/DatePicker/index.js +2 -0
  8. package/lib/commonjs/components/DatePicker/index.js.map +1 -1
  9. package/lib/commonjs/components/DateRangePicker/index.js +2 -0
  10. package/lib/commonjs/components/DateRangePicker/index.js.map +1 -1
  11. package/lib/commonjs/components/Icon/index.js +8 -8
  12. package/lib/commonjs/components/Icon/index.js.map +1 -1
  13. package/lib/commonjs/components/SystemAlert/styles.js +4 -1
  14. package/lib/commonjs/components/SystemAlert/styles.js.map +1 -1
  15. package/lib/commonjs/components/picker/styles.js +8 -1
  16. package/lib/commonjs/components/picker/styles.js.map +1 -1
  17. package/lib/commonjs/components/picker/surfaces.js +4 -2
  18. package/lib/commonjs/components/picker/surfaces.js.map +1 -1
  19. package/lib/module/components/DatePicker/index.js +2 -0
  20. package/lib/module/components/DatePicker/index.js.map +1 -1
  21. package/lib/module/components/DateRangePicker/index.js +2 -0
  22. package/lib/module/components/DateRangePicker/index.js.map +1 -1
  23. package/lib/module/components/Icon/index.js +8 -8
  24. package/lib/module/components/Icon/index.js.map +1 -1
  25. package/lib/module/components/SystemAlert/styles.js +4 -1
  26. package/lib/module/components/SystemAlert/styles.js.map +1 -1
  27. package/lib/module/components/picker/styles.js +7 -0
  28. package/lib/module/components/picker/styles.js.map +1 -1
  29. package/lib/module/components/picker/surfaces.js +4 -2
  30. package/lib/module/components/picker/surfaces.js.map +1 -1
  31. package/lib/typescript/components/ColorSwatch/styles.d.ts +1 -1
  32. package/lib/typescript/components/DatePicker/index.d.ts.map +1 -1
  33. package/lib/typescript/components/DateRangePicker/index.d.ts.map +1 -1
  34. package/lib/typescript/components/SystemAlert/styles.d.ts.map +1 -1
  35. package/lib/typescript/components/picker/styles.d.ts +6 -0
  36. package/lib/typescript/components/picker/styles.d.ts.map +1 -1
  37. package/lib/typescript/components/picker/surfaces.d.ts +2 -1
  38. package/lib/typescript/components/picker/surfaces.d.ts.map +1 -1
  39. package/package.json +6 -6
  40. package/src/components/DatePicker/index.tsx +2 -0
  41. package/src/components/DateRangePicker/index.tsx +2 -0
  42. package/src/components/Icon/index.tsx +8 -8
  43. package/src/components/SystemAlert/styles.ts +13 -7
  44. package/src/components/picker/styles.ts +7 -0
  45. 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
- // Double-wrap: the inner `withUniwind` (auto mapping) resolves general
34
- // `className` utilities (margin, padding, positioning, etc.) into the `style`
35
- // prop so they reach the SVG on native. The outer `withUniwind` (custom mapping)
36
- // extracts `size` and `color` from the same `className`. Without the inner
37
- // wrapper, a custom mapping alone skips the `className` → `style` merge, so
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
- export const systemAlertDescriptionVariants = cva(['flex-1 min-w-0 py-3 body-md font-medium'], {
125
- variants: {
126
- color: ON_STRONG_CONTENT,
127
- },
128
- defaultVariants: {
129
- color: 'info',
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];