@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.
Files changed (72) hide show
  1. package/docs/components/data-grid/content.md +966 -15
  2. package/docs/components/list-item/content.md +1 -1
  3. package/docs/components/table/content.md +84 -0
  4. package/docs/foundations/expressions/icons/content.md +1 -1
  5. package/docs/llms.txt +2 -0
  6. package/docs/resources/release-notes/0.3.11/content.md +7 -0
  7. package/docs/resources/release-notes/0.3.12/content.md +15 -0
  8. package/docs/resources/release-notes/content.md +2 -0
  9. package/lib/commonjs/components/CurrencyInput/styles.js +1 -1
  10. package/lib/commonjs/components/DatePicker/index.js +2 -0
  11. package/lib/commonjs/components/DatePicker/index.js.map +1 -1
  12. package/lib/commonjs/components/DateRangePicker/index.js +2 -0
  13. package/lib/commonjs/components/DateRangePicker/index.js.map +1 -1
  14. package/lib/commonjs/components/Icon/index.js +8 -8
  15. package/lib/commonjs/components/Icon/index.js.map +1 -1
  16. package/lib/commonjs/components/ListItem/styles.js +1 -1
  17. package/lib/commonjs/components/ListItem/styles.js.map +1 -1
  18. package/lib/commonjs/components/SystemAlert/styles.js +4 -1
  19. package/lib/commonjs/components/SystemAlert/styles.js.map +1 -1
  20. package/lib/commonjs/components/picker/styles.js +8 -1
  21. package/lib/commonjs/components/picker/styles.js.map +1 -1
  22. package/lib/commonjs/components/picker/surfaces.js +4 -2
  23. package/lib/commonjs/components/picker/surfaces.js.map +1 -1
  24. package/lib/commonjs/figma/CurrencyInput.figma.js +4 -4
  25. package/lib/commonjs/figma/CurrencyInput.figma.js.map +1 -1
  26. package/lib/commonjs/figma/ProgressBar.figma.js +8 -5
  27. package/lib/commonjs/figma/ProgressBar.figma.js.map +1 -1
  28. package/lib/commonjs/figma/ProgressCircle.figma.js +8 -2
  29. package/lib/commonjs/figma/ProgressCircle.figma.js.map +1 -1
  30. package/lib/module/components/CurrencyInput/styles.js +1 -1
  31. package/lib/module/components/DatePicker/index.js +2 -0
  32. package/lib/module/components/DatePicker/index.js.map +1 -1
  33. package/lib/module/components/DateRangePicker/index.js +2 -0
  34. package/lib/module/components/DateRangePicker/index.js.map +1 -1
  35. package/lib/module/components/Icon/index.js +8 -8
  36. package/lib/module/components/Icon/index.js.map +1 -1
  37. package/lib/module/components/ListItem/styles.js +1 -1
  38. package/lib/module/components/ListItem/styles.js.map +1 -1
  39. package/lib/module/components/SystemAlert/styles.js +4 -1
  40. package/lib/module/components/SystemAlert/styles.js.map +1 -1
  41. package/lib/module/components/picker/styles.js +7 -0
  42. package/lib/module/components/picker/styles.js.map +1 -1
  43. package/lib/module/components/picker/surfaces.js +4 -2
  44. package/lib/module/components/picker/surfaces.js.map +1 -1
  45. package/lib/module/figma/CurrencyInput.figma.js +4 -4
  46. package/lib/module/figma/CurrencyInput.figma.js.map +1 -1
  47. package/lib/module/figma/ProgressBar.figma.js +8 -5
  48. package/lib/module/figma/ProgressBar.figma.js.map +1 -1
  49. package/lib/module/figma/ProgressCircle.figma.js +8 -2
  50. package/lib/module/figma/ProgressCircle.figma.js.map +1 -1
  51. package/lib/typescript/components/ColorSwatch/styles.d.ts +1 -1
  52. package/lib/typescript/components/DatePicker/index.d.ts.map +1 -1
  53. package/lib/typescript/components/DateRangePicker/index.d.ts.map +1 -1
  54. package/lib/typescript/components/ListItem/index.d.ts +2 -2
  55. package/lib/typescript/components/SystemAlert/styles.d.ts.map +1 -1
  56. package/lib/typescript/components/picker/styles.d.ts +6 -0
  57. package/lib/typescript/components/picker/styles.d.ts.map +1 -1
  58. package/lib/typescript/components/picker/surfaces.d.ts +2 -1
  59. package/lib/typescript/components/picker/surfaces.d.ts.map +1 -1
  60. package/lib/typescript/figma/CurrencyInput.figma.d.ts.map +1 -1
  61. package/lib/typescript/figma/ProgressBar.figma.d.ts.map +1 -1
  62. package/lib/typescript/figma/ProgressCircle.figma.d.ts.map +1 -1
  63. package/package.json +6 -6
  64. package/src/components/CurrencyInput/styles.ts +1 -1
  65. package/src/components/DatePicker/index.tsx +2 -0
  66. package/src/components/DateRangePicker/index.tsx +2 -0
  67. package/src/components/Icon/index.tsx +8 -8
  68. package/src/components/ListItem/index.tsx +2 -2
  69. package/src/components/ListItem/styles.ts +1 -1
  70. package/src/components/SystemAlert/styles.ts +13 -7
  71. package/src/components/picker/styles.ts +7 -0
  72. 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
- // 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
  /**
@@ -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 fill
525
- * (matching `subtle` on Avatar, Chip, and IconButton) and drops the bottom border. `gradient`
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-subtle border-b-0',
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
- 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];