@common-origin/design-system 2.23.0 → 3.1.0

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 (186) hide show
  1. package/README.md +2 -2
  2. package/dist/client.js +2219 -1026
  3. package/dist/client.js.map +1 -1
  4. package/dist/components/atoms/Badge/Badge.d.mts +5 -12
  5. package/dist/components/atoms/Badge/Badge.d.ts +5 -12
  6. package/dist/components/atoms/Badge/Badge.mjs +0 -7
  7. package/dist/components/atoms/Badge/index.d.mts +1 -1
  8. package/dist/components/atoms/Badge/index.d.ts +1 -1
  9. package/dist/components/atoms/Box/Box.d.mts +22 -34
  10. package/dist/components/atoms/Box/Box.d.ts +22 -34
  11. package/dist/components/atoms/Box/Box.mjs +8 -11
  12. package/dist/components/atoms/Button/Button.d.mts +1 -4
  13. package/dist/components/atoms/Button/Button.d.ts +1 -4
  14. package/dist/components/atoms/Button/Button.mjs +3 -10
  15. package/dist/components/atoms/CategoryLabel/CategoryLabel.d.mts +4 -12
  16. package/dist/components/atoms/CategoryLabel/CategoryLabel.d.ts +4 -12
  17. package/dist/components/atoms/CategoryLabel/CategoryLabel.mjs +5 -16
  18. package/dist/components/atoms/Chip/Chip.d.mts +8 -20
  19. package/dist/components/atoms/Chip/Chip.d.ts +8 -20
  20. package/dist/components/atoms/Chip/Chip.mjs +20 -46
  21. package/dist/components/atoms/Chip/Chip.mjs.map +1 -1
  22. package/dist/components/atoms/Chip/FilterChip.d.mts +22 -10
  23. package/dist/components/atoms/Chip/FilterChip.d.ts +22 -10
  24. package/dist/components/atoms/Chip/FilterChip.mjs +66 -6
  25. package/dist/components/atoms/Chip/FilterChip.mjs.map +1 -1
  26. package/dist/components/atoms/Chip/InputChip.mjs +4 -6
  27. package/dist/components/atoms/Chip/InputChip.mjs.map +1 -1
  28. package/dist/components/atoms/Chip/index.d.mts +0 -1
  29. package/dist/components/atoms/Chip/index.d.ts +0 -1
  30. package/dist/components/atoms/Chip/shared/types.d.mts +9 -19
  31. package/dist/components/atoms/Chip/shared/types.d.ts +9 -19
  32. package/dist/components/atoms/Chip/shared/utils.d.mts +3 -3
  33. package/dist/components/atoms/Chip/shared/utils.d.ts +3 -3
  34. package/dist/components/atoms/Chip/shared/utils.mjs +4 -8
  35. package/dist/components/atoms/Chip/shared/utils.mjs.map +1 -1
  36. package/dist/components/atoms/DateFormatter/DateFormatter.d.mts +2 -5
  37. package/dist/components/atoms/DateFormatter/DateFormatter.d.ts +2 -5
  38. package/dist/components/atoms/DateFormatter/DateFormatter.mjs +0 -1
  39. package/dist/components/atoms/StatusLabel/StatusLabel.mjs +1 -4
  40. package/dist/components/atoms/StatusLabel/StatusLabel.mjs.map +1 -1
  41. package/dist/components/atoms/StatusLabel/StatusLabelBase.d.mts +5 -7
  42. package/dist/components/atoms/StatusLabel/StatusLabelBase.d.ts +5 -7
  43. package/dist/components/atoms/StatusLabel/StatusLabelBase.mjs +10 -12
  44. package/dist/components/atoms/Tag/Tag.d.mts +2 -4
  45. package/dist/components/atoms/Tag/Tag.d.ts +2 -4
  46. package/dist/components/atoms/Tag/Tag.mjs +0 -24
  47. package/dist/components/atoms/Tooltip/Tooltip.d.mts +41 -0
  48. package/dist/components/atoms/Tooltip/Tooltip.d.ts +41 -0
  49. package/dist/components/atoms/Tooltip/Tooltip.mjs +204 -0
  50. package/dist/components/atoms/Tooltip/Tooltip.mjs.map +1 -0
  51. package/dist/components/atoms/Tooltip/index.d.mts +2 -0
  52. package/dist/components/atoms/Tooltip/index.d.ts +2 -0
  53. package/dist/components/atoms/index.d.mts +1 -2
  54. package/dist/components/atoms/index.d.ts +1 -2
  55. package/dist/components/index.d.mts +1 -0
  56. package/dist/components/index.d.ts +1 -0
  57. package/dist/components/layout/GridSystem/GridSystem.d.mts +23 -18
  58. package/dist/components/layout/GridSystem/GridSystem.d.ts +23 -18
  59. package/dist/components/layout/GridSystem/GridSystem.mjs +7 -5
  60. package/dist/components/molecules/ActionSheet/ActionSheet.mjs +1 -0
  61. package/dist/components/molecules/AgentInput/AgentInput.d.mts +5 -0
  62. package/dist/components/molecules/AgentInput/AgentInput.d.ts +5 -0
  63. package/dist/components/molecules/AgentInput/AgentInput.mjs +1 -1
  64. package/dist/components/molecules/Alert/Alert.d.mts +1 -9
  65. package/dist/components/molecules/Alert/Alert.d.ts +1 -9
  66. package/dist/components/molecules/Alert/Alert.mjs +14 -27
  67. package/dist/components/molecules/ChipGroup/ChipGroup.d.mts +0 -1
  68. package/dist/components/molecules/ChipGroup/ChipGroup.d.ts +0 -1
  69. package/dist/components/molecules/ChipGroup/ChipGroup.mjs +2 -6
  70. package/dist/components/molecules/DateGroup/DateGroup.d.mts +1 -2
  71. package/dist/components/molecules/DateGroup/DateGroup.d.ts +1 -2
  72. package/dist/components/molecules/List/List.d.mts +2 -0
  73. package/dist/components/molecules/List/List.d.ts +2 -0
  74. package/dist/components/molecules/List/ListItem.d.mts +2 -0
  75. package/dist/components/molecules/List/ListItem.d.ts +2 -0
  76. package/dist/components/molecules/List/ListItem.mjs +5 -5
  77. package/dist/components/molecules/Menu/Menu.d.mts +117 -0
  78. package/dist/components/molecules/Menu/Menu.d.ts +117 -0
  79. package/dist/components/molecules/Menu/Menu.mjs +473 -0
  80. package/dist/components/molecules/Menu/Menu.mjs.map +1 -0
  81. package/dist/components/molecules/Menu/index.d.mts +2 -0
  82. package/dist/components/molecules/Menu/index.d.ts +2 -0
  83. package/dist/components/molecules/Modal/Modal.d.mts +0 -1
  84. package/dist/components/molecules/Modal/Modal.d.ts +0 -1
  85. package/dist/components/molecules/SearchField/SearchField.mjs +2 -0
  86. package/dist/components/molecules/SidebarNavItem/SidebarNavContext.d.mts +13 -0
  87. package/dist/components/molecules/SidebarNavItem/SidebarNavContext.d.ts +13 -0
  88. package/dist/components/molecules/SidebarNavItem/SidebarNavContext.mjs +13 -0
  89. package/dist/components/molecules/SidebarNavItem/SidebarNavContext.mjs.map +1 -0
  90. package/dist/components/molecules/SidebarNavItem/SidebarNavItem.d.mts +43 -0
  91. package/dist/components/molecules/SidebarNavItem/SidebarNavItem.d.ts +43 -0
  92. package/dist/components/molecules/SidebarNavItem/SidebarNavItem.mjs +148 -0
  93. package/dist/components/molecules/SidebarNavItem/SidebarNavItem.mjs.map +1 -0
  94. package/dist/components/molecules/SidebarNavItem/index.d.mts +2 -0
  95. package/dist/components/molecules/SidebarNavItem/index.d.ts +2 -0
  96. package/dist/components/molecules/SidebarNavSection/SidebarNavSection.d.mts +36 -0
  97. package/dist/components/molecules/SidebarNavSection/SidebarNavSection.d.ts +36 -0
  98. package/dist/components/molecules/SidebarNavSection/SidebarNavSection.mjs +188 -0
  99. package/dist/components/molecules/SidebarNavSection/SidebarNavSection.mjs.map +1 -0
  100. package/dist/components/molecules/SidebarNavSection/index.d.mts +2 -0
  101. package/dist/components/molecules/SidebarNavSection/index.d.ts +2 -0
  102. package/dist/components/molecules/TabBar/TabBar.d.mts +0 -13
  103. package/dist/components/molecules/TabBar/TabBar.d.ts +0 -13
  104. package/dist/components/molecules/TabBar/TabBar.mjs +2 -4
  105. package/dist/components/molecules/TabBar/index.d.mts +1 -1
  106. package/dist/components/molecules/TabBar/index.d.ts +1 -1
  107. package/dist/components/molecules/TransactionListItem/TransactionListItem.mjs +1 -1
  108. package/dist/components/molecules/WorkspaceSwitcher/WorkspaceSwitcher.d.mts +39 -0
  109. package/dist/components/molecules/WorkspaceSwitcher/WorkspaceSwitcher.d.ts +39 -0
  110. package/dist/components/molecules/WorkspaceSwitcher/WorkspaceSwitcher.mjs +131 -0
  111. package/dist/components/molecules/WorkspaceSwitcher/WorkspaceSwitcher.mjs.map +1 -0
  112. package/dist/components/molecules/WorkspaceSwitcher/index.d.mts +2 -0
  113. package/dist/components/molecules/WorkspaceSwitcher/index.d.ts +2 -0
  114. package/dist/components/molecules/index.d.mts +4 -1
  115. package/dist/components/molecules/index.d.ts +4 -1
  116. package/dist/components/organisms/SidebarNav/SidebarNav.d.mts +52 -0
  117. package/dist/components/organisms/SidebarNav/SidebarNav.d.ts +52 -0
  118. package/dist/components/organisms/SidebarNav/SidebarNav.mjs +235 -0
  119. package/dist/components/organisms/SidebarNav/SidebarNav.mjs.map +1 -0
  120. package/dist/components/organisms/SidebarNav/index.d.mts +2 -0
  121. package/dist/components/organisms/SidebarNav/index.d.ts +2 -0
  122. package/dist/components/organisms/index.d.mts +1 -0
  123. package/dist/components/organisms/index.d.ts +1 -0
  124. package/dist/data.js +72 -565
  125. package/dist/data.js.map +1 -1
  126. package/dist/index.js +11 -5
  127. package/dist/index.js.map +1 -1
  128. package/dist/index.mjs +7 -5
  129. package/dist/index.mjs.map +1 -1
  130. package/dist/lib/floatingPosition.d.mts +43 -0
  131. package/dist/lib/floatingPosition.d.ts +43 -0
  132. package/dist/lib/floatingPosition.mjs +86 -0
  133. package/dist/lib/floatingPosition.mjs.map +1 -0
  134. package/dist/lib/keyboardFocus.d.mts +6 -0
  135. package/dist/lib/keyboardFocus.d.ts +6 -0
  136. package/dist/lib/keyboardFocus.mjs +17 -0
  137. package/dist/lib/keyboardFocus.mjs.map +1 -0
  138. package/dist/lib/tokenAliases.d.mts +11 -11
  139. package/dist/lib/tokenAliases.d.ts +11 -11
  140. package/dist/lib/tokenAliases.mjs +13 -88
  141. package/dist/lib/tokenAliases.mjs.map +1 -1
  142. package/dist/lib/useFloatingLayer.d.mts +25 -0
  143. package/dist/lib/useFloatingLayer.d.ts +25 -0
  144. package/dist/lib/useFloatingLayer.mjs +86 -0
  145. package/dist/lib/useFloatingLayer.mjs.map +1 -0
  146. package/dist/styles/icons.json +30 -1
  147. package/dist/styles/icons.json.mjs +34 -3
  148. package/dist/styles/icons.json.mjs.map +1 -1
  149. package/dist/styles/tokens.d.mts +179 -2485
  150. package/dist/styles/tokens.d.ts +179 -2485
  151. package/dist/styles/tokens.json +39 -563
  152. package/dist/styles/tokens.json.mjs +39 -563
  153. package/dist/styles/tokens.json.mjs.map +1 -1
  154. package/dist/tokens/index.js +39 -563
  155. package/dist/tokens/index.js.map +1 -1
  156. package/dist/tokens/index.mjs +39 -563
  157. package/dist/tokens/index.mjs.map +1 -1
  158. package/dist/tokens/styles/tokens.d.mts +179 -2485
  159. package/dist/tokens/styles/tokens.d.ts +179 -2485
  160. package/dist/tokens.css +41 -493
  161. package/dist/types/icons.d.mts +1 -1
  162. package/dist/types/icons.d.ts +1 -1
  163. package/dist/types/icons.mjs.map +1 -1
  164. package/package.json +2 -2
  165. package/dist/components/atoms/CategoryBadge/CategoryBadge.d.mts +0 -29
  166. package/dist/components/atoms/CategoryBadge/CategoryBadge.d.ts +0 -29
  167. package/dist/components/atoms/CategoryBadge/CategoryBadge.mjs +0 -29
  168. package/dist/components/atoms/CategoryBadge/CategoryBadge.mjs.map +0 -1
  169. package/dist/components/atoms/CategoryBadge/index.d.mts +0 -2
  170. package/dist/components/atoms/CategoryBadge/index.d.ts +0 -2
  171. package/dist/components/atoms/Chip/BooleanChip.d.mts +0 -28
  172. package/dist/components/atoms/Chip/BooleanChip.d.ts +0 -28
  173. package/dist/components/atoms/Chip/BooleanChip.mjs +0 -76
  174. package/dist/components/atoms/Chip/BooleanChip.mjs.map +0 -1
  175. package/dist/components/atoms/StatusBadge/StatusBadge.d.mts +0 -24
  176. package/dist/components/atoms/StatusBadge/StatusBadge.d.ts +0 -24
  177. package/dist/components/atoms/StatusBadge/StatusBadge.mjs +0 -18
  178. package/dist/components/atoms/StatusBadge/StatusBadge.mjs.map +0 -1
  179. package/dist/components/atoms/StatusBadge/index.d.mts +0 -2
  180. package/dist/components/atoms/StatusBadge/index.d.ts +0 -2
  181. package/dist/components/molecules/PageTitle/PageTitle.d.mts +0 -21
  182. package/dist/components/molecules/PageTitle/PageTitle.d.ts +0 -21
  183. package/dist/components/molecules/PageTitle/PageTitle.mjs +0 -77
  184. package/dist/components/molecules/PageTitle/PageTitle.mjs.map +0 -1
  185. package/dist/components/molecules/PageTitle/index.d.mts +0 -1
  186. package/dist/components/molecules/PageTitle/index.d.ts +0 -1
@@ -7,70 +7,44 @@ import { StyledChip } from './shared/ChipBase.mjs';
7
7
  * Chip - a static, non-interactive label for tags, categories and metadata.
8
8
  *
9
9
  * Chips are classified by job (decision 0016):
10
- * - Chip: a static label (`default` variant only)
11
- * - InputChip: a removable value, such as an applied filter (formerly `FilterChip`)
12
- * - BooleanChip: toggles a filter on and off (becomes `FilterChip` in 3.0)
10
+ * - Chip: a static label
11
+ * - FilterChip: toggles a filter on and off
12
+ * - InputChip: a removable value, such as an applied filter
13
+ * - SuggestionChip: fills the agent input with a suggestion
13
14
  *
14
- * The `emphasis`, `subtle`, `interactive`, `light` and `dark` variants and `onClick` are
15
- * deprecated and will be removed in 3.0.
15
+ * For a clickable action, use a Button.
16
16
  */
17
17
  var Chip = function Chip(_a) {
18
- var children = _a.children,
19
- _b = _a.variant,
20
- variant = _b === void 0 ? 'default' : _b;
21
- // Deprecated and ignored: chips have one size (decision 0035)
22
- _a.size;
23
- var onClick = _a.onClick,
24
- _c = _a.disabled,
25
- disabled = _c === void 0 ? false : _c,
18
+ var children = _a.children;
19
+ // One variant: a removed one passed from plain JavaScript renders as default
20
+ _a.variant;
21
+ var _b = _a.disabled,
22
+ disabled = _b === void 0 ? false : _b,
26
23
  dataTestId = _a["data-testid"],
27
24
  ariaLabel = _a["aria-label"],
28
25
  ariaDescribedBy = _a["aria-describedby"],
29
26
  role = _a.role,
30
27
  title = _a.title,
31
- props = __rest(_a, ["children", "variant", "size", "onClick", "disabled", 'data-testid', 'aria-label', 'aria-describedby', "role", "title"]);
32
- var isClickable = Boolean(onClick && !disabled);
33
- // Map legacy variants to new variants
34
- var normalizedVariant = variant === 'light' ? 'default' : variant === 'dark' ? 'emphasis' : variant;
28
+ props = __rest(_a, ["children", "variant", "disabled", 'data-testid', 'aria-label', 'aria-describedby', "role", "title"]);
29
+ // Removed props passed from plain JavaScript stay off the DOM
30
+ var _c = props;
31
+ _c.onClick;
32
+ _c.size;
33
+ var domProps = __rest(_c, ["onClick", "size"]);
35
34
  // Support legacy title prop
36
35
  var content = children !== undefined ? children : title;
37
- var handleClick = function handleClick() {
38
- if (onClick && !disabled) {
39
- onClick();
40
- }
41
- };
42
- var handleKeyDown = function handleKeyDown(event) {
43
- if (isClickable && (event.key === 'Enter' || event.key === ' ')) {
44
- event.preventDefault();
45
- handleClick();
46
- }
47
- };
48
36
  return jsx(StyledChip, __assign({
49
- "$variant": normalizedVariant,
37
+ "$surface": "default",
50
38
  "$disabled": disabled || undefined,
51
- "$clickable": isClickable || undefined,
52
- onClick: isClickable ? handleClick : undefined,
53
- onKeyDown: handleKeyDown,
54
- tabIndex: isClickable ? 0 : undefined,
55
- role: role || (isClickable ? 'button' : undefined),
39
+ role: role,
56
40
  "aria-label": ariaLabel,
57
41
  "aria-describedby": ariaDescribedBy,
58
42
  "aria-disabled": disabled ? 'true' : undefined,
59
43
  "data-testid": dataTestId
60
- }, props, {
44
+ }, domProps, {
61
45
  children: content
62
46
  }));
63
47
  };
64
- var LegacyChip = function LegacyChip(_a) {
65
- var title = _a.title,
66
- _b = _a.variant,
67
- variant = _b === void 0 ? 'light' : _b;
68
- var newVariant = variant === 'dark' ? 'emphasis' : 'default';
69
- return jsx(Chip, {
70
- variant: newVariant,
71
- children: title
72
- });
73
- };
74
48
 
75
- export { Chip, LegacyChip };
49
+ export { Chip };
76
50
  //# sourceMappingURL=Chip.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.mjs","sources":["../../../../src/components/atoms/Chip/Chip.tsx"],"sourcesContent":["import React from 'react'\nimport { BaseChipProps, ChipVariant, LegacyVariant } from './shared/types'\nimport { StyledChip } from './shared/ChipBase'\n\nexport interface ChipProps extends BaseChipProps {\n /**\n * Visual style. Only `default` stays in 3.0. `emphasis`, `subtle`, `interactive`, `light`\n * and `dark` are deprecated and will be removed (decision 0016).\n * @default 'default'\n */\n variant?: ChipVariant | LegacyVariant\n /**\n * Click handler.\n * @deprecated Removed in 3.0: the static Chip is not interactive. For a clickable action use a\n * Button; for a toggle use `BooleanChip` (`FilterChip` in 3.0).\n */\n onClick?: () => void\n /** Custom ARIA role override */\n role?: string\n /** Legacy title prop for backward compatibility */\n title?: string\n}\n\n/**\n * Chip - a static, non-interactive label for tags, categories and metadata.\n *\n * Chips are classified by job (decision 0016):\n * - Chip: a static label (`default` variant only)\n * - InputChip: a removable value, such as an applied filter (formerly `FilterChip`)\n * - BooleanChip: toggles a filter on and off (becomes `FilterChip` in 3.0)\n *\n * The `emphasis`, `subtle`, `interactive`, `light` and `dark` variants and `onClick` are\n * deprecated and will be removed in 3.0.\n */\nexport const Chip: React.FC<ChipProps> = ({\n children,\n variant = 'default',\n // Deprecated and ignored: chips have one size (decision 0035)\n size: _size,\n onClick,\n disabled = false,\n 'data-testid': dataTestId,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n role,\n title,\n ...props\n}) => {\n const isClickable = Boolean(onClick && !disabled)\n \n // Map legacy variants to new variants\n const normalizedVariant: ChipVariant = \n variant === 'light' ? 'default' :\n variant === 'dark' ? 'emphasis' :\n variant as ChipVariant\n \n // Support legacy title prop\n const content = children !== undefined ? children : title\n \n const handleClick = () => {\n if (onClick && !disabled) {\n onClick()\n }\n }\n \n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (isClickable && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault()\n handleClick()\n }\n }\n \n return (\n <StyledChip\n $variant={normalizedVariant}\n $disabled={disabled || undefined}\n $clickable={isClickable || undefined}\n onClick={isClickable ? handleClick : undefined}\n onKeyDown={handleKeyDown}\n tabIndex={isClickable ? 0 : undefined}\n role={role || (isClickable ? 'button' : undefined)}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n aria-disabled={disabled ? 'true' : undefined}\n data-testid={dataTestId}\n {...props}\n >\n {content}\n </StyledChip>\n )\n}\n\n// Legacy component for backward compatibility\nexport interface LegacyChipProps {\n title: string\n variant?: LegacyVariant\n}\n\nexport const LegacyChip: React.FC<LegacyChipProps> = ({ title, variant = 'light' }) => {\n const newVariant = variant === 'dark' ? 'emphasis' : 'default'\n return <Chip variant={newVariant}>{title}</Chip>\n}\n"],"names":["Chip","_a","children","_b","variant","size","onClick","_c","disabled","dataTestId","ariaLabel","ariaDescribedBy","role","title","props","__rest","isClickable","Boolean","normalizedVariant","content","undefined","handleClick","handleKeyDown","event","key","preventDefault","_jsx","StyledChip","__assign","onKeyDown","tabIndex","LegacyChip","newVariant"],"mappings":";;;;;AAuBA;;;;;;;;;;AAUG;IACUA,IAAI,GAAwB,SAA5BA,IAAIA,CAAyBC,EAazC,EAAA;AAZC,EAAA,IAAAC,QAAQ,cAAA,CAAA;IACRC,EAAA,GAAAF,EAAA,CAAAG,OAAmB,CAAA;IAAnBA,OAAO,GAAAD,EAAA,KAAA,KAAA,CAAA,GAAG,SAAS,GAAAA,EAAA,CAAA;AACnB,IAAA;IACWF,EAAA,CAAAI,IAAA,CAAA;QACXC,OAAO,GAAAL,EAAA,CAAAK,OAAA,CAAA;IACPC,EAAA,GAAAN,EAAA,CAAAO,QAAgB,CAAA;IAAhBA,QAAQ,GAAGD,EAAA,KAAA,KAAA,CAAA,GAAA,KAAK,GAAAA,EAAA,CAAA;AACDE,IAAAA,UAAU,GAAAR,EAAA,CAAA,aAAA,CAAA,CAAA;AACXS,IAAAA,SAAS,GAAAT,EAAA,CAAA,YAAA,CAAA,CAAA;AACHU,IAAAA,eAAe,GAAAV,EAAA,CAAA,kBAAA,CAAA,CAAA;IACnCW,IAAI,GAAAX,EAAA,CAAAW,IAAA,CAAA;IACJC,KAAK,GAAAZ,EAAA,CAAAY,KAAA,CAAA;IACFC,KAAK,GAAAC,MAAA,CAAAd,EAAA,EAZgC,wHAazC,EADS;EAER,IAAMe,WAAW,GAAGC,OAAO,CAACX,OAAO,IAAI,CAACE,QAAQ,CAAC,CAAA;AAEjD;AACA,EAAA,IAAMU,iBAAiB,GACrBd,OAAO,KAAK,OAAO,GAAG,SAAS,GAC/BA,OAAO,KAAK,MAAM,GAAG,UAAU,GAC/BA,OAAsB,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,EAAA,CAAAG,OAAiB;IAAjBA,OAAO,GAAAD,EAAA,KAAA,KAAA,CAAA,GAAG,OAAO,GAAAA,EAAA,CAAA;EAC9E,IAAM6B,UAAU,GAAG5B,OAAO,KAAK,MAAM,GAAG,UAAU,GAAG,SAAS,CAAA;EAC9D,OAAOsB,GAAA,CAAC1B,IAAI,EAAC;AAAAI,IAAAA,OAAO,EAAE4B,UAAU;AAAA9B,IAAAA,QAAA,EAAGW,KAAAA;AAAK,GAAA,CAAQ,CAAA;AAClD;;;;"}
1
+ {"version":3,"file":"Chip.mjs","sources":["../../../../src/components/atoms/Chip/Chip.tsx"],"sourcesContent":["import React from 'react'\nimport { BaseChipProps, ChipVariant } from './shared/types'\nimport { StyledChip } from './shared/ChipBase'\n\nexport interface ChipProps extends BaseChipProps {\n /**\n * Visual style. The static Chip has one, `default` (decision 0016).\n * @default 'default'\n */\n variant?: ChipVariant\n /** Custom ARIA role override */\n role?: string\n /** Legacy title prop for backward compatibility */\n title?: string\n}\n\n/**\n * Chip - a static, non-interactive label for tags, categories and metadata.\n *\n * Chips are classified by job (decision 0016):\n * - Chip: a static label\n * - FilterChip: toggles a filter on and off\n * - InputChip: a removable value, such as an applied filter\n * - SuggestionChip: fills the agent input with a suggestion\n *\n * For a clickable action, use a Button.\n */\nexport const Chip: React.FC<ChipProps> = ({\n children,\n // One variant: a removed one passed from plain JavaScript renders as default\n variant: _variant,\n disabled = false,\n 'data-testid': dataTestId,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n role,\n title,\n ...props\n}) => {\n // Removed props passed from plain JavaScript stay off the DOM\n const { onClick: _onClick, size: _size, ...domProps } = props as typeof props & { onClick?: unknown; size?: unknown }\n\n // Support legacy title prop\n const content = children !== undefined ? children : title\n\n return (\n <StyledChip\n $surface=\"default\"\n $disabled={disabled || undefined}\n role={role}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n aria-disabled={disabled ? 'true' : undefined}\n data-testid={dataTestId}\n {...domProps}\n >\n {content}\n </StyledChip>\n )\n}\n"],"names":["Chip","_a","children","variant","_b","disabled","dataTestId","ariaLabel","ariaDescribedBy","role","title","props","__rest","_c","onClick","size","domProps","content","undefined","_jsx","StyledChip","__assign"],"mappings":";;;;;AAgBA;;;;;;;;;;AAUG;IACUA,IAAI,GAAwB,SAA5BA,IAAIA,CAAyBC,EAWzC,EAAA;AAVC,EAAA,IAAAC,QAAQ,GAAAD,EAAA,CAAAC,QAAA,CAAA;AACR,IAAA;IACiBD,EAAA,CAAAE,OAAA,CAAA;QACjBC,EAAA,GAAAH,EAAA,CAAAI,QAAgB,CAAA;IAAhBA,QAAQ,GAAGD,EAAA,KAAA,KAAA,CAAA,GAAA,KAAK,GAAAA,EAAA,CAAA;AACDE,IAAAA,UAAU,GAAAL,EAAA,CAAA,aAAA,CAAA,CAAA;AACXM,IAAAA,SAAS,GAAAN,EAAA,CAAA,YAAA,CAAA,CAAA;AACHO,IAAAA,eAAe,GAAAP,EAAA,CAAA,kBAAA,CAAA,CAAA;IACnCQ,IAAI,GAAAR,EAAA,CAAAQ,IAAA,CAAA;IACJC,KAAK,GAAAT,EAAA,CAAAS,KAAA,CAAA;IACFC,KAAK,GAVgCC,MAAA,CAAAX,EAAA,EAAA,CAAA,UAAA,EAAA,SAAA,EAAA,UAAA,EAAA,aAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,OAAA,CAWzC,EADS;AAER;EACMY,IAAAA,EAAkD,GAAAF,KAA6D,CAAA;IAA5FE,EAAA,CAAAC,OAAA,CAAA;IAAaD,EAAA,CAAAE,IAAA,CAAA;QAAKC,QAAQ,GAA7CJ,MAAA,CAAAC,EAAA,EAAA,CAAA,SAAA,EAAA,MAAA,CAA+C,EAAgE;AAErH;EACA,IAAMI,OAAO,GAAGf,QAAQ,KAAKgB,SAAS,GAAGhB,QAAQ,GAAGQ,KAAK,CAAA;AAEzD,EAAA,OACES,GAAA,CAACC,UAAU,EAAAC,QAAA,CAAA;AAAA,IAAA,UAAA,EACA,SAAS;IACP,WAAA,EAAAhB,QAAQ,IAAIa,SAAS;AAChCT,IAAAA,IAAI,EAAEA,IAAI;AAAA,IAAA,YAAA,EACEF,SAAS;AACH,IAAA,kBAAA,EAAAC,eAAe;AAClB,IAAA,eAAA,EAAAH,QAAQ,GAAG,MAAM,GAAGa,SAAS;AAC/B,IAAA,aAAA,EAAAZ,UAAAA;KACTU,QAAQ,EAAA;AAAAd,IAAAA,QAAA,EAEXe,OAAAA;AAAO,GAAA,CAAA,CACG,CAAA;AAEjB;;;;"}
@@ -1,13 +1,25 @@
1
- import { type InputChipProps } from './InputChip.mjs';
1
+ import React from 'react';
2
+ import { BaseChipProps } from './shared/types.mjs';
3
+ export interface FilterChipProps extends BaseChipProps {
4
+ /** Whether the chip is in selected state */
5
+ selected: boolean;
6
+ /** Callback function when the chip is clicked/toggled */
7
+ onClick: () => void;
8
+ }
2
9
  /**
3
- * @deprecated Renamed to `InputChipProps`. In 3.0 `FilterChipProps` becomes the props of the toggle chip.
4
- */
5
- export type FilterChipProps = InputChipProps;
6
- /**
7
- * FilterChip - a removable chip with an optional selected state.
10
+ * FilterChip - Toggleable chip for quick filter controls (decision 0016)
11
+ *
12
+ * Use this component for multi-select filter controls where users can
13
+ * see which options are active. Common in table filtering patterns where
14
+ * users toggle filters on/off.
15
+ *
16
+ * Features:
17
+ * - Shows checkmark icon when selected
18
+ * - Entire chip is clickable to toggle
19
+ * - Keyboard activation with Space or Enter
20
+ * - Uses checkbox role with aria-checked
21
+ * - Light-blue fill and blue text when selected and enabled; disabled colours when disabled
8
22
  *
9
- * @deprecated Renamed to `InputChip`; in 3.0 `FilterChip` becomes the toggle chip (today's
10
- * `BooleanChip`). Replace `FilterChip` with `InputChip` first, then `BooleanChip` with
11
- * `FilterChip` when you upgrade to 3.0 (decision 0016).
23
+ * Called `BooleanChip` before 3.0. For a removable value, use InputChip.
12
24
  */
13
- export declare const FilterChip: import("react").FC<InputChipProps>;
25
+ export declare const FilterChip: React.FC<FilterChipProps>;
@@ -1,13 +1,25 @@
1
- import { type InputChipProps } from './InputChip';
1
+ import React from 'react';
2
+ import { BaseChipProps } from './shared/types';
3
+ export interface FilterChipProps extends BaseChipProps {
4
+ /** Whether the chip is in selected state */
5
+ selected: boolean;
6
+ /** Callback function when the chip is clicked/toggled */
7
+ onClick: () => void;
8
+ }
2
9
  /**
3
- * @deprecated Renamed to `InputChipProps`. In 3.0 `FilterChipProps` becomes the props of the toggle chip.
4
- */
5
- export type FilterChipProps = InputChipProps;
6
- /**
7
- * FilterChip - a removable chip with an optional selected state.
10
+ * FilterChip - Toggleable chip for quick filter controls (decision 0016)
11
+ *
12
+ * Use this component for multi-select filter controls where users can
13
+ * see which options are active. Common in table filtering patterns where
14
+ * users toggle filters on/off.
15
+ *
16
+ * Features:
17
+ * - Shows checkmark icon when selected
18
+ * - Entire chip is clickable to toggle
19
+ * - Keyboard activation with Space or Enter
20
+ * - Uses checkbox role with aria-checked
21
+ * - Light-blue fill and blue text when selected and enabled; disabled colours when disabled
8
22
  *
9
- * @deprecated Renamed to `InputChip`; in 3.0 `FilterChip` becomes the toggle chip (today's
10
- * `BooleanChip`). Replace `FilterChip` with `InputChip` first, then `BooleanChip` with
11
- * `FilterChip` when you upgrade to 3.0 (decision 0016).
23
+ * Called `BooleanChip` before 3.0. For a removable value, use InputChip.
12
24
  */
13
- export declare const FilterChip: import("react").FC<InputChipProps>;
25
+ export declare const FilterChip: React.FC<FilterChipProps>;
@@ -1,14 +1,74 @@
1
1
  'use client';
2
- import { InputChip } from './InputChip.mjs';
2
+ import { __rest, __assign } from '../../../vendor/tslib/tslib.es6.mjs';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
+ import { Icon } from '../Icon/Icon.mjs';
5
+ import { StyledChip, IconContainer } from './shared/ChipBase.mjs';
3
6
 
4
7
  /**
5
- * FilterChip - a removable chip with an optional selected state.
8
+ * FilterChip - Toggleable chip for quick filter controls (decision 0016)
6
9
  *
7
- * @deprecated Renamed to `InputChip`; in 3.0 `FilterChip` becomes the toggle chip (today's
8
- * `BooleanChip`). Replace `FilterChip` with `InputChip` first, then `BooleanChip` with
9
- * `FilterChip` when you upgrade to 3.0 (decision 0016).
10
+ * Use this component for multi-select filter controls where users can
11
+ * see which options are active. Common in table filtering patterns where
12
+ * users toggle filters on/off.
13
+ *
14
+ * Features:
15
+ * - Shows checkmark icon when selected
16
+ * - Entire chip is clickable to toggle
17
+ * - Keyboard activation with Space or Enter
18
+ * - Uses checkbox role with aria-checked
19
+ * - Light-blue fill and blue text when selected and enabled; disabled colours when disabled
20
+ *
21
+ * Called `BooleanChip` before 3.0. For a removable value, use InputChip.
10
22
  */
11
- var FilterChip = InputChip;
23
+ var FilterChip = function FilterChip(_a) {
24
+ var children = _a.children,
25
+ selected = _a.selected,
26
+ onClick = _a.onClick,
27
+ _b = _a.disabled,
28
+ disabled = _b === void 0 ? false : _b,
29
+ dataTestId = _a["data-testid"],
30
+ ariaLabel = _a["aria-label"],
31
+ ariaDescribedBy = _a["aria-describedby"],
32
+ props = __rest(_a, ["children", "selected", "onClick", "disabled", 'data-testid', 'aria-label', 'aria-describedby']);
33
+ var handleClick = function handleClick() {
34
+ // Optional call: a plain JavaScript app that kept the pre-3.0 FilterChip (now InputChip) passes
35
+ // no onClick, and its chip should stay inert rather than throw
36
+ if (!disabled) {
37
+ onClick === null || onClick === void 0 ? void 0 : onClick();
38
+ }
39
+ };
40
+ var handleKeyDown = function handleKeyDown(event) {
41
+ // Handle activation with Space or Enter
42
+ if (event.key === 'Enter' || event.key === ' ') {
43
+ event.preventDefault();
44
+ handleClick();
45
+ }
46
+ };
47
+ return jsxs(StyledChip, __assign({
48
+ "$surface": "subtle",
49
+ "$disabled": disabled || undefined,
50
+ "$clickable": !disabled,
51
+ "$selected": selected,
52
+ onClick: handleClick,
53
+ onKeyDown: handleKeyDown,
54
+ tabIndex: disabled ? undefined : 0,
55
+ role: "checkbox",
56
+ "aria-checked": selected ? 'true' : 'false',
57
+ "aria-label": ariaLabel,
58
+ "aria-describedby": ariaDescribedBy,
59
+ "aria-disabled": disabled ? 'true' : undefined,
60
+ "data-testid": dataTestId
61
+ }, props, {
62
+ children: [selected && jsx(IconContainer, {
63
+ "aria-hidden": "true",
64
+ children: jsx(Icon, {
65
+ name: "check",
66
+ size: "sm",
67
+ iconColor: "inherit"
68
+ })
69
+ }), children]
70
+ }));
71
+ };
12
72
 
13
73
  export { FilterChip };
14
74
  //# sourceMappingURL=FilterChip.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilterChip.mjs","sources":["../../../../src/components/atoms/Chip/FilterChip.tsx"],"sourcesContent":["import { InputChip, type InputChipProps } from './InputChip'\n\n/**\n * @deprecated Renamed to `InputChipProps`. In 3.0 `FilterChipProps` becomes the props of the toggle chip.\n */\nexport type FilterChipProps = InputChipProps\n\n/**\n * FilterChip - a removable chip with an optional selected state.\n *\n * @deprecated Renamed to `InputChip`; in 3.0 `FilterChip` becomes the toggle chip (today's\n * `BooleanChip`). Replace `FilterChip` with `InputChip` first, then `BooleanChip` with\n * `FilterChip` when you upgrade to 3.0 (decision 0016).\n */\nexport const FilterChip = InputChip\n"],"names":["FilterChip","InputChip"],"mappings":";;;AAOA;;;;;;AAMG;AACI,IAAMA,UAAU,GAAGC;;;;"}
1
+ {"version":3,"file":"FilterChip.mjs","sources":["../../../../src/components/atoms/Chip/FilterChip.tsx"],"sourcesContent":["import React from 'react'\nimport { Icon } from '../Icon'\nimport { BaseChipProps } from './shared/types'\nimport { StyledChip, IconContainer } from './shared/ChipBase'\n\nexport interface FilterChipProps extends BaseChipProps {\n /** Whether the chip is in selected state */\n selected: boolean\n /** Callback function when the chip is clicked/toggled */\n onClick: () => void\n}\n\n/**\n * FilterChip - Toggleable chip for quick filter controls (decision 0016)\n * \n * Use this component for multi-select filter controls where users can\n * see which options are active. Common in table filtering patterns where\n * users toggle filters on/off.\n * \n * Features:\n * - Shows checkmark icon when selected\n * - Entire chip is clickable to toggle\n * - Keyboard activation with Space or Enter\n * - Uses checkbox role with aria-checked\n * - Light-blue fill and blue text when selected and enabled; disabled colours when disabled\n *\n * Called `BooleanChip` before 3.0. For a removable value, use InputChip.\n */\nexport const FilterChip: React.FC<FilterChipProps> = ({\n children,\n selected,\n onClick,\n disabled = false,\n 'data-testid': dataTestId,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}) => {\n const handleClick = () => {\n // Optional call: a plain JavaScript app that kept the pre-3.0 FilterChip (now InputChip) passes\n // no onClick, and its chip should stay inert rather than throw\n if (!disabled) {\n onClick?.()\n }\n }\n \n const handleKeyDown = (event: React.KeyboardEvent) => {\n // Handle activation with Space or Enter\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n handleClick()\n }\n }\n \n return (\n <StyledChip\n $surface=\"subtle\"\n $disabled={disabled || undefined}\n $clickable={!disabled}\n $selected={selected}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n tabIndex={disabled ? undefined : 0}\n role=\"checkbox\"\n aria-checked={selected ? 'true' : 'false'}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n aria-disabled={disabled ? 'true' : undefined}\n data-testid={dataTestId}\n {...props}\n >\n {/* Show selected indicator when selected */}\n {selected && (\n <IconContainer aria-hidden=\"true\">\n <Icon name=\"check\" size=\"sm\" iconColor=\"inherit\" />\n </IconContainer>\n )}\n \n {children}\n </StyledChip>\n )\n}\n"],"names":["FilterChip","_a","children","selected","onClick","_b","disabled","dataTestId","ariaLabel","ariaDescribedBy","props","__rest","handleClick","handleKeyDown","event","key","preventDefault","_jsxs","StyledChip","__assign","undefined","onKeyDown","tabIndex","role","_jsx","IconContainer","Icon","name","size","iconColor"],"mappings":";;;;;;AAYA;;;;;;;;;;;;;;;AAeG;IACUA,UAAU,GAA8B,SAAxCA,UAAUA,CAA+BC,EASrD,EAAA;AARC,EAAA,IAAAC,QAAQ,GAAAD,EAAA,CAAAC,QAAA;IACRC,QAAQ,GAA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GAAGc,SAAS,GAAG,CAAC;AAClCG,IAAAA,IAAI,EAAC,UAAU;oBACDpB,QAAQ,GAAG,MAAM,GAAG,OAAO;kBAC7BK,SAAS;AAAA,IAAA,kBAAA,EACHC,eAAe;AAClB,IAAA,eAAA,EAAAH,QAAQ,GAAG,MAAM,GAAGc,SAAS;AAAA,IAAA,aAAA,EAC/Bb,UAAAA;GACT,EAAAG,KAAK;eAGRP,QAAQ,IACPqB,GAAA,CAACC,aAAa,EAAA;AAAA,MAAA,aAAA,EAAa,MAAM;AAC/BvB,MAAAA,QAAA,EAAAsB,GAAA,CAACE,IAAI,EAAC;AAAAC,QAAAA,IAAI,EAAC,OAAO;AAACC,QAAAA,IAAI,EAAC,IAAI;AAACC,QAAAA,SAAS,EAAC,SAAA;OAAY,CAAA;KAAA,CAEtD,EAEA3B,QAAQ,CAAA;AACE,GAAA,CAAA,CAAA,CAAA;AAEjB;;;;"}
@@ -24,16 +24,14 @@ var InputChip = function InputChip(_a) {
24
24
  var children = _a.children,
25
25
  _b = _a.selected,
26
26
  selected = _b === void 0 ? false : _b,
27
- onDismiss = _a.onDismiss;
28
- // Deprecated and ignored: chips have one size (decision 0035)
29
- _a.size;
30
- var _c = _a.disabled,
27
+ onDismiss = _a.onDismiss,
28
+ _c = _a.disabled,
31
29
  disabled = _c === void 0 ? false : _c,
32
30
  dataTestId = _a["data-testid"],
33
31
  ariaLabel = _a["aria-label"],
34
32
  ariaDescribedBy = _a["aria-describedby"],
35
33
  role = _a.role,
36
- props = __rest(_a, ["children", "selected", "onDismiss", "size", "disabled", 'data-testid', 'aria-label', 'aria-describedby', "role"]);
34
+ props = __rest(_a, ["children", "selected", "onDismiss", "disabled", 'data-testid', 'aria-label', 'aria-describedby', "role"]);
37
35
  var isDismissible = Boolean(onDismiss);
38
36
  var handleDismiss = function handleDismiss(event) {
39
37
  event.stopPropagation(); // Prevent event bubbling
@@ -57,7 +55,7 @@ var InputChip = function InputChip(_a) {
57
55
  // Generate accessible label for close button
58
56
  var closeButtonLabel = typeof children === 'string' ? "Remove ".concat(children) : 'Remove filter';
59
57
  return jsxs(StyledChip, __assign({
60
- "$variant": "subtle",
58
+ "$surface": "subtle",
61
59
  "$disabled": disabled || undefined,
62
60
  "$clickable": false,
63
61
  "$selected": selected,
@@ -1 +1 @@
1
- {"version":3,"file":"InputChip.mjs","sources":["../../../../src/components/atoms/Chip/InputChip.tsx"],"sourcesContent":["import React from 'react'\nimport { Icon } from '../Icon'\nimport { BaseChipProps } from './shared/types'\nimport { StyledChip, IconContainer, CloseButton } from './shared/ChipBase'\n\nexport interface InputChipProps extends BaseChipProps {\n /** Whether the filter is in selected/applied state */\n selected?: boolean\n /** Callback function when the chip is dismissed via close button or keyboard */\n onDismiss?: () => void\n /** Custom ARIA role override */\n role?: string\n}\n\n/**\n * InputChip - A removable value, such as an applied filter, with an optional selected state\n * \n * Use this component to show values the user has entered or applied, such as filters.\n * When selected, displays a checkmark on the light-blue selected treatment (decision 0016).\n * A selected disabled chip uses the disabled colours and keeps its checkmark.\n * Optionally dismissible when onDismiss is provided.\n * \n * Features:\n * - Shows checkmark icon when selected\n * - Light-blue fill and blue text when selected and enabled; disabled colours when disabled\n * - Optional close (×) button when onDismiss is provided\n * - Keyboard dismissal with Delete or Backspace keys (when dismissible)\n * - Non-clickable body (only close button is interactive when present)\n * - Announces as \"status\" to screen readers\n */\nexport const InputChip: React.FC<InputChipProps> = ({\n children,\n selected = false,\n onDismiss,\n // Deprecated and ignored: chips have one size (decision 0035)\n size: _size,\n disabled = false,\n 'data-testid': dataTestId,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n role,\n ...props\n}) => {\n const isDismissible = Boolean(onDismiss)\n \n const handleDismiss = (event: React.MouseEvent) => {\n event.stopPropagation() // Prevent event bubbling\n if (!disabled && onDismiss) {\n onDismiss()\n }\n }\n \n const handleKeyDown = (event: React.KeyboardEvent) => {\n // Handle dismiss with Delete or Backspace (only when dismissible)\n if (!disabled && isDismissible && onDismiss && (event.key === 'Delete' || event.key === 'Backspace')) {\n event.preventDefault()\n onDismiss()\n }\n }\n \n const handleCloseKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n if (!disabled && onDismiss) onDismiss()\n }\n }\n \n // Generate accessible label for close button\n const closeButtonLabel = typeof children === 'string' ? `Remove ${children}` : 'Remove filter'\n \n return (\n <StyledChip\n $variant=\"subtle\"\n $disabled={disabled || undefined}\n $clickable={false}\n $selected={selected}\n onKeyDown={handleKeyDown}\n role={role || 'status'}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n aria-disabled={disabled ? 'true' : undefined}\n data-testid={dataTestId}\n {...props}\n >\n {/* Show selected indicator when selected */}\n {selected && (\n <IconContainer aria-hidden=\"true\">\n <Icon name=\"check\" size=\"sm\" iconColor=\"inherit\" />\n </IconContainer>\n )}\n \n {children}\n \n {/* Show close button only when dismissible */}\n {isDismissible && (\n <CloseButton\n type=\"button\"\n onClick={handleDismiss}\n onKeyDown={handleCloseKeyDown}\n disabled={disabled}\n $disabled={disabled}\n aria-label={closeButtonLabel}\n tabIndex={0}\n data-testid={dataTestId ? `${dataTestId}-close` : undefined}\n >\n <Icon name=\"close\" size=\"sm\" iconColor=\"inherit\" />\n </CloseButton>\n )}\n </StyledChip>\n )\n}\n"],"names":["InputChip","_a","children","_b","selected","onDismiss","size","_c","disabled","dataTestId","ariaLabel","ariaDescribedBy","role","props","__rest","isDismissible","Boolean","handleDismiss","event","stopPropagation","handleKeyDown","key","preventDefault","handleCloseKeyDown","closeButtonLabel","concat","_jsxs","StyledChip","__assign","undefined","onKeyDown","_jsx","IconContainer","Icon","name","iconColor","CloseButton","type","onClick","tabIndex"],"mappings":";;;;;;AAcA;;;;;;;;;;;;;;;AAeG;IACUA,SAAS,GAA6B,SAAtCA,SAASA,CAA8BC,EAYnD,EAAA;AAXC,EAAA,IAAAC,QAAQ,GAAAD,EAAA,CAAAC,QAAA,CAAA;IACR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AAC,MAAAA,IAAI,EAAC,QAAQ;AACbC,MAAAA,OAAO,EAAErB,aAAa;AACtBa,MAAAA,SAAS,EAAEP,kBAAkB;AAC7Bf,MAAAA,QAAQ,EAAEA,QAAQ;AAAA,MAAA,WAAA,EACPA,QAAQ;AAAA,MAAA,YAAA,EACPgB,gBAAgB;AAC5Be,MAAAA,QAAQ,EAAE,CAAC;AACE,MAAA,aAAA,EAAA9B,UAAU,GAAG,EAAA,CAAAgB,MAAA,CAAGhB,UAAU,EAAA,QAAA,CAAQ,GAAGoB,SAAS;AAE3D3B,MAAAA,QAAA,EAAA6B,GAAA,CAACE,IAAI,EAAC;AAAAC,QAAAA,IAAI,EAAC,OAAO;AAAC5B,QAAAA,IAAI,EAAC,IAAI;AAAC6B,QAAAA,SAAS,EAAC,SAAA;OAAY,CAAA;AAAA,KAAA,CAEtD,CAAA;AAAA,GAAA,CAAA,CACU,CAAA;AAEjB;;;;"}
1
+ {"version":3,"file":"InputChip.mjs","sources":["../../../../src/components/atoms/Chip/InputChip.tsx"],"sourcesContent":["import React from 'react'\nimport { Icon } from '../Icon'\nimport { BaseChipProps } from './shared/types'\nimport { StyledChip, IconContainer, CloseButton } from './shared/ChipBase'\n\nexport interface InputChipProps extends BaseChipProps {\n /** Whether the filter is in selected/applied state */\n selected?: boolean\n /** Callback function when the chip is dismissed via close button or keyboard */\n onDismiss?: () => void\n /** Custom ARIA role override */\n role?: string\n}\n\n/**\n * InputChip - A removable value, such as an applied filter, with an optional selected state\n * \n * Use this component to show values the user has entered or applied, such as filters.\n * When selected, displays a checkmark on the light-blue selected treatment (decision 0016).\n * A selected disabled chip uses the disabled colours and keeps its checkmark.\n * Optionally dismissible when onDismiss is provided.\n * \n * Features:\n * - Shows checkmark icon when selected\n * - Light-blue fill and blue text when selected and enabled; disabled colours when disabled\n * - Optional close (×) button when onDismiss is provided\n * - Keyboard dismissal with Delete or Backspace keys (when dismissible)\n * - Non-clickable body (only close button is interactive when present)\n * - Announces as \"status\" to screen readers\n */\nexport const InputChip: React.FC<InputChipProps> = ({\n children,\n selected = false,\n onDismiss,\n disabled = false,\n 'data-testid': dataTestId,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n role,\n ...props\n}) => {\n const isDismissible = Boolean(onDismiss)\n \n const handleDismiss = (event: React.MouseEvent) => {\n event.stopPropagation() // Prevent event bubbling\n if (!disabled && onDismiss) {\n onDismiss()\n }\n }\n \n const handleKeyDown = (event: React.KeyboardEvent) => {\n // Handle dismiss with Delete or Backspace (only when dismissible)\n if (!disabled && isDismissible && onDismiss && (event.key === 'Delete' || event.key === 'Backspace')) {\n event.preventDefault()\n onDismiss()\n }\n }\n \n const handleCloseKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n if (!disabled && onDismiss) onDismiss()\n }\n }\n \n // Generate accessible label for close button\n const closeButtonLabel = typeof children === 'string' ? `Remove ${children}` : 'Remove filter'\n \n return (\n <StyledChip\n $surface=\"subtle\"\n $disabled={disabled || undefined}\n $clickable={false}\n $selected={selected}\n onKeyDown={handleKeyDown}\n role={role || 'status'}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n aria-disabled={disabled ? 'true' : undefined}\n data-testid={dataTestId}\n {...props}\n >\n {/* Show selected indicator when selected */}\n {selected && (\n <IconContainer aria-hidden=\"true\">\n <Icon name=\"check\" size=\"sm\" iconColor=\"inherit\" />\n </IconContainer>\n )}\n \n {children}\n \n {/* Show close button only when dismissible */}\n {isDismissible && (\n <CloseButton\n type=\"button\"\n onClick={handleDismiss}\n onKeyDown={handleCloseKeyDown}\n disabled={disabled}\n $disabled={disabled}\n aria-label={closeButtonLabel}\n tabIndex={0}\n data-testid={dataTestId ? `${dataTestId}-close` : undefined}\n >\n <Icon name=\"close\" size=\"sm\" iconColor=\"inherit\" />\n </CloseButton>\n )}\n </StyledChip>\n )\n}\n"],"names":["InputChip","_a","children","_b","selected","onDismiss","_c","disabled","dataTestId","ariaLabel","ariaDescribedBy","role","props","__rest","isDismissible","Boolean","handleDismiss","event","stopPropagation","handleKeyDown","key","preventDefault","handleCloseKeyDown","closeButtonLabel","concat","_jsxs","StyledChip","__assign","undefined","onKeyDown","_jsx","IconContainer","Icon","name","size","iconColor","CloseButton","type","onClick","tabIndex"],"mappings":";;;;;;AAcA;;;;;;;;;;;;;;;AAeG;IACUA,SAAS,GAA6B,SAAtCA,SAASA,CAA8BC,EAUnD,EAAA;AATC,EAAA,IAAAC,QAAQ,GAAAD,EAAA,CAAAC,QAAA;IACRC,EAAA,GAAAF,EAAA,CAAAG,QAAgB;IAAhBA,QAAQ,GAAAD,EAAA,KAAA,KAAA,CAAA,GAAG,KAAK,GAAAA,EAAA;IAChBE,SAAS,GAAAJ,EAAA,CAAAI,SAAA;IACTC,EAAA,GAAAL,EAAA,CAAAM,QAAgB;IAAhBA,QAAQ,GAAAD,EAAA,KAAA,KAAA,CAAA,GAAG,KAAK,GAAAA,EAAA;AACDE,IAAAA,UAAU,GAAAP,EAAA,CAAA,aAAA,CAAA;AACXQ,IAAAA,SAAS,mBAAA;AACHC,IAAAA,eAAe,GAAAT,EAAA,CAAA,kBAAA,CAAA;IACnCU,IAAI,GAAAV,EAAA,CAAAU,IAAA;IACDC,KAAK,GAAAC,MAAA,CAAAZ,EAAA,EAT0C,0GAUnD,CADS,CAAA;AAER,EAAA,IAAMa,aAAa,GAAGC,OAAO,CAACV,SAAS,CAAC,CAAA;AAExC,EAAA,IAAMW,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,KAAuB,EAAA;AAC5CA,IAAAA,KAAK,CAACC,eAAe,EAAE,CAAA;AACvB,IAAA,IAAI,CAACX,QAAQ,IAAIF,SAAS,EAAE;AAC1BA,MAAAA,SAAS,EAAE,CAAA;AACb,KAAA;GACD,CAAA;AAED,EAAA,IAAMc,aAAa,GAAG,SAAhBA,aAAaA,CAAIF,KAA0B,EAAA;AAC/C;AACA,IAAA,IAAI,CAACV,QAAQ,IAAI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A,IAAI,EAAC,OAAO;AAACC,QAAAA,IAAI,EAAC,IAAI;AAACC,QAAAA,SAAS,EAAC,SAAA;OAAS,CAAA;KAClC,CACjB,EAEAjC,QAAQ,EAGRY,aAAa,IACZgB,GAAC,CAAAM,WAAW,EACV;AAAAC,MAAAA,IAAI,EAAC,QAAQ;AACbC,MAAAA,OAAO,EAAEtB,aAAa;AACtBa,MAAAA,SAAS,EAAEP,kBAAkB;AAC7Bf,MAAAA,QAAQ,EAAEA,QAAQ;AAAA,MAAA,WAAA,EACPA,QAAQ;AAAA,MAAA,YAAA,EACPgB,gBAAgB;AAC5BgB,MAAAA,QAAQ,EAAE,CAAC;AACE,MAAA,aAAA,EAAA/B,UAAU,GAAG,EAAA,CAAAgB,MAAA,CAAGhB,UAAU,EAAA,QAAA,CAAQ,GAAGoB,SAAS;AAE3D1B,MAAAA,QAAA,EAAA4B,GAAA,CAACE,IAAI,EAAC;AAAAC,QAAAA,IAAI,EAAC,OAAO;AAACC,QAAAA,IAAI,EAAC,IAAI;AAACC,QAAAA,SAAS,EAAC,SAAA;OAAY,CAAA;AAAA,KAAA,CAEtD,CAAA;AAAA,GAAA,CAAA,CACU,CAAA;AAEjB;;;;"}
@@ -1,5 +1,4 @@
1
1
  export * from './Chip.mjs';
2
2
  export * from './InputChip.mjs';
3
3
  export * from './FilterChip.mjs';
4
- export * from './BooleanChip.mjs';
5
4
  export * from './SuggestionChip.mjs';
@@ -1,5 +1,4 @@
1
1
  export * from './Chip';
2
2
  export * from './InputChip';
3
3
  export * from './FilterChip';
4
- export * from './BooleanChip';
5
4
  export * from './SuggestionChip';
@@ -1,34 +1,24 @@
1
1
  import React from 'react';
2
2
  export interface BaseChipProps {
3
3
  children?: React.ReactNode;
4
- /**
5
- * @deprecated Ignored, and removed in 3.0. Chips have one size, 24px (decision 0035).
6
- */
7
- size?: 'small' | 'medium';
8
4
  disabled?: boolean;
9
5
  'data-testid'?: string;
10
6
  'aria-label'?: string;
11
7
  'aria-describedby'?: string;
12
8
  }
13
9
  /**
14
- * Visual variants for the static Chip. Only `default` stays in 3.0 (decision 0016):
15
- * chips are classified by job, not emphasis.
10
+ * Visual variant of the static Chip. Chips are classified by job, not emphasis, so the static
11
+ * Chip has only `default` (decision 0016).
16
12
  */
17
- export type ChipVariant = 'default'
18
- /** @deprecated Removed in 3.0. Chips have no emphasis levels; use `default`. */
19
- | 'emphasis'
20
- /** @deprecated Removed in 3.0. Use `default`. */
21
- | 'subtle'
22
- /** @deprecated Removed in 3.0. For a clickable action use a Button; for a toggle use `BooleanChip` (`FilterChip` in 3.0). */
23
- | 'interactive';
13
+ export type ChipVariant = 'default';
14
+ /**
15
+ * Internal chip surfaces: `default` for the static Chip; `subtle` for the controls (FilterChip
16
+ * and InputChip) before they're selected.
17
+ */
18
+ export type ChipSurface = 'default' | 'subtle';
24
19
  export interface InternalStyledProps {
25
- $variant: ChipVariant;
20
+ $surface: ChipSurface;
26
21
  $disabled?: boolean;
27
22
  $clickable?: boolean;
28
23
  $selected?: boolean;
29
24
  }
30
- /**
31
- * Legacy Chip variants.
32
- * @deprecated Removed in 3.0. `light` is the same as `default`; `dark` maps to the deprecated `emphasis`. Use `default`.
33
- */
34
- export type LegacyVariant = 'light' | 'dark';
@@ -1,34 +1,24 @@
1
1
  import React from 'react';
2
2
  export interface BaseChipProps {
3
3
  children?: React.ReactNode;
4
- /**
5
- * @deprecated Ignored, and removed in 3.0. Chips have one size, 24px (decision 0035).
6
- */
7
- size?: 'small' | 'medium';
8
4
  disabled?: boolean;
9
5
  'data-testid'?: string;
10
6
  'aria-label'?: string;
11
7
  'aria-describedby'?: string;
12
8
  }
13
9
  /**
14
- * Visual variants for the static Chip. Only `default` stays in 3.0 (decision 0016):
15
- * chips are classified by job, not emphasis.
10
+ * Visual variant of the static Chip. Chips are classified by job, not emphasis, so the static
11
+ * Chip has only `default` (decision 0016).
16
12
  */
17
- export type ChipVariant = 'default'
18
- /** @deprecated Removed in 3.0. Chips have no emphasis levels; use `default`. */
19
- | 'emphasis'
20
- /** @deprecated Removed in 3.0. Use `default`. */
21
- | 'subtle'
22
- /** @deprecated Removed in 3.0. For a clickable action use a Button; for a toggle use `BooleanChip` (`FilterChip` in 3.0). */
23
- | 'interactive';
13
+ export type ChipVariant = 'default';
14
+ /**
15
+ * Internal chip surfaces: `default` for the static Chip; `subtle` for the controls (FilterChip
16
+ * and InputChip) before they're selected.
17
+ */
18
+ export type ChipSurface = 'default' | 'subtle';
24
19
  export interface InternalStyledProps {
25
- $variant: ChipVariant;
20
+ $surface: ChipSurface;
26
21
  $disabled?: boolean;
27
22
  $clickable?: boolean;
28
23
  $selected?: boolean;
29
24
  }
30
- /**
31
- * Legacy Chip variants.
32
- * @deprecated Removed in 3.0. `light` is the same as `default`; `dark` maps to the deprecated `emphasis`. Use `default`.
33
- */
34
- export type LegacyVariant = 'light' | 'dark';
@@ -1,10 +1,10 @@
1
- import { ChipVariant } from './types.mjs';
1
+ import { ChipSurface } from './types.mjs';
2
2
  interface StyledChipProps {
3
- $variant: ChipVariant;
3
+ $surface: ChipSurface;
4
4
  $disabled?: boolean;
5
5
  $clickable?: boolean;
6
6
  $selected?: boolean;
7
7
  }
8
- export declare const getVariantStyles: ({ $variant, $selected, $clickable, $disabled }: StyledChipProps) => string;
8
+ export declare const getVariantStyles: ({ $surface, $selected, $clickable, $disabled }: StyledChipProps) => string;
9
9
  export declare const sizeStyles: string;
10
10
  export {};
@@ -1,10 +1,10 @@
1
- import { ChipVariant } from './types';
1
+ import { ChipSurface } from './types';
2
2
  interface StyledChipProps {
3
- $variant: ChipVariant;
3
+ $surface: ChipSurface;
4
4
  $disabled?: boolean;
5
5
  $clickable?: boolean;
6
6
  $selected?: boolean;
7
7
  }
8
- export declare const getVariantStyles: ({ $variant, $selected, $clickable, $disabled }: StyledChipProps) => string;
8
+ export declare const getVariantStyles: ({ $surface, $selected, $clickable, $disabled }: StyledChipProps) => string;
9
9
  export declare const sizeStyles: string;
10
10
  export {};
@@ -4,9 +4,9 @@ import { forcedColors } from '../../../../lib/styleUtils.mjs';
4
4
 
5
5
  var chip = tokens.component.chip,
6
6
  semantic = tokens.semantic;
7
- // Helper function to get variant styles matching Button's approach
7
+ // The chip's fill and text for its surface and state, matching Button's approach
8
8
  var getVariantStyles = function getVariantStyles(_a) {
9
- var $variant = _a.$variant,
9
+ var $surface = _a.$surface,
10
10
  $selected = _a.$selected,
11
11
  $clickable = _a.$clickable,
12
12
  $disabled = _a.$disabled;
@@ -25,16 +25,12 @@ var getVariantStyles = function getVariantStyles(_a) {
25
25
  var interactiveStates = $clickable;
26
26
  return "\n background-color: ".concat(fill['accent-muted'], ";\n color: ").concat(text.accent, ";\n \n &:hover {\n background-color: ").concat(interactiveStates ? fill['accent-muted-hover'] : fill['accent-muted'], ";\n color: ").concat(interactiveStates ? text.accent : text.accent, ";\n }\n \n &:active {\n background-color: ").concat(interactiveStates ? fill['accent-muted-pressed'] : fill['accent-muted'], ";\n color: ").concat(interactiveStates ? text.accent : text.accent, ";\n }\n\n /* Forced colours drop the fill, so a selected chip takes the system selection colours\n (decision 0038); its checkmark follows the text colour */\n ").concat(forcedColors, " {\n forced-color-adjust: none;\n background-color: Highlight;\n border-color: Highlight;\n color: HighlightText;\n }\n ");
27
27
  }
28
- switch ($variant) {
29
- case 'emphasis':
30
- return "\n background-color: ".concat(chip.variants.emphasis.backgroundColor, ";\n color: ").concat(chip.variants.emphasis.textColor, ";\n \n &:hover {\n background-color: ").concat($disabled ? chip.variants.emphasis.disabled.backgroundColor : $clickable ? chip.variants.emphasis.hover.backgroundColor : chip.variants.emphasis.backgroundColor, ";\n }\n \n &:active {\n background-color: ").concat($disabled ? chip.variants.emphasis.disabled.backgroundColor : $clickable ? chip.variants.emphasis.active.backgroundColor : chip.variants.emphasis.backgroundColor, ";\n }\n \n ").concat($disabled ? "\n background-color: ".concat(chip.variants.emphasis.disabled.backgroundColor, ";\n color: ").concat(chip.variants.emphasis.disabled.textColor, ";\n ") : '', "\n ");
28
+ switch ($surface) {
31
29
  case 'subtle':
32
30
  return "\n background-color: ".concat(chip.variants.subtle.backgroundColor, ";\n color: ").concat(chip.variants.subtle.textColor, ";\n \n &:hover {\n background-color: ").concat($disabled ? chip.variants.subtle.disabled.backgroundColor : $clickable ? chip.variants.subtle.hover.backgroundColor : chip.variants.subtle.backgroundColor, ";\n }\n \n &:active {\n background-color: ").concat($disabled ? chip.variants.subtle.disabled.backgroundColor : $clickable ? chip.variants.subtle.active.backgroundColor : chip.variants.subtle.backgroundColor, ";\n }\n \n ").concat($disabled ? "\n background-color: ".concat(chip.variants.subtle.disabled.backgroundColor, ";\n color: ").concat(chip.variants.subtle.disabled.textColor, ";\n ") : '', "\n ");
33
- case 'interactive':
34
- return "\n background-color: ".concat(chip.variants.interactive.backgroundColor, ";\n color: ").concat(chip.variants.interactive.textColor, ";\n \n &:hover {\n background-color: ").concat($disabled ? chip.variants.interactive.disabled.backgroundColor : $clickable ? chip.variants.interactive.hover.backgroundColor : chip.variants.interactive.backgroundColor, ";\n }\n \n &:active {\n background-color: ").concat($disabled ? chip.variants.interactive.disabled.backgroundColor : $clickable ? chip.variants.interactive.active.backgroundColor : chip.variants.interactive.backgroundColor, ";\n }\n \n ").concat($disabled ? "\n background-color: ".concat(chip.variants.interactive.disabled.backgroundColor, ";\n color: ").concat(chip.variants.interactive.disabled.textColor, ";\n ") : '', "\n ");
35
31
  case 'default':
36
32
  default:
37
- return "\n background-color: ".concat(chip["default"].backgroundColor, ";\n color: ").concat(chip["default"].textColor, ";\n \n &:hover {\n background-color: ").concat($disabled ? chip.disabled.backgroundColor : $clickable ? chip.hover.backgroundColor : chip["default"].backgroundColor, ";\n }\n \n &:active {\n background-color: ").concat($disabled ? chip.disabled.backgroundColor : $clickable ? chip.active.backgroundColor : chip["default"].backgroundColor, ";\n }\n \n ").concat($disabled ? "\n background-color: ".concat(chip.disabled.backgroundColor, ";\n color: ").concat(chip.disabled.textColor, ";\n ") : '', "\n ");
33
+ return "\n background-color: ".concat(chip["default"].backgroundColor, ";\n color: ").concat(chip["default"].textColor, ";\n \n ").concat($disabled ? "\n background-color: ".concat(chip.disabled.backgroundColor, ";\n color: ").concat(chip.disabled.textColor, ";\n ") : '', "\n ");
38
34
  }
39
35
  };
40
36
  // Chips have one size: 24px from the label scale as a minimum, with the content centred
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","sources":["../../../../../src/components/atoms/Chip/shared/utils.ts"],"sourcesContent":["import tokens from '../../../../lib/cssTokens'\nimport { forcedColors } from '../../../../lib/styleUtils'\nimport { ChipVariant } from './types'\n\nconst { component: { chip }, semantic } = tokens\n\ninterface StyledChipProps {\n $variant: ChipVariant\n $disabled?: boolean\n $clickable?: boolean\n $selected?: boolean\n}\n\n// Helper function to get variant styles matching Button's approach\nexport const getVariantStyles = ({ $variant, $selected, $clickable, $disabled }: StyledChipProps) => {\n // Selected filter and input chips use the light-blue selected treatment (decision 0016).\n // The text darkens with the fill so every state stays at least 4.5:1.\n if ($selected) {\n // A selected disabled chip looks like any disabled chip; the checkmark keeps the\n // selected state visible (#110)\n if ($disabled) {\n const { disabled } = chip.variants.subtle\n return `\n background-color: ${disabled.backgroundColor};\n color: ${disabled.textColor};\n `\n }\n\n const { fill, text } = tokens.semantic.color\n const interactiveStates = $clickable\n return `\n background-color: ${fill['accent-muted']};\n color: ${text.accent};\n \n &:hover {\n background-color: ${interactiveStates ? fill['accent-muted-hover'] : fill['accent-muted']};\n color: ${interactiveStates ? text.accent : text.accent};\n }\n \n &:active {\n background-color: ${interactiveStates ? fill['accent-muted-pressed'] : fill['accent-muted']};\n color: ${interactiveStates ? text.accent : text.accent};\n }\n\n /* Forced colours drop the fill, so a selected chip takes the system selection colours\n (decision 0038); its checkmark follows the text colour */\n ${forcedColors} {\n forced-color-adjust: none;\n background-color: Highlight;\n border-color: Highlight;\n color: HighlightText;\n }\n `\n }\n \n switch ($variant) {\n case 'emphasis':\n return `\n background-color: ${chip.variants.emphasis.backgroundColor};\n color: ${chip.variants.emphasis.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.variants.emphasis.disabled.backgroundColor : ($clickable ? chip.variants.emphasis.hover.backgroundColor : chip.variants.emphasis.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.variants.emphasis.disabled.backgroundColor : ($clickable ? chip.variants.emphasis.active.backgroundColor : chip.variants.emphasis.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.variants.emphasis.disabled.backgroundColor};\n color: ${chip.variants.emphasis.disabled.textColor};\n ` : ''}\n `\n case 'subtle':\n return `\n background-color: ${chip.variants.subtle.backgroundColor};\n color: ${chip.variants.subtle.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.variants.subtle.disabled.backgroundColor : ($clickable ? chip.variants.subtle.hover.backgroundColor : chip.variants.subtle.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.variants.subtle.disabled.backgroundColor : ($clickable ? chip.variants.subtle.active.backgroundColor : chip.variants.subtle.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.variants.subtle.disabled.backgroundColor};\n color: ${chip.variants.subtle.disabled.textColor};\n ` : ''}\n `\n case 'interactive':\n return `\n background-color: ${chip.variants.interactive.backgroundColor};\n color: ${chip.variants.interactive.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.variants.interactive.disabled.backgroundColor : ($clickable ? chip.variants.interactive.hover.backgroundColor : chip.variants.interactive.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.variants.interactive.disabled.backgroundColor : ($clickable ? chip.variants.interactive.active.backgroundColor : chip.variants.interactive.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.variants.interactive.disabled.backgroundColor};\n color: ${chip.variants.interactive.disabled.textColor};\n ` : ''}\n `\n case 'default':\n default:\n return `\n background-color: ${chip.default.backgroundColor};\n color: ${chip.default.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.disabled.backgroundColor : ($clickable ? chip.hover.backgroundColor : chip.default.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.disabled.backgroundColor : ($clickable ? chip.active.backgroundColor : chip.default.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.disabled.backgroundColor};\n color: ${chip.disabled.textColor};\n ` : ''}\n `\n }\n}\n\n// Chips have one size: 24px from the label scale as a minimum, with the content centred\n// and no vertical padding (decisions 0034 and 0035). Horizontal padding comes from the\n// semantic spacing scale (decision 0022).\nexport const sizeStyles = `\n font: ${chip.sizes.medium.font};\n min-height: ${semantic.size.label.medium};\n padding: 0 ${semantic.space.inset.sm};\n`\n\n"],"names":["chip","tokens","component","semantic","getVariantStyles","_a","$variant","$selected","$clickable","$disabled","disabled","variants","subtle","concat","backgroundColor","textColor","_b","color","fill","text","interactiveStates","accent","forcedColors","emphasis","hover","active","interactive","sizeStyles","sizes","medium","font","size","label","space","inset","sm"],"mappings":";;;;AAIqB,IAAAA,IAAI,GAAiBC,MAAM,CAAAC,SAAA,CAAAF,IAAvB;EAAIG,QAAQ,GAAKF,MAAM,CAAAE,QAAX,CAAA;AASrC;IACaC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,EAA+D,EAAA;MAA7DC,QAAQ,GAAAD,EAAA,CAAAC,QAAA;IAAEC,SAAS,GAAAF,EAAA,CAAAE,SAAA;IAAEC,UAAU,GAAAH,EAAA,CAAAG,UAAA;IAAEC,SAAS,GAAAJ,EAAA,CAAAI,SAAA,CAAA;AAC3E;AACA;AACA,EAAA,IAAIF,SAAS,EAAE;AACb;AACA;AACA,IAAA,IAAIE,SAAS,EAAE;MACL,IAAAC,QAAQ,GAAKV,IAAI,CAACW,QAAQ,CAACC,MAAM,SAAzB,CAAA;AAChB,MAAA,OAAO,8BAAA,CAAAC,MAAA,CACeH,QAAQ,CAACI,eAAe,+BACnCJ,QAAQ,CAACK,SAAS,EAAA,WAAA,CAC5B,CAAA;AACH,KAAA;AAEM,IAAA,IAAAC,EAAiB,GAAAf,MAAM,CAACE,QAAQ,CAACc,KAA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AAI,CAAQ,SAAA,CAAA,CAACc,eAAe,EAAA,oBAAA,CAAA,CAAAD,MAAA,CACvCb,IAAI,CAAA,SAAA,CAAQ,CAACe,SAAS,EAAA,8DAAA,CAAA,CAAAF,MAAA,CAGTJ,SAAS,GAAGT,IAAI,CAACU,QAAQ,CAACI,eAAe,GAAIN,UAAU,GAAGR,IAAI,CAACwB,KAAK,CAACV,eAAe,GAAGd,IAAI,CAAQ,SAAA,CAAA,CAACc,eAAgB,EAAA,0EAAA,CAAA,CAAAD,MAAA,CAIpHJ,SAAS,GAAGT,IAAI,CAACU,QAAQ,CAACI,eAAe,GAAIN,UAAU,GAAGR,IAAI,CAACyB,MAAM,CAACX,eAAe,GAAGd,IAAI,CAAA,SAAA,CAAQ,CAACc,eAAgB,EAGzI,kCAAA,CAAA,CAAAD,MAAA,CAAAJ,SAAS,GAAG,wCACQT,IAAI,CAACU,QAAQ,CAACI,eAAe,EAAA,sBAAA,CAAA,CAAAD,MAAA,CACxCb,IAAI,CAACU,QAAQ,CAACK,SAAS,EAAA,aAAA,CACjC,GAAG,EAAE,EAAA,UAAA,CACP,CAAA;AACL,GAAA;AACF,EAAC;AAED;AACA;AACA;IACaY,UAAU,GAAG,YAChB,CAAAd,MAAA,CAAAb,IAAI,CAAC4B,KAAK,CAACC,MAAM,CAACC,IAAI,EAChB,mBAAA,CAAA,CAAAjB,MAAA,CAAAV,QAAQ,CAAC4B,IAAI,CAACC,KAAK,CAACH,MAAM,EAC3B,kBAAA,CAAA,CAAAhB,MAAA,CAAAV,QAAQ,CAAC8B,KAAK,CAACC,KAAK,CAACC,EAAE;;;;"}
1
+ {"version":3,"file":"utils.mjs","sources":["../../../../../src/components/atoms/Chip/shared/utils.ts"],"sourcesContent":["import tokens from '../../../../lib/cssTokens'\nimport { forcedColors } from '../../../../lib/styleUtils'\nimport { ChipSurface } from './types'\n\nconst { component: { chip }, semantic } = tokens\n\ninterface StyledChipProps {\n $surface: ChipSurface\n $disabled?: boolean\n $clickable?: boolean\n $selected?: boolean\n}\n\n// The chip's fill and text for its surface and state, matching Button's approach\nexport const getVariantStyles = ({ $surface, $selected, $clickable, $disabled }: StyledChipProps) => {\n // Selected filter and input chips use the light-blue selected treatment (decision 0016).\n // The text darkens with the fill so every state stays at least 4.5:1.\n if ($selected) {\n // A selected disabled chip looks like any disabled chip; the checkmark keeps the\n // selected state visible (#110)\n if ($disabled) {\n const { disabled } = chip.variants.subtle\n return `\n background-color: ${disabled.backgroundColor};\n color: ${disabled.textColor};\n `\n }\n\n const { fill, text } = tokens.semantic.color\n const interactiveStates = $clickable\n return `\n background-color: ${fill['accent-muted']};\n color: ${text.accent};\n \n &:hover {\n background-color: ${interactiveStates ? fill['accent-muted-hover'] : fill['accent-muted']};\n color: ${interactiveStates ? text.accent : text.accent};\n }\n \n &:active {\n background-color: ${interactiveStates ? fill['accent-muted-pressed'] : fill['accent-muted']};\n color: ${interactiveStates ? text.accent : text.accent};\n }\n\n /* Forced colours drop the fill, so a selected chip takes the system selection colours\n (decision 0038); its checkmark follows the text colour */\n ${forcedColors} {\n forced-color-adjust: none;\n background-color: Highlight;\n border-color: Highlight;\n color: HighlightText;\n }\n `\n }\n \n switch ($surface) {\n case 'subtle':\n return `\n background-color: ${chip.variants.subtle.backgroundColor};\n color: ${chip.variants.subtle.textColor};\n \n &:hover {\n background-color: ${$disabled ? chip.variants.subtle.disabled.backgroundColor : ($clickable ? chip.variants.subtle.hover.backgroundColor : chip.variants.subtle.backgroundColor)};\n }\n \n &:active {\n background-color: ${$disabled ? chip.variants.subtle.disabled.backgroundColor : ($clickable ? chip.variants.subtle.active.backgroundColor : chip.variants.subtle.backgroundColor)};\n }\n \n ${$disabled ? `\n background-color: ${chip.variants.subtle.disabled.backgroundColor};\n color: ${chip.variants.subtle.disabled.textColor};\n ` : ''}\n `\n case 'default':\n default:\n return `\n background-color: ${chip.default.backgroundColor};\n color: ${chip.default.textColor};\n \n ${$disabled ? `\n background-color: ${chip.disabled.backgroundColor};\n color: ${chip.disabled.textColor};\n ` : ''}\n `\n }\n}\n\n// Chips have one size: 24px from the label scale as a minimum, with the content centred\n// and no vertical padding (decisions 0034 and 0035). Horizontal padding comes from the\n// semantic spacing scale (decision 0022).\nexport const sizeStyles = `\n font: ${chip.sizes.medium.font};\n min-height: ${semantic.size.label.medium};\n padding: 0 ${semantic.space.inset.sm};\n`\n\n"],"names":["chip","tokens","component","semantic","getVariantStyles","_a","$surface","$selected","$clickable","$disabled","disabled","variants","subtle","concat","backgroundColor","textColor","_b","color","fill","text","interactiveStates","accent","forcedColors","hover","active","sizeStyles","sizes","medium","font","size","label","space","inset","sm"],"mappings":";;;;AAIqB,IAAAA,IAAI,GAAiBC,MAAM,CAAAC,SAAA,CAAAF,IAAvB;EAAIG,QAAQ,GAAKF,MAAM,CAAAE,QAAX,CAAA;AASrC;IACaC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,EAA+D,EAAA;MAA7DC,QAAQ,GAAAD,EAAA,CAAAC,QAAA;IAAEC,SAAS,GAAAF,EAAA,CAAAE,SAAA;IAAEC,UAAU,GAAAH,EAAA,CAAAG,UAAA;IAAEC,SAAS,GAAAJ,EAAA,CAAAI,SAAA,CAAA;AAC3E;AACA;AACA,EAAA,IAAIF,SAAS,EAAE;AACb;AACA;AACA,IAAA,IAAIE,SAAS,EAAE;MACL,IAAAC,QAAQ,GAAKV,IAAI,CAACW,QAAQ,CAACC,MAAM,SAAzB,CAAA;AAChB,MAAA,OAAO,8BAAA,CAAAC,MAAA,CACeH,QAAQ,CAACI,eAAe,+BACnCJ,QAAQ,CAACK,SAAS,EAAA,WAAA,CAC5B,CAAA;AACH,KAAA;AAEM,IAAA,IAAAC,EAAiB,GAAAf,MAAM,CAACE,QAAQ,CAACc,KAAK;MAApCC,IAAI,GAAAF,EAAA,CAAAE,IAAA;MAAEC,IAAI,GAAAH,EAAA,CAAAG,IAA0B,CAAA;IAC5C,IAAMC,iBAAiB,GAAGZ,UAAU,CAAA;AACpC,IAAA,OA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,IAAI,CAACW,QAAQ,CAACC,MAAM,CAACE,eAAgB,EAAA,kCAAA,CAAA,CAAAD,MAAA,CAGjLJ,SAAS,GAAG,gCACQ,CAAAI,MAAA,CAAAb,IAAI,CAACW,QAAQ,CAACC,MAAM,CAACF,QAAQ,CAACI,eAAe,EAAA,sBAAA,CAAA,CAAAD,MAAA,CACxDb,IAAI,CAACW,QAAQ,CAACC,MAAM,CAACF,QAAQ,CAACK,SAAS,EAAA,aAAA,CACjD,GAAG,EAAE,aACP,CAAA;AACH,IAAA,KAAK,SAAS,CAAA;AACd,IAAA;MACE,OAAO,8BACe,CAAAF,MAAA,CAAAb,IAAI,WAAQ,CAACc,eAAe,EAAA,oBAAA,CAAA,CAAAD,MAAA,CACvCb,IAAI,CAAQ,SAAA,CAAA,CAACe,SAAS,EAE7B,uBAAA,CAAA,CAAAF,MAAA,CAAAJ,SAAS,GAAG,gCACQ,CAAAI,MAAA,CAAAb,IAAI,CAACU,QAAQ,CAACI,eAAe,EAAA,sBAAA,CAAA,CAAAD,MAAA,CACxCb,IAAI,CAACU,QAAQ,CAACK,SAAS,gBACjC,GAAG,EAAE,aACP,CAAA;AACL,GAAA;AACF,EAAC;AAED;AACA;AACA;IACaU,UAAU,GAAG,YAChB,CAAAZ,MAAA,CAAAb,IAAI,CAAC0B,KAAK,CAACC,MAAM,CAACC,IAAI,EAChB,mBAAA,CAAA,CAAAf,MAAA,CAAAV,QAAQ,CAAC0B,IAAI,CAACC,KAAK,CAACH,MAAM,EAC3B,kBAAA,CAAA,CAAAd,MAAA,CAAAV,QAAQ,CAAC4B,KAAK,CAACC,KAAK,CAACC,EAAE;;;;"}
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
2
  /**
3
- * How DateFormatter shows a date. `'relative'` is deprecated: it has always behaved exactly like
4
- * `'smart'`, so use `'smart'`. It keeps working until it is removed in 3.0 (#82).
3
+ * How DateFormatter shows a date. `'relative'`, an alias of `'smart'`, was removed in 3.0 (#82).
5
4
  */
6
- export type DateFormatMode = 'absolute' | 'relative' | 'smart';
5
+ export type DateFormatMode = 'absolute' | 'smart';
7
6
  export interface DateFormatterProps {
8
7
  /** ISO date string to format */
9
8
  dateString: string;
@@ -12,8 +11,6 @@ export interface DateFormatterProps {
12
11
  /**
13
12
  * `'absolute'` always uses `formatString`. `'smart'` shows "Today", "Yesterday" or the day name
14
13
  * for dates this week, and formats older dates with `formatString`.
15
- * `'relative'` is deprecated: it behaves exactly like `'smart'`, so use `'smart'`. It keeps
16
- * working until it is removed in 3.0 (#82).
17
14
  * @default 'absolute'
18
15
  */
19
16
  mode?: DateFormatMode;