@j2-health/design-system 0.5.4 → 0.6.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 (140) hide show
  1. package/dist/index.cjs +15 -1
  2. package/dist/index.d.ts +7 -0
  3. package/dist/index.js +9 -2
  4. package/dist/index2.js +9 -2
  5. package/dist/src/components/alert/Alert.cjs +4 -2
  6. package/dist/src/components/alert/Alert.cjs.map +1 -1
  7. package/dist/src/components/alert/Alert.d.ts +2 -2
  8. package/dist/src/components/alert/Alert.js +3 -2
  9. package/dist/src/components/alert/Alert.js.map +1 -1
  10. package/dist/src/components/button/Button.cjs +7 -2
  11. package/dist/src/components/button/Button.cjs.map +1 -1
  12. package/dist/src/components/button/Button.d.ts +10 -2
  13. package/dist/src/components/button/Button.js +5 -2
  14. package/dist/src/components/button/Button.js.map +1 -1
  15. package/dist/src/components/card/Card.cjs +16 -2
  16. package/dist/src/components/card/Card.cjs.map +1 -1
  17. package/dist/src/components/card/Card.d.ts +7 -1
  18. package/dist/src/components/card/Card.js +16 -2
  19. package/dist/src/components/card/Card.js.map +1 -1
  20. package/dist/src/components/changeChip/ChangeChip.cjs +52 -0
  21. package/dist/src/components/changeChip/ChangeChip.cjs.map +1 -0
  22. package/dist/src/components/changeChip/ChangeChip.d.ts +40 -0
  23. package/dist/src/components/changeChip/ChangeChip.js +49 -0
  24. package/dist/src/components/changeChip/ChangeChip.js.map +1 -0
  25. package/dist/src/components/changeChip/index.d.ts +1 -0
  26. package/dist/src/components/collapse/Collapse.cjs +9 -2
  27. package/dist/src/components/collapse/Collapse.cjs.map +1 -1
  28. package/dist/src/components/collapse/Collapse.d.ts +7 -1
  29. package/dist/src/components/collapse/Collapse.js +9 -2
  30. package/dist/src/components/collapse/Collapse.js.map +1 -1
  31. package/dist/src/components/collapse/Collapse.module.css.cjs +7 -4
  32. package/dist/src/components/collapse/Collapse.module.css.cjs.map +1 -1
  33. package/dist/src/components/collapse/Collapse.module.css.js +7 -5
  34. package/dist/src/components/collapse/Collapse.module.css.js.map +1 -1
  35. package/dist/src/components/dropdown/Dropdown.cjs +6 -1
  36. package/dist/src/components/dropdown/Dropdown.cjs.map +1 -1
  37. package/dist/src/components/dropdown/Dropdown.d.ts +8 -1
  38. package/dist/src/components/dropdown/Dropdown.js +6 -1
  39. package/dist/src/components/dropdown/Dropdown.js.map +1 -1
  40. package/dist/src/components/emptyState/EmptyState.cjs +39 -0
  41. package/dist/src/components/emptyState/EmptyState.cjs.map +1 -0
  42. package/dist/src/components/emptyState/EmptyState.d.ts +20 -0
  43. package/dist/src/components/emptyState/EmptyState.js +37 -0
  44. package/dist/src/components/emptyState/EmptyState.js.map +1 -0
  45. package/dist/src/components/emptyState/index.d.ts +1 -0
  46. package/dist/src/components/input/AntdInput.d.ts +1 -1
  47. package/dist/src/components/input/AntdSearchInput.d.ts +1 -1
  48. package/dist/src/components/listRow/ListRow.cjs +65 -0
  49. package/dist/src/components/listRow/ListRow.cjs.map +1 -0
  50. package/dist/src/components/listRow/ListRow.d.ts +41 -0
  51. package/dist/src/components/listRow/ListRow.js +63 -0
  52. package/dist/src/components/listRow/ListRow.js.map +1 -0
  53. package/dist/src/components/listRow/index.d.ts +1 -0
  54. package/dist/src/components/modal/Modal.cjs +9 -3
  55. package/dist/src/components/modal/Modal.cjs.map +1 -1
  56. package/dist/src/components/modal/Modal.d.ts +3 -1
  57. package/dist/src/components/modal/Modal.js +10 -4
  58. package/dist/src/components/modal/Modal.js.map +1 -1
  59. package/dist/src/components/navMenu/NavMenu.cjs +2 -2
  60. package/dist/src/components/navMenu/NavMenu.cjs.map +1 -1
  61. package/dist/src/components/navMenu/NavMenu.d.ts +3 -1
  62. package/dist/src/components/navMenu/NavMenu.js +2 -2
  63. package/dist/src/components/navMenu/NavMenu.js.map +1 -1
  64. package/dist/src/components/popover/Popover.cjs.map +1 -1
  65. package/dist/src/components/popover/Popover.d.ts +1 -1
  66. package/dist/src/components/popover/Popover.js.map +1 -1
  67. package/dist/src/components/popover/Popover.module.css.cjs +12 -9
  68. package/dist/src/components/popover/Popover.module.css.cjs.map +1 -1
  69. package/dist/src/components/popover/Popover.module.css.js +12 -10
  70. package/dist/src/components/popover/Popover.module.css.js.map +1 -1
  71. package/dist/src/components/select/SummarizedSelect.cjs +16 -12
  72. package/dist/src/components/select/SummarizedSelect.cjs.map +1 -1
  73. package/dist/src/components/select/SummarizedSelect.d.ts +15 -3
  74. package/dist/src/components/select/SummarizedSelect.js +16 -12
  75. package/dist/src/components/select/SummarizedSelect.js.map +1 -1
  76. package/dist/src/components/select/SummarizedSelect.module.css.cjs +15 -9
  77. package/dist/src/components/select/SummarizedSelect.module.css.cjs.map +1 -1
  78. package/dist/src/components/select/SummarizedSelect.module.css.js +14 -10
  79. package/dist/src/components/select/SummarizedSelect.module.css.js.map +1 -1
  80. package/dist/src/components/statusPill/StatusPill.cjs +47 -0
  81. package/dist/src/components/statusPill/StatusPill.cjs.map +1 -0
  82. package/dist/src/components/statusPill/StatusPill.d.ts +28 -0
  83. package/dist/src/components/statusPill/StatusPill.js +45 -0
  84. package/dist/src/components/statusPill/StatusPill.js.map +1 -0
  85. package/dist/src/components/statusPill/StatusPill.module.css.cjs +20 -0
  86. package/dist/src/components/statusPill/StatusPill.module.css.cjs.map +1 -0
  87. package/dist/src/components/statusPill/StatusPill.module.css.js +16 -0
  88. package/dist/src/components/statusPill/StatusPill.module.css.js.map +1 -0
  89. package/dist/src/components/statusPill/index.d.ts +1 -0
  90. package/dist/src/components/swatch/Swatch.cjs +50 -0
  91. package/dist/src/components/swatch/Swatch.cjs.map +1 -0
  92. package/dist/src/components/swatch/Swatch.d.ts +24 -0
  93. package/dist/src/components/swatch/Swatch.js +48 -0
  94. package/dist/src/components/swatch/Swatch.js.map +1 -0
  95. package/dist/src/components/swatch/index.d.ts +1 -0
  96. package/dist/src/components/swatchStrip/SwatchStrip.cjs +50 -0
  97. package/dist/src/components/swatchStrip/SwatchStrip.cjs.map +1 -0
  98. package/dist/src/components/swatchStrip/SwatchStrip.d.ts +25 -0
  99. package/dist/src/components/swatchStrip/SwatchStrip.js +50 -0
  100. package/dist/src/components/swatchStrip/SwatchStrip.js.map +1 -0
  101. package/dist/src/components/swatchStrip/index.d.ts +1 -0
  102. package/dist/src/components/switch/Switch.cjs +7 -3
  103. package/dist/src/components/switch/Switch.cjs.map +1 -1
  104. package/dist/src/components/switch/Switch.d.ts +1 -1
  105. package/dist/src/components/switch/Switch.js +5 -3
  106. package/dist/src/components/switch/Switch.js.map +1 -1
  107. package/dist/src/components/tabs/Tabs.cjs +6 -1
  108. package/dist/src/components/tabs/Tabs.cjs.map +1 -1
  109. package/dist/src/components/tabs/Tabs.d.ts +10 -2
  110. package/dist/src/components/tabs/Tabs.js +4 -1
  111. package/dist/src/components/tabs/Tabs.js.map +1 -1
  112. package/dist/src/components/tabs/Tabs.module.css.cjs +13 -0
  113. package/dist/src/components/tabs/Tabs.module.css.cjs.map +1 -0
  114. package/dist/src/components/tabs/Tabs.module.css.js +11 -0
  115. package/dist/src/components/tabs/Tabs.module.css.js.map +1 -0
  116. package/dist/src/components/tag/Tag.cjs +13 -6
  117. package/dist/src/components/tag/Tag.cjs.map +1 -1
  118. package/dist/src/components/tag/Tag.d.ts +13 -2
  119. package/dist/src/components/tag/Tag.js +13 -6
  120. package/dist/src/components/tag/Tag.js.map +1 -1
  121. package/dist/src/components/thresholdBar/ThresholdBar.cjs +128 -0
  122. package/dist/src/components/thresholdBar/ThresholdBar.cjs.map +1 -0
  123. package/dist/src/components/thresholdBar/ThresholdBar.d.ts +36 -0
  124. package/dist/src/components/thresholdBar/ThresholdBar.js +125 -0
  125. package/dist/src/components/thresholdBar/ThresholdBar.js.map +1 -0
  126. package/dist/src/components/thresholdBar/ThresholdBar.module.css.cjs +19 -0
  127. package/dist/src/components/thresholdBar/ThresholdBar.module.css.cjs.map +1 -0
  128. package/dist/src/components/thresholdBar/ThresholdBar.module.css.js +15 -0
  129. package/dist/src/components/thresholdBar/ThresholdBar.module.css.js.map +1 -0
  130. package/dist/src/components/thresholdBar/index.d.ts +1 -0
  131. package/dist/src/index.d.ts +0 -13
  132. package/dist/style.css +346 -41
  133. package/dist/tailwind.cjs +56 -0
  134. package/dist/tailwind.cjs.map +1 -1
  135. package/dist/tailwind.config.d.ts +112 -0
  136. package/dist/tailwind.js +56 -0
  137. package/dist/tailwind.js.map +1 -1
  138. package/package.json +2 -2
  139. package/src/stylesheets/Colors.stories.tsx +163 -0
  140. package/src/stylesheets/base.css +110 -0
@@ -0,0 +1,40 @@
1
+ import { SwatchProps } from '../swatch/index.js';
2
+ export type ChangeChipProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> & {
3
+ /** A leading swatch, e.g. the kind of change. */
4
+ swatch?: Omit<SwatchProps, 'size'>;
5
+ /** What changed, e.g. an area's name. */
6
+ label?: React.ReactNode;
7
+ /** How much it changed. */
8
+ delta?: {
9
+ direction: 'up' | 'down';
10
+ value: React.ReactNode;
11
+ /** Text color for the arrow and value. Defaults to the primary color. */
12
+ color?: string;
13
+ };
14
+ /** Trailing text when there is no delta to show, e.g. an em dash. */
15
+ placeholder?: React.ReactNode;
16
+ /** A full description for assistive tech, when the visible text is terse. */
17
+ srLabel?: string;
18
+ };
19
+ /**
20
+ * A compact chip for one change: an optional swatch, a label and a delta.
21
+ * It is a button, so it can open a popover with the details; wrap it in a
22
+ * `Popover` (it forwards its ref and handlers).
23
+ */
24
+ export declare const ChangeChip: import('react').ForwardRefExoticComponent<Omit<import('react').ButtonHTMLAttributes<HTMLButtonElement>, "type"> & {
25
+ /** A leading swatch, e.g. the kind of change. */
26
+ swatch?: Omit<SwatchProps, "size">;
27
+ /** What changed, e.g. an area's name. */
28
+ label?: React.ReactNode;
29
+ /** How much it changed. */
30
+ delta?: {
31
+ direction: "up" | "down";
32
+ value: React.ReactNode;
33
+ /** Text color for the arrow and value. Defaults to the primary color. */
34
+ color?: string;
35
+ };
36
+ /** Trailing text when there is no delta to show, e.g. an em dash. */
37
+ placeholder?: React.ReactNode;
38
+ /** A full description for assistive tech, when the visible text is terse. */
39
+ srLabel?: string;
40
+ } & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,49 @@
1
+ import { Swatch } from "../swatch/Swatch.js";
2
+ import { forwardRef } from "react";
3
+ import { ArrowDownIcon, ArrowUpIcon } from "@phosphor-icons/react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import cx from "classnames";
6
+ //#region src/components/changeChip/ChangeChip.tsx
7
+ /**
8
+ * A compact chip for one change: an optional swatch, a label and a delta.
9
+ * It is a button, so it can open a popover with the details; wrap it in a
10
+ * `Popover` (it forwards its ref and handlers).
11
+ */
12
+ var ChangeChip = forwardRef(({ swatch, label, delta, placeholder, srLabel, className, ...props }, ref) => {
13
+ const Arrow = delta?.direction === "down" ? ArrowDownIcon : ArrowUpIcon;
14
+ return /* @__PURE__ */ jsxs("button", {
15
+ ...props,
16
+ ref,
17
+ type: "button",
18
+ className: cx("inline-flex cursor-pointer items-center gap-1 whitespace-nowrap rounded-j2-sm border border-j2-border bg-[var(--j2-color-fill-quaternary)] px-2 py-px text-xs text-j2-text transition-colors hover:bg-j2-gray-2", className),
19
+ children: [
20
+ swatch && /* @__PURE__ */ jsx(Swatch, {
21
+ ...swatch,
22
+ size: 12
23
+ }),
24
+ label && /* @__PURE__ */ jsx("span", { children: label }),
25
+ delta && /* @__PURE__ */ jsxs("span", {
26
+ className: "inline-flex items-center gap-0.5 font-medium",
27
+ style: { color: delta.color ?? "var(--j2-color-primary)" },
28
+ children: [/* @__PURE__ */ jsx(Arrow, {
29
+ size: 11,
30
+ weight: "bold",
31
+ "aria-hidden": true
32
+ }), delta.value]
33
+ }),
34
+ !delta && placeholder && /* @__PURE__ */ jsx("span", {
35
+ className: "text-j2-text-secondary",
36
+ children: placeholder
37
+ }),
38
+ srLabel && /* @__PURE__ */ jsx("span", {
39
+ className: "sr-only",
40
+ children: srLabel
41
+ })
42
+ ]
43
+ });
44
+ });
45
+ ChangeChip.displayName = "ChangeChip";
46
+ //#endregion
47
+ export { ChangeChip };
48
+
49
+ //# sourceMappingURL=ChangeChip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeChip.js","names":[],"sources":["../../../../src/components/changeChip/ChangeChip.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport cx from 'classnames'\nimport { ArrowDownIcon, ArrowUpIcon } from '@phosphor-icons/react'\n\nimport { Swatch, type SwatchProps } from '../swatch'\n\nexport type ChangeChipProps = Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'type'\n> & {\n /** A leading swatch, e.g. the kind of change. */\n swatch?: Omit<SwatchProps, 'size'>\n /** What changed, e.g. an area's name. */\n label?: React.ReactNode\n /** How much it changed. */\n delta?: {\n direction: 'up' | 'down'\n value: React.ReactNode\n /** Text color for the arrow and value. Defaults to the primary color. */\n color?: string\n }\n /** Trailing text when there is no delta to show, e.g. an em dash. */\n placeholder?: React.ReactNode\n /** A full description for assistive tech, when the visible text is terse. */\n srLabel?: string\n}\n\n/**\n * A compact chip for one change: an optional swatch, a label and a delta.\n * It is a button, so it can open a popover with the details; wrap it in a\n * `Popover` (it forwards its ref and handlers).\n */\nexport const ChangeChip = forwardRef<HTMLButtonElement, ChangeChipProps>(\n (\n { swatch, label, delta, placeholder, srLabel, className, ...props },\n ref\n ) => {\n const Arrow = delta?.direction === 'down' ? ArrowDownIcon : ArrowUpIcon\n return (\n <button\n {...props}\n ref={ref}\n type=\"button\"\n className={cx(\n 'inline-flex cursor-pointer items-center gap-1 whitespace-nowrap rounded-j2-sm border border-j2-border bg-[var(--j2-color-fill-quaternary)] px-2 py-px text-xs text-j2-text transition-colors hover:bg-j2-gray-2',\n className\n )}\n >\n {swatch && <Swatch {...swatch} size={12} />}\n {label && <span>{label}</span>}\n {delta && (\n <span\n className=\"inline-flex items-center gap-0.5 font-medium\"\n style={{ color: delta.color ?? 'var(--j2-color-primary)' }}\n >\n <Arrow size={11} weight=\"bold\" aria-hidden />\n {delta.value}\n </span>\n )}\n {!delta && placeholder && (\n <span className=\"text-j2-text-secondary\">{placeholder}</span>\n )}\n {srLabel && <span className=\"sr-only\">{srLabel}</span>}\n </button>\n )\n }\n)\nChangeChip.displayName = 'ChangeChip'\n"],"mappings":";;;;;;;;;;;AAgCA,IAAa,aAAa,YAEtB,EAAE,QAAQ,OAAO,OAAO,aAAa,SAAS,WAAW,GAAG,SAC5D,QACG;CACH,MAAM,QAAQ,OAAO,cAAc,SAAS,gBAAgB;CAC5D,OACE,qBAAC,UAAD;EACE,GAAI;EACC;EACL,MAAK;EACL,WAAW,GACT,mNACA,SACF;EAPF,UAAA;GASG,UAAU,oBAAC,QAAD;IAAQ,GAAI;IAAQ,MAAM;GAAK,CAAA;GACzC,SAAS,oBAAC,QAAD,EAAA,UAAO,MAAY,CAAA;GAC5B,SACC,qBAAC,QAAD;IACE,WAAU;IACV,OAAO,EAAE,OAAO,MAAM,SAAS,0BAA0B;IAF3D,UAAA,CAIE,oBAAC,OAAD;KAAO,MAAM;KAAI,QAAO;KAAO,eAAA;IAAa,CAAA,GAC3C,MAAM,KACH;;GAEP,CAAC,SAAS,eACT,oBAAC,QAAD;IAAM,WAAU;IAA0B,UAAA;GAAkB,CAAA;GAE7D,WAAW,oBAAC,QAAD;IAAM,WAAU;IAAW,UAAA;GAAc,CAAA;EAC/C;;AAEZ,CACF;AACA,WAAW,cAAc"}
@@ -0,0 +1 @@
1
+ export { ChangeChip, type ChangeChipProps } from './ChangeChip.js';
@@ -25,7 +25,8 @@ var stateConfig = {
25
25
  color: "var(--j2-color-error-text)"
26
26
  }
27
27
  };
28
- var Collapse = ({ state = "default", showIcon = false, className, items, ...props }) => {
28
+ var Collapse = ({ state = "default", showIcon = false, variant = "default", className, items, ...props }) => {
29
+ const isSection = variant === "section";
29
30
  const { className: stateClass, Icon, color } = stateConfig[state];
30
31
  const icon = react$1.useMemo(() => {
31
32
  if (!showIcon) return null;
@@ -43,9 +44,15 @@ var Collapse = ({ state = "default", showIcon = false, className, items, ...prop
43
44
  }));
44
45
  }, [items, icon]);
45
46
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Collapse, {
47
+ ghost: isSection || void 0,
48
+ expandIconPlacement: isSection ? "end" : void 0,
46
49
  ...props,
47
50
  items: itemsWithIcon,
48
- className: [stateClass, className].filter(Boolean).join(" "),
51
+ className: [
52
+ stateClass,
53
+ isSection && require_Collapse_module.default.section,
54
+ className
55
+ ].filter(Boolean).join(" "),
49
56
  expandIcon: ({ isActive }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_phosphor_icons_react.CaretDownIcon, {
50
57
  size: 14,
51
58
  style: { transform: `rotate(${isActive ? 0 : -90}deg)` }
@@ -1 +1 @@
1
- {"version":3,"file":"Collapse.cjs","names":["styles","InfoIcon","WarningCircleIcon","XCircleIcon","React","_Fragment","AntdCollapse","CaretDownIcon"],"sources":["../../../../src/components/collapse/Collapse.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Collapse as AntdCollapse, CollapseProps } from 'antd'\nimport {\n CaretDownIcon,\n InfoIcon,\n WarningCircleIcon,\n XCircleIcon,\n} from '@phosphor-icons/react'\nimport styles from './Collapse.module.css'\n\nexport type CollapseState = 'default' | 'warning' | 'error'\n\nexport type Props = Expand<CollapseProps> & {\n state?: CollapseState\n showIcon?: boolean\n}\n\nconst stateConfig: Record<\n CollapseState,\n { className: string; Icon: React.ElementType; color: string }\n> = {\n default: {\n className: styles.default,\n Icon: InfoIcon,\n color: 'var(--j2-color-text)',\n },\n warning: {\n className: styles.warning,\n Icon: WarningCircleIcon,\n color: 'var(--j2-color-warning-text)',\n },\n error: {\n className: styles.error,\n Icon: XCircleIcon,\n color: 'var(--j2-color-error-text)',\n },\n}\n\nconst Collapse = ({\n state = 'default',\n showIcon = false,\n className,\n items,\n ...props\n}: Props) => {\n const { className: stateClass, Icon, color } = stateConfig[state]\n\n const icon = React.useMemo(() => {\n if (!showIcon) return null\n return <Icon size={14} fill={color} style={{ flexShrink: 0 }} />\n }, [state, showIcon])\n\n const itemsWithIcon = React.useMemo(() => {\n if (!icon || !items) return items\n return (items as NonNullable<CollapseProps['items']>).map((item) => ({\n ...item,\n label: (\n <>\n {icon}\n {item.label}\n </>\n ),\n }))\n }, [items, icon])\n\n return (\n <AntdCollapse\n {...props}\n items={itemsWithIcon}\n className={[stateClass, className].filter(Boolean).join(' ')}\n expandIcon={({ isActive }) => (\n <CaretDownIcon\n size={14}\n style={{ transform: `rotate(${isActive ? 0 : -90}deg)` }}\n />\n )}\n />\n )\n}\n\nexport { Collapse }\n"],"mappings":";;;;;;;;;;AAiBA,IAAM,cAGF;CACF,SAAS;EACP,WAAWA,wBAAAA,QAAO;EAClB,MAAMC,sBAAAA;EACN,OAAO;CACT;CACA,SAAS;EACP,WAAWD,wBAAAA,QAAO;EAClB,MAAME,sBAAAA;EACN,OAAO;CACT;CACA,OAAO;EACL,WAAWF,wBAAAA,QAAO;EAClB,MAAMG,sBAAAA;EACN,OAAO;CACT;AACF;AAEA,IAAM,YAAY,EAChB,QAAQ,WACR,WAAW,OACX,WACA,OACA,GAAG,YACQ;CACX,MAAM,EAAE,WAAW,YAAY,MAAM,UAAU,YAAY;CAE3D,MAAM,OAAOC,QAAM,cAAc;EAC/B,IAAI,CAAC,UAAU,OAAO;EACtB,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;GAAM,MAAM;GAAI,MAAM;GAAO,OAAO,EAAE,YAAY,EAAE;EAAI,CAAA;CACjE,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgBA,QAAM,cAAc;EACxC,IAAI,CAAC,QAAQ,CAAC,OAAO,OAAO;EAC5B,OAAQ,MAA8C,KAAK,UAAU;GACnE,GAAG;GACH,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA,CACG,MACA,KAAK,KACN,EAAA,CAAA;EAEN,EAAE;CACJ,GAAG,CAAC,OAAO,IAAI,CAAC;CAEhB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,KAAAA,UAAD;EACE,GAAI;EACJ,OAAO;EACP,WAAW,CAAC,YAAY,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC3D,aAAa,EAAE,eACb,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,eAAD;GACE,MAAM;GACN,OAAO,EAAE,WAAW,UAAU,WAAW,IAAI,IAAI,MAAM;EACxD,CAAA;CAEJ,CAAA;AAEL"}
1
+ {"version":3,"file":"Collapse.cjs","names":["styles","InfoIcon","WarningCircleIcon","XCircleIcon","React","_Fragment","AntdCollapse","CaretDownIcon"],"sources":["../../../../src/components/collapse/Collapse.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Collapse as AntdCollapse, CollapseProps } from 'antd'\nimport {\n CaretDownIcon,\n InfoIcon,\n WarningCircleIcon,\n XCircleIcon,\n} from '@phosphor-icons/react'\nimport styles from './Collapse.module.css'\n\nexport type CollapseState = 'default' | 'warning' | 'error'\n\nexport type Props = Expand<CollapseProps> & {\n state?: CollapseState\n showIcon?: boolean\n /**\n * `'section'`: stacked section headers for grouping content inside a\n * panel. A compact gray header band with a caption label and the caret at\n * the end, and a flush body so the content draws its own edges.\n */\n variant?: 'default' | 'section'\n}\n\nconst stateConfig: Record<\n CollapseState,\n { className: string; Icon: React.ElementType; color: string }\n> = {\n default: {\n className: styles.default,\n Icon: InfoIcon,\n color: 'var(--j2-color-text)',\n },\n warning: {\n className: styles.warning,\n Icon: WarningCircleIcon,\n color: 'var(--j2-color-warning-text)',\n },\n error: {\n className: styles.error,\n Icon: XCircleIcon,\n color: 'var(--j2-color-error-text)',\n },\n}\n\nconst Collapse = ({\n state = 'default',\n showIcon = false,\n variant = 'default',\n className,\n items,\n ...props\n}: Props) => {\n const isSection = variant === 'section'\n const { className: stateClass, Icon, color } = stateConfig[state]\n\n const icon = React.useMemo(() => {\n if (!showIcon) return null\n return <Icon size={14} fill={color} style={{ flexShrink: 0 }} />\n }, [state, showIcon])\n\n const itemsWithIcon = React.useMemo(() => {\n if (!icon || !items) return items\n return (items as NonNullable<CollapseProps['items']>).map((item) => ({\n ...item,\n label: (\n <>\n {icon}\n {item.label}\n </>\n ),\n }))\n }, [items, icon])\n\n return (\n <AntdCollapse\n ghost={isSection || undefined}\n expandIconPlacement={isSection ? 'end' : undefined}\n {...props}\n items={itemsWithIcon}\n className={[stateClass, isSection && styles.section, className]\n .filter(Boolean)\n .join(' ')}\n expandIcon={({ isActive }) => (\n <CaretDownIcon\n size={14}\n style={{ transform: `rotate(${isActive ? 0 : -90}deg)` }}\n />\n )}\n />\n )\n}\n\nexport { Collapse }\n"],"mappings":";;;;;;;;;;AAuBA,IAAM,cAGF;CACF,SAAS;EACP,WAAWA,wBAAAA,QAAO;EAClB,MAAMC,sBAAAA;EACN,OAAO;CACT;CACA,SAAS;EACP,WAAWD,wBAAAA,QAAO;EAClB,MAAME,sBAAAA;EACN,OAAO;CACT;CACA,OAAO;EACL,WAAWF,wBAAAA,QAAO;EAClB,MAAMG,sBAAAA;EACN,OAAO;CACT;AACF;AAEA,IAAM,YAAY,EAChB,QAAQ,WACR,WAAW,OACX,UAAU,WACV,WACA,OACA,GAAG,YACQ;CACX,MAAM,YAAY,YAAY;CAC9B,MAAM,EAAE,WAAW,YAAY,MAAM,UAAU,YAAY;CAE3D,MAAM,OAAOC,QAAM,cAAc;EAC/B,IAAI,CAAC,UAAU,OAAO;EACtB,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;GAAM,MAAM;GAAI,MAAM;GAAO,OAAO,EAAE,YAAY,EAAE;EAAI,CAAA;CACjE,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgBA,QAAM,cAAc;EACxC,IAAI,CAAC,QAAQ,CAAC,OAAO,OAAO;EAC5B,OAAQ,MAA8C,KAAK,UAAU;GACnE,GAAG;GACH,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA,CACG,MACA,KAAK,KACN,EAAA,CAAA;EAEN,EAAE;CACJ,GAAG,CAAC,OAAO,IAAI,CAAC;CAEhB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,KAAAA,UAAD;EACE,OAAO,aAAa,KAAA;EACpB,qBAAqB,YAAY,QAAQ,KAAA;EACzC,GAAI;EACJ,OAAO;EACP,WAAW;GAAC;GAAY,aAAaN,wBAAAA,QAAO;GAAS;EAAS,CAAC,CAC5D,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;EACX,aAAa,EAAE,eACb,iBAAA,GAAA,kBAAA,IAAA,CAACO,sBAAAA,eAAD;GACE,MAAM;GACN,OAAO,EAAE,WAAW,UAAU,WAAW,IAAI,IAAI,MAAM;EACxD,CAAA;CAEJ,CAAA;AAEL"}
@@ -4,6 +4,12 @@ export type CollapseState = 'default' | 'warning' | 'error';
4
4
  export type Props = Expand<CollapseProps> & {
5
5
  state?: CollapseState;
6
6
  showIcon?: boolean;
7
+ /**
8
+ * `'section'`: stacked section headers for grouping content inside a
9
+ * panel. A compact gray header band with a caption label and the caret at
10
+ * the end, and a flush body so the content draws its own edges.
11
+ */
12
+ variant?: 'default' | 'section';
7
13
  };
8
- declare const Collapse: ({ state, showIcon, className, items, ...props }: Props) => React.JSX.Element;
14
+ declare const Collapse: ({ state, showIcon, variant, className, items, ...props }: Props) => React.JSX.Element;
9
15
  export { Collapse };
@@ -21,7 +21,8 @@ var stateConfig = {
21
21
  color: "var(--j2-color-error-text)"
22
22
  }
23
23
  };
24
- var Collapse$1 = ({ state = "default", showIcon = false, className, items, ...props }) => {
24
+ var Collapse$1 = ({ state = "default", showIcon = false, variant = "default", className, items, ...props }) => {
25
+ const isSection = variant === "section";
25
26
  const { className: stateClass, Icon, color } = stateConfig[state];
26
27
  const icon = React.useMemo(() => {
27
28
  if (!showIcon) return null;
@@ -39,9 +40,15 @@ var Collapse$1 = ({ state = "default", showIcon = false, className, items, ...pr
39
40
  }));
40
41
  }, [items, icon]);
41
42
  return /* @__PURE__ */ jsx(Collapse, {
43
+ ghost: isSection || void 0,
44
+ expandIconPlacement: isSection ? "end" : void 0,
42
45
  ...props,
43
46
  items: itemsWithIcon,
44
- className: [stateClass, className].filter(Boolean).join(" "),
47
+ className: [
48
+ stateClass,
49
+ isSection && Collapse_module_default.section,
50
+ className
51
+ ].filter(Boolean).join(" "),
45
52
  expandIcon: ({ isActive }) => /* @__PURE__ */ jsx(CaretDownIcon, {
46
53
  size: 14,
47
54
  style: { transform: `rotate(${isActive ? 0 : -90}deg)` }
@@ -1 +1 @@
1
- {"version":3,"file":"Collapse.js","names":["styles","Collapse","_Fragment","AntdCollapse"],"sources":["../../../../src/components/collapse/Collapse.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Collapse as AntdCollapse, CollapseProps } from 'antd'\nimport {\n CaretDownIcon,\n InfoIcon,\n WarningCircleIcon,\n XCircleIcon,\n} from '@phosphor-icons/react'\nimport styles from './Collapse.module.css'\n\nexport type CollapseState = 'default' | 'warning' | 'error'\n\nexport type Props = Expand<CollapseProps> & {\n state?: CollapseState\n showIcon?: boolean\n}\n\nconst stateConfig: Record<\n CollapseState,\n { className: string; Icon: React.ElementType; color: string }\n> = {\n default: {\n className: styles.default,\n Icon: InfoIcon,\n color: 'var(--j2-color-text)',\n },\n warning: {\n className: styles.warning,\n Icon: WarningCircleIcon,\n color: 'var(--j2-color-warning-text)',\n },\n error: {\n className: styles.error,\n Icon: XCircleIcon,\n color: 'var(--j2-color-error-text)',\n },\n}\n\nconst Collapse = ({\n state = 'default',\n showIcon = false,\n className,\n items,\n ...props\n}: Props) => {\n const { className: stateClass, Icon, color } = stateConfig[state]\n\n const icon = React.useMemo(() => {\n if (!showIcon) return null\n return <Icon size={14} fill={color} style={{ flexShrink: 0 }} />\n }, [state, showIcon])\n\n const itemsWithIcon = React.useMemo(() => {\n if (!icon || !items) return items\n return (items as NonNullable<CollapseProps['items']>).map((item) => ({\n ...item,\n label: (\n <>\n {icon}\n {item.label}\n </>\n ),\n }))\n }, [items, icon])\n\n return (\n <AntdCollapse\n {...props}\n items={itemsWithIcon}\n className={[stateClass, className].filter(Boolean).join(' ')}\n expandIcon={({ isActive }) => (\n <CaretDownIcon\n size={14}\n style={{ transform: `rotate(${isActive ? 0 : -90}deg)` }}\n />\n )}\n />\n )\n}\n\nexport { Collapse }\n"],"mappings":";;;;;;AAiBA,IAAM,cAGF;CACF,SAAS;EACP,WAAWA,wBAAO;EAClB,MAAM;EACN,OAAO;CACT;CACA,SAAS;EACP,WAAWA,wBAAO;EAClB,MAAM;EACN,OAAO;CACT;CACA,OAAO;EACL,WAAWA,wBAAO;EAClB,MAAM;EACN,OAAO;CACT;AACF;AAEA,IAAMC,cAAY,EAChB,QAAQ,WACR,WAAW,OACX,WACA,OACA,GAAG,YACQ;CACX,MAAM,EAAE,WAAW,YAAY,MAAM,UAAU,YAAY;CAE3D,MAAM,OAAO,MAAM,cAAc;EAC/B,IAAI,CAAC,UAAU,OAAO;EACtB,OAAO,oBAAC,MAAD;GAAM,MAAM;GAAI,MAAM;GAAO,OAAO,EAAE,YAAY,EAAE;EAAI,CAAA;CACjE,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB,MAAM,cAAc;EACxC,IAAI,CAAC,QAAQ,CAAC,OAAO,OAAO;EAC5B,OAAQ,MAA8C,KAAK,UAAU;GACnE,GAAG;GACH,OACE,qBAAAC,YAAA,EAAA,UAAA,CACG,MACA,KAAK,KACN,EAAA,CAAA;EAEN,EAAE;CACJ,GAAG,CAAC,OAAO,IAAI,CAAC;CAEhB,OACE,oBAACC,UAAD;EACE,GAAI;EACJ,OAAO;EACP,WAAW,CAAC,YAAY,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC3D,aAAa,EAAE,eACb,oBAAC,eAAD;GACE,MAAM;GACN,OAAO,EAAE,WAAW,UAAU,WAAW,IAAI,IAAI,MAAM;EACxD,CAAA;CAEJ,CAAA;AAEL"}
1
+ {"version":3,"file":"Collapse.js","names":["styles","Collapse","_Fragment","AntdCollapse"],"sources":["../../../../src/components/collapse/Collapse.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Collapse as AntdCollapse, CollapseProps } from 'antd'\nimport {\n CaretDownIcon,\n InfoIcon,\n WarningCircleIcon,\n XCircleIcon,\n} from '@phosphor-icons/react'\nimport styles from './Collapse.module.css'\n\nexport type CollapseState = 'default' | 'warning' | 'error'\n\nexport type Props = Expand<CollapseProps> & {\n state?: CollapseState\n showIcon?: boolean\n /**\n * `'section'`: stacked section headers for grouping content inside a\n * panel. A compact gray header band with a caption label and the caret at\n * the end, and a flush body so the content draws its own edges.\n */\n variant?: 'default' | 'section'\n}\n\nconst stateConfig: Record<\n CollapseState,\n { className: string; Icon: React.ElementType; color: string }\n> = {\n default: {\n className: styles.default,\n Icon: InfoIcon,\n color: 'var(--j2-color-text)',\n },\n warning: {\n className: styles.warning,\n Icon: WarningCircleIcon,\n color: 'var(--j2-color-warning-text)',\n },\n error: {\n className: styles.error,\n Icon: XCircleIcon,\n color: 'var(--j2-color-error-text)',\n },\n}\n\nconst Collapse = ({\n state = 'default',\n showIcon = false,\n variant = 'default',\n className,\n items,\n ...props\n}: Props) => {\n const isSection = variant === 'section'\n const { className: stateClass, Icon, color } = stateConfig[state]\n\n const icon = React.useMemo(() => {\n if (!showIcon) return null\n return <Icon size={14} fill={color} style={{ flexShrink: 0 }} />\n }, [state, showIcon])\n\n const itemsWithIcon = React.useMemo(() => {\n if (!icon || !items) return items\n return (items as NonNullable<CollapseProps['items']>).map((item) => ({\n ...item,\n label: (\n <>\n {icon}\n {item.label}\n </>\n ),\n }))\n }, [items, icon])\n\n return (\n <AntdCollapse\n ghost={isSection || undefined}\n expandIconPlacement={isSection ? 'end' : undefined}\n {...props}\n items={itemsWithIcon}\n className={[stateClass, isSection && styles.section, className]\n .filter(Boolean)\n .join(' ')}\n expandIcon={({ isActive }) => (\n <CaretDownIcon\n size={14}\n style={{ transform: `rotate(${isActive ? 0 : -90}deg)` }}\n />\n )}\n />\n )\n}\n\nexport { Collapse }\n"],"mappings":";;;;;;AAuBA,IAAM,cAGF;CACF,SAAS;EACP,WAAWA,wBAAO;EAClB,MAAM;EACN,OAAO;CACT;CACA,SAAS;EACP,WAAWA,wBAAO;EAClB,MAAM;EACN,OAAO;CACT;CACA,OAAO;EACL,WAAWA,wBAAO;EAClB,MAAM;EACN,OAAO;CACT;AACF;AAEA,IAAMC,cAAY,EAChB,QAAQ,WACR,WAAW,OACX,UAAU,WACV,WACA,OACA,GAAG,YACQ;CACX,MAAM,YAAY,YAAY;CAC9B,MAAM,EAAE,WAAW,YAAY,MAAM,UAAU,YAAY;CAE3D,MAAM,OAAO,MAAM,cAAc;EAC/B,IAAI,CAAC,UAAU,OAAO;EACtB,OAAO,oBAAC,MAAD;GAAM,MAAM;GAAI,MAAM;GAAO,OAAO,EAAE,YAAY,EAAE;EAAI,CAAA;CACjE,GAAG,CAAC,OAAO,QAAQ,CAAC;CAEpB,MAAM,gBAAgB,MAAM,cAAc;EACxC,IAAI,CAAC,QAAQ,CAAC,OAAO,OAAO;EAC5B,OAAQ,MAA8C,KAAK,UAAU;GACnE,GAAG;GACH,OACE,qBAAAC,YAAA,EAAA,UAAA,CACG,MACA,KAAK,KACN,EAAA,CAAA;EAEN,EAAE;CACJ,GAAG,CAAC,OAAO,IAAI,CAAC;CAEhB,OACE,oBAACC,UAAD;EACE,OAAO,aAAa,KAAA;EACpB,qBAAqB,YAAY,QAAQ,KAAA;EACzC,GAAI;EACJ,OAAO;EACP,WAAW;GAAC;GAAY,aAAaH,wBAAO;GAAS;EAAS,CAAC,CAC5D,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;EACX,aAAa,EAAE,eACb,oBAAC,eAAD;GACE,MAAM;GACN,OAAO,EAAE,WAAW,UAAU,WAAW,IAAI,IAAI,MAAM;EACxD,CAAA;CAEJ,CAAA;AAEL"}
@@ -1,14 +1,17 @@
1
1
  //#region src/components/collapse/Collapse.module.css
2
- var warning = "_warning_1t61q_2";
3
- var error = "_error_1t61q_3";
2
+ var warning = "_warning_4jnb6_2";
3
+ var error = "_error_4jnb6_3";
4
+ var section = "_section_4jnb6_51";
4
5
  var Collapse_module_default = {
5
- "default": "_default_1t61q_1",
6
+ "default": "_default_4jnb6_1",
6
7
  warning,
7
- error
8
+ error,
9
+ section
8
10
  };
9
11
  //#endregion
10
12
  exports.default = Collapse_module_default;
11
13
  exports.error = error;
14
+ exports.section = section;
12
15
  exports.warning = warning;
13
16
 
14
17
  //# sourceMappingURL=Collapse.module.css.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Collapse.module.css.cjs","names":[],"sources":["../../../../src/components/collapse/Collapse.module.css"],"sourcesContent":[".default :global(.ant-collapse-title),\n.warning :global(.ant-collapse-title),\n.error :global(.ant-collapse-title) {\n display: flex;\n align-items: center;\n gap: var(--j2-size-xs);\n}\n\n/* Warning state */\n.warning:global(.ant-collapse) {\n border-color: var(--j2-color-warning-border);\n background-color: var(--j2-color-warning-bg);\n}\n\n.warning :global(.ant-collapse-item) {\n border-bottom-color: var(--j2-color-warning-border) !important;\n}\n\n.warning :global(.ant-collapse-panel) {\n border-top-color: var(--j2-color-warning-border) !important;\n}\n\n.warning :global(.ant-collapse-header) {\n color: var(--j2-color-text) !important;\n}\n\n/* Error state */\n.error:global(.ant-collapse) {\n border-color: var(--j2-color-error-border);\n background-color: var(--j2-color-error-bg);\n}\n\n.error :global(.ant-collapse-item) {\n border-bottom-color: var(--j2-color-error-border) !important;\n}\n\n.error :global(.ant-collapse-panel) {\n border-top-color: var(--j2-color-error-border) !important;\n}\n\n.error :global(.ant-collapse-header) {\n color: var(--j2-color-text) !important;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"Collapse.module.css.cjs","names":[],"sources":["../../../../src/components/collapse/Collapse.module.css"],"sourcesContent":[".default :global(.ant-collapse-title),\n.warning :global(.ant-collapse-title),\n.error :global(.ant-collapse-title) {\n display: flex;\n align-items: center;\n gap: var(--j2-size-xs);\n}\n\n/* Warning state */\n.warning:global(.ant-collapse) {\n border-color: var(--j2-color-warning-border);\n background-color: var(--j2-color-warning-bg);\n}\n\n.warning :global(.ant-collapse-item) {\n border-bottom-color: var(--j2-color-warning-border) !important;\n}\n\n.warning :global(.ant-collapse-panel) {\n border-top-color: var(--j2-color-warning-border) !important;\n}\n\n.warning :global(.ant-collapse-header) {\n color: var(--j2-color-text) !important;\n}\n\n/* Error state */\n.error:global(.ant-collapse) {\n border-color: var(--j2-color-error-border);\n background-color: var(--j2-color-error-bg);\n}\n\n.error :global(.ant-collapse-item) {\n border-bottom-color: var(--j2-color-error-border) !important;\n}\n\n.error :global(.ant-collapse-panel) {\n border-top-color: var(--j2-color-error-border) !important;\n}\n\n.error :global(.ant-collapse-header) {\n color: var(--j2-color-text) !important;\n}\n\n/*\n * Section variant\n * A 28px gray band with a rule above and below, a caption label, and the\n * caret at the end. The body is flush and white so its content (a table, a\n * list) draws its own edges.\n */\n.section:global(.ant-collapse) > :global(.ant-collapse-item) {\n border-bottom: 0;\n}\n\n.section :global(.ant-collapse-header) {\n min-height: 28px;\n padding: 0 12px !important;\n align-items: center !important;\n background: var(--j2-gray-2);\n border-top: 1px solid var(--j2-color-border-secondary);\n border-bottom: 1px solid var(--j2-color-border-secondary);\n border-radius: 0 !important;\n}\n\n.section :global(.ant-collapse-item + .ant-collapse-item .ant-collapse-header) {\n border-top: 0;\n}\n\n.section :global(.ant-collapse-title) {\n display: flex;\n align-items: center;\n font-size: var(--j2-font-size-xs);\n line-height: var(--j2-line-height-xs);\n font-weight: 500;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n color: var(--j2-color-text-secondary);\n}\n\n.section :global(.ant-collapse-expand-icon) {\n height: auto !important;\n padding-inline-start: 8px !important;\n color: var(--j2-color-text-secondary);\n}\n\n.section :global(.ant-collapse-body) {\n padding: 0 !important;\n background: white;\n}\n\n.section :global(.ant-collapse-panel) {\n border-bottom: 1px solid var(--j2-color-border-secondary);\n}\n"],"mappings":""}
@@ -1,12 +1,14 @@
1
1
  //#region src/components/collapse/Collapse.module.css
2
- var warning = "_warning_1t61q_2";
3
- var error = "_error_1t61q_3";
2
+ var warning = "_warning_4jnb6_2";
3
+ var error = "_error_4jnb6_3";
4
+ var section = "_section_4jnb6_51";
4
5
  var Collapse_module_default = {
5
- "default": "_default_1t61q_1",
6
+ "default": "_default_4jnb6_1",
6
7
  warning,
7
- error
8
+ error,
9
+ section
8
10
  };
9
11
  //#endregion
10
- export { Collapse_module_default as default, error, warning };
12
+ export { Collapse_module_default as default, error, section, warning };
11
13
 
12
14
  //# sourceMappingURL=Collapse.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Collapse.module.css.js","names":[],"sources":["../../../../src/components/collapse/Collapse.module.css"],"sourcesContent":[".default :global(.ant-collapse-title),\n.warning :global(.ant-collapse-title),\n.error :global(.ant-collapse-title) {\n display: flex;\n align-items: center;\n gap: var(--j2-size-xs);\n}\n\n/* Warning state */\n.warning:global(.ant-collapse) {\n border-color: var(--j2-color-warning-border);\n background-color: var(--j2-color-warning-bg);\n}\n\n.warning :global(.ant-collapse-item) {\n border-bottom-color: var(--j2-color-warning-border) !important;\n}\n\n.warning :global(.ant-collapse-panel) {\n border-top-color: var(--j2-color-warning-border) !important;\n}\n\n.warning :global(.ant-collapse-header) {\n color: var(--j2-color-text) !important;\n}\n\n/* Error state */\n.error:global(.ant-collapse) {\n border-color: var(--j2-color-error-border);\n background-color: var(--j2-color-error-bg);\n}\n\n.error :global(.ant-collapse-item) {\n border-bottom-color: var(--j2-color-error-border) !important;\n}\n\n.error :global(.ant-collapse-panel) {\n border-top-color: var(--j2-color-error-border) !important;\n}\n\n.error :global(.ant-collapse-header) {\n color: var(--j2-color-text) !important;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"Collapse.module.css.js","names":[],"sources":["../../../../src/components/collapse/Collapse.module.css"],"sourcesContent":[".default :global(.ant-collapse-title),\n.warning :global(.ant-collapse-title),\n.error :global(.ant-collapse-title) {\n display: flex;\n align-items: center;\n gap: var(--j2-size-xs);\n}\n\n/* Warning state */\n.warning:global(.ant-collapse) {\n border-color: var(--j2-color-warning-border);\n background-color: var(--j2-color-warning-bg);\n}\n\n.warning :global(.ant-collapse-item) {\n border-bottom-color: var(--j2-color-warning-border) !important;\n}\n\n.warning :global(.ant-collapse-panel) {\n border-top-color: var(--j2-color-warning-border) !important;\n}\n\n.warning :global(.ant-collapse-header) {\n color: var(--j2-color-text) !important;\n}\n\n/* Error state */\n.error:global(.ant-collapse) {\n border-color: var(--j2-color-error-border);\n background-color: var(--j2-color-error-bg);\n}\n\n.error :global(.ant-collapse-item) {\n border-bottom-color: var(--j2-color-error-border) !important;\n}\n\n.error :global(.ant-collapse-panel) {\n border-top-color: var(--j2-color-error-border) !important;\n}\n\n.error :global(.ant-collapse-header) {\n color: var(--j2-color-text) !important;\n}\n\n/*\n * Section variant\n * A 28px gray band with a rule above and below, a caption label, and the\n * caret at the end. The body is flush and white so its content (a table, a\n * list) draws its own edges.\n */\n.section:global(.ant-collapse) > :global(.ant-collapse-item) {\n border-bottom: 0;\n}\n\n.section :global(.ant-collapse-header) {\n min-height: 28px;\n padding: 0 12px !important;\n align-items: center !important;\n background: var(--j2-gray-2);\n border-top: 1px solid var(--j2-color-border-secondary);\n border-bottom: 1px solid var(--j2-color-border-secondary);\n border-radius: 0 !important;\n}\n\n.section :global(.ant-collapse-item + .ant-collapse-item .ant-collapse-header) {\n border-top: 0;\n}\n\n.section :global(.ant-collapse-title) {\n display: flex;\n align-items: center;\n font-size: var(--j2-font-size-xs);\n line-height: var(--j2-line-height-xs);\n font-weight: 500;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n color: var(--j2-color-text-secondary);\n}\n\n.section :global(.ant-collapse-expand-icon) {\n height: auto !important;\n padding-inline-start: 8px !important;\n color: var(--j2-color-text-secondary);\n}\n\n.section :global(.ant-collapse-body) {\n padding: 0 !important;\n background: white;\n}\n\n.section :global(.ant-collapse-panel) {\n border-bottom: 1px solid var(--j2-color-border-secondary);\n}\n"],"mappings":""}
@@ -26,12 +26,17 @@ var Target = ({ label, type, disabled, icon, className }) => {
26
26
  children: icon ? label : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LabelWithCaret, { label })
27
27
  });
28
28
  };
29
- var Dropdown = ({ label, type, icon, menu, menuType = "default", targetClassName, ...props }) => {
29
+ var Dropdown = ({ label, type, icon, menu, menuType = "default", targetClassName, children, ...props }) => {
30
30
  let menuProp = menu;
31
31
  if (menuType === "slim" && typeof menu === "object") menuProp = {
32
32
  ...menu,
33
33
  className: (0, classnames.default)(menu.className, "j2-dropdown-slim-menu")
34
34
  };
35
+ if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Dropdown, {
36
+ ...props,
37
+ menu: menuProp,
38
+ children
39
+ });
35
40
  if (type === "twofold") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Dropdown.Button, {
36
41
  ...props,
37
42
  menu: menuProp,
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.cjs","names":["Typography","CaretDownIcon","cx","_Fragment","Button","AntdDropdown"],"sources":["../../../../src/components/dropdown/Dropdown.tsx"],"sourcesContent":["import { Dropdown as AntdDropdown, DropdownProps, Typography } from 'antd'\nimport cx from 'classnames'\nimport { Button } from '../button'\nimport { CaretDownIcon } from '@phosphor-icons/react'\nimport './Dropdown.css'\n\nconst { Link } = Typography\n\nexport type Props = DropdownProps & {\n type?: 'basic' | 'basic-inline' | 'twofold'\n label?: string\n icon?: React.ReactNode\n menuType?: 'default' | 'slim'\n targetClassName?: string\n}\n\nexport type TargetProps = {\n label?: string\n type?: 'basic' | 'basic-inline' | 'twofold'\n disabled?: boolean\n icon?: React.ReactNode\n className?: string\n}\n\nconst LabelWithCaret = ({ label }: { label: string | undefined }) => (\n <div className=\"flex items-center gap-2\">\n {label}\n <CaretDownIcon weight=\"regular\" />\n </div>\n)\n\nconst Target = ({ label, type, disabled, icon, className }: TargetProps) => {\n if (type === 'basic-inline') {\n return (\n <Link\n disabled={disabled}\n className={cx('flex items-center gap-1', className)}\n >\n {icon ? (\n <>\n {icon}\n {label}\n </>\n ) : (\n <LabelWithCaret label={label} />\n )}\n </Link>\n )\n }\n\n return (\n <Button disabled={disabled} icon={icon} className={className}>\n {icon ? label : <LabelWithCaret label={label} />}\n </Button>\n )\n}\n\nconst Dropdown = ({\n label,\n type,\n icon,\n menu,\n menuType = 'default',\n targetClassName,\n ...props\n}: Props) => {\n let menuProp = menu\n\n if (menuType === 'slim' && typeof menu === 'object') {\n menuProp = {\n ...menu,\n className: cx(menu.className, 'j2-dropdown-slim-menu'),\n }\n }\n\n if (type === 'twofold') {\n return (\n <AntdDropdown.Button {...props} menu={menuProp}>\n {icon ? (\n <>\n {icon} {label}\n </>\n ) : (\n label\n )}\n </AntdDropdown.Button>\n )\n }\n\n return (\n <AntdDropdown {...props} menu={menuProp}>\n <div>\n <Target\n label={label}\n type={type}\n disabled={props.disabled}\n icon={icon}\n className={targetClassName}\n />\n </div>\n </AntdDropdown>\n )\n}\n\nexport { Dropdown }\n"],"mappings":";;;;;;;;;;AAMA,IAAM,EAAE,SAASA,KAAAA;AAkBjB,IAAM,kBAAkB,EAAE,YACxB,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;CAAK,WAAU;CAAf,UAAA,CACG,OACD,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,eAAD,EAAe,QAAO,UAAW,CAAA,CAC9B;;AAGP,IAAM,UAAU,EAAE,OAAO,MAAM,UAAU,MAAM,gBAA6B;CAC1E,IAAI,SAAS,gBACX,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;EACY;EACV,YAAA,GAAWC,WAAAA,QAAAA,CAAG,2BAA2B,SAAS;EAEjD,UAAA,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA,CACG,MACA,KACD,EAAA,CAAA,IAEF,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAD,EAAuB,MAAQ,CAAA;CAE7B,CAAA;CAIV,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,eAAAA,QAAD;EAAkB;EAAgB;EAAiB;EAChD,UAAA,OAAO,QAAQ,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAD,EAAuB,MAAQ,CAAA;CACzC,CAAA;AAEZ;AAEA,IAAM,YAAY,EAChB,OACA,MACA,MACA,MACA,WAAW,WACX,iBACA,GAAG,YACQ;CACX,IAAI,WAAW;CAEf,IAAI,aAAa,UAAU,OAAO,SAAS,UACzC,WAAW;EACT,GAAG;EACH,YAAA,GAAWF,WAAAA,QAAAA,CAAG,KAAK,WAAW,uBAAuB;CACvD;CAGF,IAAI,SAAS,WACX,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACG,KAAAA,SAAa,QAAd;EAAqB,GAAI;EAAO,MAAM;EACnC,UAAA,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAAF,kBAAAA,UAAA,EAAA,UAAA;GACG;GAAK;GAAE;EACR,EAAA,CAAA,IAEF;CAEiB,CAAA;CAIzB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACE,KAAAA,UAAD;EAAc,GAAI;EAAO,MAAM;EAC7B,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GACS;GACD;GACN,UAAU,MAAM;GACV;GACN,WAAW;EACZ,CAAA,EACE,CAAA;CACO,CAAA;AAElB"}
1
+ {"version":3,"file":"Dropdown.cjs","names":["Typography","CaretDownIcon","cx","_Fragment","Button","AntdDropdown"],"sources":["../../../../src/components/dropdown/Dropdown.tsx"],"sourcesContent":["import { Dropdown as AntdDropdown, DropdownProps, Typography } from 'antd'\nimport cx from 'classnames'\nimport { Button } from '../button'\nimport { CaretDownIcon } from '@phosphor-icons/react'\nimport './Dropdown.css'\n\nconst { Link } = Typography\n\nexport type Props = DropdownProps & {\n /**\n * A custom trigger. When given, it opens the menu in place of the built-in\n * target, and `type`, `label`, `icon` and `targetClassName` are ignored.\n * It must accept a ref and mouse handlers (a DOM element or a component\n * that forwards them), as with antd's Dropdown.\n */\n children?: React.ReactNode\n type?: 'basic' | 'basic-inline' | 'twofold'\n label?: string\n icon?: React.ReactNode\n menuType?: 'default' | 'slim'\n targetClassName?: string\n}\n\nexport type TargetProps = {\n label?: string\n type?: 'basic' | 'basic-inline' | 'twofold'\n disabled?: boolean\n icon?: React.ReactNode\n className?: string\n}\n\nconst LabelWithCaret = ({ label }: { label: string | undefined }) => (\n <div className=\"flex items-center gap-2\">\n {label}\n <CaretDownIcon weight=\"regular\" />\n </div>\n)\n\nconst Target = ({ label, type, disabled, icon, className }: TargetProps) => {\n if (type === 'basic-inline') {\n return (\n <Link\n disabled={disabled}\n className={cx('flex items-center gap-1', className)}\n >\n {icon ? (\n <>\n {icon}\n {label}\n </>\n ) : (\n <LabelWithCaret label={label} />\n )}\n </Link>\n )\n }\n\n return (\n <Button disabled={disabled} icon={icon} className={className}>\n {icon ? label : <LabelWithCaret label={label} />}\n </Button>\n )\n}\n\nconst Dropdown = ({\n label,\n type,\n icon,\n menu,\n menuType = 'default',\n targetClassName,\n children,\n ...props\n}: Props) => {\n let menuProp = menu\n\n if (menuType === 'slim' && typeof menu === 'object') {\n menuProp = {\n ...menu,\n className: cx(menu.className, 'j2-dropdown-slim-menu'),\n }\n }\n\n if (children) {\n return (\n <AntdDropdown {...props} menu={menuProp}>\n {children}\n </AntdDropdown>\n )\n }\n\n if (type === 'twofold') {\n return (\n <AntdDropdown.Button {...props} menu={menuProp}>\n {icon ? (\n <>\n {icon} {label}\n </>\n ) : (\n label\n )}\n </AntdDropdown.Button>\n )\n }\n\n return (\n <AntdDropdown {...props} menu={menuProp}>\n <div>\n <Target\n label={label}\n type={type}\n disabled={props.disabled}\n icon={icon}\n className={targetClassName}\n />\n </div>\n </AntdDropdown>\n )\n}\n\nexport { Dropdown }\n"],"mappings":";;;;;;;;;;AAMA,IAAM,EAAE,SAASA,KAAAA;AAyBjB,IAAM,kBAAkB,EAAE,YACxB,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;CAAK,WAAU;CAAf,UAAA,CACG,OACD,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,eAAD,EAAe,QAAO,UAAW,CAAA,CAC9B;;AAGP,IAAM,UAAU,EAAE,OAAO,MAAM,UAAU,MAAM,gBAA6B;CAC1E,IAAI,SAAS,gBACX,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;EACY;EACV,YAAA,GAAWC,WAAAA,QAAAA,CAAG,2BAA2B,SAAS;EAEjD,UAAA,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA,CACG,MACA,KACD,EAAA,CAAA,IAEF,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAD,EAAuB,MAAQ,CAAA;CAE7B,CAAA;CAIV,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,eAAAA,QAAD;EAAkB;EAAgB;EAAiB;EAChD,UAAA,OAAO,QAAQ,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAD,EAAuB,MAAQ,CAAA;CACzC,CAAA;AAEZ;AAEA,IAAM,YAAY,EAChB,OACA,MACA,MACA,MACA,WAAW,WACX,iBACA,UACA,GAAG,YACQ;CACX,IAAI,WAAW;CAEf,IAAI,aAAa,UAAU,OAAO,SAAS,UACzC,WAAW;EACT,GAAG;EACH,YAAA,GAAWF,WAAAA,QAAAA,CAAG,KAAK,WAAW,uBAAuB;CACvD;CAGF,IAAI,UACF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACG,KAAAA,UAAD;EAAc,GAAI;EAAO,MAAM;EAC5B;CACW,CAAA;CAIlB,IAAI,SAAS,WACX,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,KAAAA,SAAa,QAAd;EAAqB,GAAI;EAAO,MAAM;EACnC,UAAA,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAAF,kBAAAA,UAAA,EAAA,UAAA;GACG;GAAK;GAAE;EACR,EAAA,CAAA,IAEF;CAEiB,CAAA;CAIzB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACE,KAAAA,UAAD;EAAc,GAAI;EAAO,MAAM;EAC7B,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GACS;GACD;GACN,UAAU,MAAM;GACV;GACN,WAAW;EACZ,CAAA,EACE,CAAA;CACO,CAAA;AAElB"}
@@ -1,5 +1,12 @@
1
1
  import { DropdownProps } from 'antd';
2
2
  export type Props = DropdownProps & {
3
+ /**
4
+ * A custom trigger. When given, it opens the menu in place of the built-in
5
+ * target, and `type`, `label`, `icon` and `targetClassName` are ignored.
6
+ * It must accept a ref and mouse handlers (a DOM element or a component
7
+ * that forwards them), as with antd's Dropdown.
8
+ */
9
+ children?: React.ReactNode;
3
10
  type?: 'basic' | 'basic-inline' | 'twofold';
4
11
  label?: string;
5
12
  icon?: React.ReactNode;
@@ -13,5 +20,5 @@ export type TargetProps = {
13
20
  icon?: React.ReactNode;
14
21
  className?: string;
15
22
  };
16
- declare const Dropdown: ({ label, type, icon, menu, menuType, targetClassName, ...props }: Props) => import('react').JSX.Element;
23
+ declare const Dropdown: ({ label, type, icon, menu, menuType, targetClassName, children, ...props }: Props) => import('react').JSX.Element;
17
24
  export { Dropdown };
@@ -23,12 +23,17 @@ var Target = ({ label, type, disabled, icon, className }) => {
23
23
  children: icon ? label : /* @__PURE__ */ jsx(LabelWithCaret, { label })
24
24
  });
25
25
  };
26
- var Dropdown$1 = ({ label, type, icon, menu, menuType = "default", targetClassName, ...props }) => {
26
+ var Dropdown$1 = ({ label, type, icon, menu, menuType = "default", targetClassName, children, ...props }) => {
27
27
  let menuProp = menu;
28
28
  if (menuType === "slim" && typeof menu === "object") menuProp = {
29
29
  ...menu,
30
30
  className: cx(menu.className, "j2-dropdown-slim-menu")
31
31
  };
32
+ if (children) return /* @__PURE__ */ jsx(Dropdown, {
33
+ ...props,
34
+ menu: menuProp,
35
+ children
36
+ });
32
37
  if (type === "twofold") return /* @__PURE__ */ jsx(Dropdown.Button, {
33
38
  ...props,
34
39
  menu: menuProp,
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.js","names":["_Fragment","Button","Dropdown","AntdDropdown"],"sources":["../../../../src/components/dropdown/Dropdown.tsx"],"sourcesContent":["import { Dropdown as AntdDropdown, DropdownProps, Typography } from 'antd'\nimport cx from 'classnames'\nimport { Button } from '../button'\nimport { CaretDownIcon } from '@phosphor-icons/react'\nimport './Dropdown.css'\n\nconst { Link } = Typography\n\nexport type Props = DropdownProps & {\n type?: 'basic' | 'basic-inline' | 'twofold'\n label?: string\n icon?: React.ReactNode\n menuType?: 'default' | 'slim'\n targetClassName?: string\n}\n\nexport type TargetProps = {\n label?: string\n type?: 'basic' | 'basic-inline' | 'twofold'\n disabled?: boolean\n icon?: React.ReactNode\n className?: string\n}\n\nconst LabelWithCaret = ({ label }: { label: string | undefined }) => (\n <div className=\"flex items-center gap-2\">\n {label}\n <CaretDownIcon weight=\"regular\" />\n </div>\n)\n\nconst Target = ({ label, type, disabled, icon, className }: TargetProps) => {\n if (type === 'basic-inline') {\n return (\n <Link\n disabled={disabled}\n className={cx('flex items-center gap-1', className)}\n >\n {icon ? (\n <>\n {icon}\n {label}\n </>\n ) : (\n <LabelWithCaret label={label} />\n )}\n </Link>\n )\n }\n\n return (\n <Button disabled={disabled} icon={icon} className={className}>\n {icon ? label : <LabelWithCaret label={label} />}\n </Button>\n )\n}\n\nconst Dropdown = ({\n label,\n type,\n icon,\n menu,\n menuType = 'default',\n targetClassName,\n ...props\n}: Props) => {\n let menuProp = menu\n\n if (menuType === 'slim' && typeof menu === 'object') {\n menuProp = {\n ...menu,\n className: cx(menu.className, 'j2-dropdown-slim-menu'),\n }\n }\n\n if (type === 'twofold') {\n return (\n <AntdDropdown.Button {...props} menu={menuProp}>\n {icon ? (\n <>\n {icon} {label}\n </>\n ) : (\n label\n )}\n </AntdDropdown.Button>\n )\n }\n\n return (\n <AntdDropdown {...props} menu={menuProp}>\n <div>\n <Target\n label={label}\n type={type}\n disabled={props.disabled}\n icon={icon}\n className={targetClassName}\n />\n </div>\n </AntdDropdown>\n )\n}\n\nexport { Dropdown }\n"],"mappings":";;;;;;;AAMA,IAAM,EAAE,SAAS;AAkBjB,IAAM,kBAAkB,EAAE,YACxB,qBAAC,OAAD;CAAK,WAAU;CAAf,UAAA,CACG,OACD,oBAAC,eAAD,EAAe,QAAO,UAAW,CAAA,CAC9B;;AAGP,IAAM,UAAU,EAAE,OAAO,MAAM,UAAU,MAAM,gBAA6B;CAC1E,IAAI,SAAS,gBACX,OACE,oBAAC,MAAD;EACY;EACV,WAAW,GAAG,2BAA2B,SAAS;EAEjD,UAAA,OACC,qBAAAA,UAAA,EAAA,UAAA,CACG,MACA,KACD,EAAA,CAAA,IAEF,oBAAC,gBAAD,EAAuB,MAAQ,CAAA;CAE7B,CAAA;CAIV,OACE,oBAACC,UAAD;EAAkB;EAAgB;EAAiB;EAChD,UAAA,OAAO,QAAQ,oBAAC,gBAAD,EAAuB,MAAQ,CAAA;CACzC,CAAA;AAEZ;AAEA,IAAMC,cAAY,EAChB,OACA,MACA,MACA,MACA,WAAW,WACX,iBACA,GAAG,YACQ;CACX,IAAI,WAAW;CAEf,IAAI,aAAa,UAAU,OAAO,SAAS,UACzC,WAAW;EACT,GAAG;EACH,WAAW,GAAG,KAAK,WAAW,uBAAuB;CACvD;CAGF,IAAI,SAAS,WACX,OACE,oBAACC,SAAa,QAAd;EAAqB,GAAI;EAAO,MAAM;EACnC,UAAA,OACC,qBAAAH,UAAA,EAAA,UAAA;GACG;GAAK;GAAE;EACR,EAAA,CAAA,IAEF;CAEiB,CAAA;CAIzB,OACE,oBAACG,UAAD;EAAc,GAAI;EAAO,MAAM;EAC7B,UAAA,oBAAC,OAAD,EAAA,UACE,oBAAC,QAAD;GACS;GACD;GACN,UAAU,MAAM;GACV;GACN,WAAW;EACZ,CAAA,EACE,CAAA;CACO,CAAA;AAElB"}
1
+ {"version":3,"file":"Dropdown.js","names":["_Fragment","Button","Dropdown","AntdDropdown"],"sources":["../../../../src/components/dropdown/Dropdown.tsx"],"sourcesContent":["import { Dropdown as AntdDropdown, DropdownProps, Typography } from 'antd'\nimport cx from 'classnames'\nimport { Button } from '../button'\nimport { CaretDownIcon } from '@phosphor-icons/react'\nimport './Dropdown.css'\n\nconst { Link } = Typography\n\nexport type Props = DropdownProps & {\n /**\n * A custom trigger. When given, it opens the menu in place of the built-in\n * target, and `type`, `label`, `icon` and `targetClassName` are ignored.\n * It must accept a ref and mouse handlers (a DOM element or a component\n * that forwards them), as with antd's Dropdown.\n */\n children?: React.ReactNode\n type?: 'basic' | 'basic-inline' | 'twofold'\n label?: string\n icon?: React.ReactNode\n menuType?: 'default' | 'slim'\n targetClassName?: string\n}\n\nexport type TargetProps = {\n label?: string\n type?: 'basic' | 'basic-inline' | 'twofold'\n disabled?: boolean\n icon?: React.ReactNode\n className?: string\n}\n\nconst LabelWithCaret = ({ label }: { label: string | undefined }) => (\n <div className=\"flex items-center gap-2\">\n {label}\n <CaretDownIcon weight=\"regular\" />\n </div>\n)\n\nconst Target = ({ label, type, disabled, icon, className }: TargetProps) => {\n if (type === 'basic-inline') {\n return (\n <Link\n disabled={disabled}\n className={cx('flex items-center gap-1', className)}\n >\n {icon ? (\n <>\n {icon}\n {label}\n </>\n ) : (\n <LabelWithCaret label={label} />\n )}\n </Link>\n )\n }\n\n return (\n <Button disabled={disabled} icon={icon} className={className}>\n {icon ? label : <LabelWithCaret label={label} />}\n </Button>\n )\n}\n\nconst Dropdown = ({\n label,\n type,\n icon,\n menu,\n menuType = 'default',\n targetClassName,\n children,\n ...props\n}: Props) => {\n let menuProp = menu\n\n if (menuType === 'slim' && typeof menu === 'object') {\n menuProp = {\n ...menu,\n className: cx(menu.className, 'j2-dropdown-slim-menu'),\n }\n }\n\n if (children) {\n return (\n <AntdDropdown {...props} menu={menuProp}>\n {children}\n </AntdDropdown>\n )\n }\n\n if (type === 'twofold') {\n return (\n <AntdDropdown.Button {...props} menu={menuProp}>\n {icon ? (\n <>\n {icon} {label}\n </>\n ) : (\n label\n )}\n </AntdDropdown.Button>\n )\n }\n\n return (\n <AntdDropdown {...props} menu={menuProp}>\n <div>\n <Target\n label={label}\n type={type}\n disabled={props.disabled}\n icon={icon}\n className={targetClassName}\n />\n </div>\n </AntdDropdown>\n )\n}\n\nexport { Dropdown }\n"],"mappings":";;;;;;;AAMA,IAAM,EAAE,SAAS;AAyBjB,IAAM,kBAAkB,EAAE,YACxB,qBAAC,OAAD;CAAK,WAAU;CAAf,UAAA,CACG,OACD,oBAAC,eAAD,EAAe,QAAO,UAAW,CAAA,CAC9B;;AAGP,IAAM,UAAU,EAAE,OAAO,MAAM,UAAU,MAAM,gBAA6B;CAC1E,IAAI,SAAS,gBACX,OACE,oBAAC,MAAD;EACY;EACV,WAAW,GAAG,2BAA2B,SAAS;EAEjD,UAAA,OACC,qBAAAA,UAAA,EAAA,UAAA,CACG,MACA,KACD,EAAA,CAAA,IAEF,oBAAC,gBAAD,EAAuB,MAAQ,CAAA;CAE7B,CAAA;CAIV,OACE,oBAACC,UAAD;EAAkB;EAAgB;EAAiB;EAChD,UAAA,OAAO,QAAQ,oBAAC,gBAAD,EAAuB,MAAQ,CAAA;CACzC,CAAA;AAEZ;AAEA,IAAMC,cAAY,EAChB,OACA,MACA,MACA,MACA,WAAW,WACX,iBACA,UACA,GAAG,YACQ;CACX,IAAI,WAAW;CAEf,IAAI,aAAa,UAAU,OAAO,SAAS,UACzC,WAAW;EACT,GAAG;EACH,WAAW,GAAG,KAAK,WAAW,uBAAuB;CACvD;CAGF,IAAI,UACF,OACE,oBAACC,UAAD;EAAc,GAAI;EAAO,MAAM;EAC5B;CACW,CAAA;CAIlB,IAAI,SAAS,WACX,OACE,oBAACA,SAAa,QAAd;EAAqB,GAAI;EAAO,MAAM;EACnC,UAAA,OACC,qBAAAH,UAAA,EAAA,UAAA;GACG;GAAK;GAAE;EACR,EAAA,CAAA,IAEF;CAEiB,CAAA;CAIzB,OACE,oBAACG,UAAD;EAAc,GAAI;EAAO,MAAM;EAC7B,UAAA,oBAAC,OAAD,EAAA,UACE,oBAAC,QAAD;GACS;GACD;GACN,UAAU,MAAM;GACV;GACN,WAAW;EACZ,CAAA,EACE,CAAA;CACO,CAAA;AAElB"}
@@ -0,0 +1,39 @@
1
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
+ let react_jsx_runtime = require("react/jsx-runtime");
3
+ let classnames = require("classnames");
4
+ classnames = require_runtime.__toESM(classnames, 1);
5
+ //#region src/components/emptyState/EmptyState.tsx
6
+ /**
7
+ * What a list, table or panel shows when it has nothing to show.
8
+ */
9
+ var EmptyState = ({ title, description, icon, action, size = "default", className }) => {
10
+ const compact = size === "compact";
11
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12
+ className: (0, classnames.default)("flex flex-col items-center justify-center text-center", compact ? "gap-3 px-6 py-8" : "gap-6 py-12", className),
13
+ children: [
14
+ icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
15
+ "aria-hidden": true,
16
+ className: "flex text-j2-gray-6",
17
+ children: icon
18
+ }),
19
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
20
+ className: "flex flex-col items-center gap-1",
21
+ children: [compact ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
22
+ className: "m-0 text-sm font-semibold text-j2-text",
23
+ children: title
24
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
25
+ className: "m-0",
26
+ children: title
27
+ }), description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
28
+ className: (0, classnames.default)("m-0", compact ? "max-w-[34ch] text-sm text-j2-text-secondary" : "max-w-md text-j2-primary"),
29
+ children: description
30
+ })]
31
+ }),
32
+ action
33
+ ]
34
+ });
35
+ };
36
+ //#endregion
37
+ exports.EmptyState = EmptyState;
38
+
39
+ //# sourceMappingURL=EmptyState.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.cjs","names":["cx"],"sources":["../../../../src/components/emptyState/EmptyState.tsx"],"sourcesContent":["import cx from 'classnames'\n\nexport type EmptyStateProps = {\n /** What is empty, in a few words: \"No results\", \"No changes yet\". */\n title: React.ReactNode\n /** Why it is empty, or what to do next. */\n description?: React.ReactNode\n /** An illustration or icon above the title. */\n icon?: React.ReactNode\n /** A next step: usually a text or link `Button`. */\n action?: React.ReactNode\n /**\n * - `'default'`: a page or table body, with a heading-sized title.\n * - `'compact'`: a panel, popover or narrow column, with body-sized text.\n */\n size?: 'default' | 'compact'\n className?: string\n}\n\n/**\n * What a list, table or panel shows when it has nothing to show.\n */\nexport const EmptyState = ({\n title,\n description,\n icon,\n action,\n size = 'default',\n className,\n}: EmptyStateProps) => {\n const compact = size === 'compact'\n\n return (\n <div\n className={cx(\n 'flex flex-col items-center justify-center text-center',\n compact ? 'gap-3 px-6 py-8' : 'gap-6 py-12',\n className\n )}\n >\n {icon && (\n <div aria-hidden className=\"flex text-j2-gray-6\">\n {icon}\n </div>\n )}\n <div className=\"flex flex-col items-center gap-1\">\n {compact ? (\n <p className=\"m-0 text-sm font-semibold text-j2-text\">{title}</p>\n ) : (\n <h4 className=\"m-0\">{title}</h4>\n )}\n {description && (\n <p\n className={cx(\n 'm-0',\n compact\n ? 'max-w-[34ch] text-sm text-j2-text-secondary'\n : 'max-w-md text-j2-primary'\n )}\n >\n {description}\n </p>\n )}\n </div>\n {action}\n </div>\n )\n}\n"],"mappings":";;;;;;;;AAsBA,IAAa,cAAc,EACzB,OACA,aACA,MACA,QACA,OAAO,WACP,gBACqB;CACrB,MAAM,UAAU,SAAS;CAEzB,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EACE,YAAA,GAAWA,WAAAA,QAAAA,CACT,yDACA,UAAU,oBAAoB,eAC9B,SACF;EALF,UAAA;GAOG,QACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,eAAA;IAAY,WAAU;IACxB,UAAA;GACE,CAAA;GAEP,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACG,UACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;KAAG,WAAU;KAA0C,UAAA;IAAS,CAAA,IAEhE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;KAAI,WAAU;KAAO,UAAA;IAAU,CAAA,GAEhC,eACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;KACE,YAAA,GAAWA,WAAAA,QAAAA,CACT,OACA,UACI,gDACA,0BACN;KAEC,UAAA;IACA,CAAA,CAEF;;GACJ;EACE;;AAET"}
@@ -0,0 +1,20 @@
1
+ export type EmptyStateProps = {
2
+ /** What is empty, in a few words: "No results", "No changes yet". */
3
+ title: React.ReactNode;
4
+ /** Why it is empty, or what to do next. */
5
+ description?: React.ReactNode;
6
+ /** An illustration or icon above the title. */
7
+ icon?: React.ReactNode;
8
+ /** A next step: usually a text or link `Button`. */
9
+ action?: React.ReactNode;
10
+ /**
11
+ * - `'default'`: a page or table body, with a heading-sized title.
12
+ * - `'compact'`: a panel, popover or narrow column, with body-sized text.
13
+ */
14
+ size?: 'default' | 'compact';
15
+ className?: string;
16
+ };
17
+ /**
18
+ * What a list, table or panel shows when it has nothing to show.
19
+ */
20
+ export declare const EmptyState: ({ title, description, icon, action, size, className, }: EmptyStateProps) => import('react').JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import cx from "classnames";
3
+ //#region src/components/emptyState/EmptyState.tsx
4
+ /**
5
+ * What a list, table or panel shows when it has nothing to show.
6
+ */
7
+ var EmptyState = ({ title, description, icon, action, size = "default", className }) => {
8
+ const compact = size === "compact";
9
+ return /* @__PURE__ */ jsxs("div", {
10
+ className: cx("flex flex-col items-center justify-center text-center", compact ? "gap-3 px-6 py-8" : "gap-6 py-12", className),
11
+ children: [
12
+ icon && /* @__PURE__ */ jsx("div", {
13
+ "aria-hidden": true,
14
+ className: "flex text-j2-gray-6",
15
+ children: icon
16
+ }),
17
+ /* @__PURE__ */ jsxs("div", {
18
+ className: "flex flex-col items-center gap-1",
19
+ children: [compact ? /* @__PURE__ */ jsx("p", {
20
+ className: "m-0 text-sm font-semibold text-j2-text",
21
+ children: title
22
+ }) : /* @__PURE__ */ jsx("h4", {
23
+ className: "m-0",
24
+ children: title
25
+ }), description && /* @__PURE__ */ jsx("p", {
26
+ className: cx("m-0", compact ? "max-w-[34ch] text-sm text-j2-text-secondary" : "max-w-md text-j2-primary"),
27
+ children: description
28
+ })]
29
+ }),
30
+ action
31
+ ]
32
+ });
33
+ };
34
+ //#endregion
35
+ export { EmptyState };
36
+
37
+ //# sourceMappingURL=EmptyState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.js","names":[],"sources":["../../../../src/components/emptyState/EmptyState.tsx"],"sourcesContent":["import cx from 'classnames'\n\nexport type EmptyStateProps = {\n /** What is empty, in a few words: \"No results\", \"No changes yet\". */\n title: React.ReactNode\n /** Why it is empty, or what to do next. */\n description?: React.ReactNode\n /** An illustration or icon above the title. */\n icon?: React.ReactNode\n /** A next step: usually a text or link `Button`. */\n action?: React.ReactNode\n /**\n * - `'default'`: a page or table body, with a heading-sized title.\n * - `'compact'`: a panel, popover or narrow column, with body-sized text.\n */\n size?: 'default' | 'compact'\n className?: string\n}\n\n/**\n * What a list, table or panel shows when it has nothing to show.\n */\nexport const EmptyState = ({\n title,\n description,\n icon,\n action,\n size = 'default',\n className,\n}: EmptyStateProps) => {\n const compact = size === 'compact'\n\n return (\n <div\n className={cx(\n 'flex flex-col items-center justify-center text-center',\n compact ? 'gap-3 px-6 py-8' : 'gap-6 py-12',\n className\n )}\n >\n {icon && (\n <div aria-hidden className=\"flex text-j2-gray-6\">\n {icon}\n </div>\n )}\n <div className=\"flex flex-col items-center gap-1\">\n {compact ? (\n <p className=\"m-0 text-sm font-semibold text-j2-text\">{title}</p>\n ) : (\n <h4 className=\"m-0\">{title}</h4>\n )}\n {description && (\n <p\n className={cx(\n 'm-0',\n compact\n ? 'max-w-[34ch] text-sm text-j2-text-secondary'\n : 'max-w-md text-j2-primary'\n )}\n >\n {description}\n </p>\n )}\n </div>\n {action}\n </div>\n )\n}\n"],"mappings":";;;;;;AAsBA,IAAa,cAAc,EACzB,OACA,aACA,MACA,QACA,OAAO,WACP,gBACqB;CACrB,MAAM,UAAU,SAAS;CAEzB,OACE,qBAAC,OAAD;EACE,WAAW,GACT,yDACA,UAAU,oBAAoB,eAC9B,SACF;EALF,UAAA;GAOG,QACC,oBAAC,OAAD;IAAK,eAAA;IAAY,WAAU;IACxB,UAAA;GACE,CAAA;GAEP,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACG,UACC,oBAAC,KAAD;KAAG,WAAU;KAA0C,UAAA;IAAS,CAAA,IAEhE,oBAAC,MAAD;KAAI,WAAU;KAAO,UAAA;IAAU,CAAA,GAEhC,eACC,oBAAC,KAAD;KACE,WAAW,GACT,OACA,UACI,gDACA,0BACN;KAEC,UAAA;IACA,CAAA,CAEF;;GACJ;EACE;;AAET"}
@@ -0,0 +1 @@
1
+ export { EmptyState, type EmptyStateProps } from './EmptyState.js';
@@ -343,6 +343,7 @@ export declare const AntdInput: import('react').ForwardRefExoticComponent<{
343
343
  formNoValidate?: boolean | undefined | undefined;
344
344
  formTarget?: string | undefined | undefined;
345
345
  count?: import('@rc-component/input/lib/interface').CountConfig | undefined;
346
+ placeholder?: string | undefined | undefined;
346
347
  checked?: boolean | undefined | undefined;
347
348
  required?: boolean | undefined | undefined;
348
349
  alt?: string | undefined | undefined;
@@ -352,7 +353,6 @@ export declare const AntdInput: import('react').ForwardRefExoticComponent<{
352
353
  maxLength?: number | undefined | undefined;
353
354
  minLength?: number | undefined | undefined;
354
355
  src?: string | undefined | undefined;
355
- placeholder?: string | undefined | undefined;
356
356
  onClear?: (() => void) | undefined;
357
357
  allowClear?: boolean | {
358
358
  disabled?: boolean;
@@ -355,6 +355,7 @@ export declare const AntdSearchInput: import('react').ForwardRefExoticComponent<
355
355
  formNoValidate?: boolean | undefined | undefined;
356
356
  formTarget?: string | undefined | undefined;
357
357
  count?: import('@rc-component/input/lib/interface').CountConfig | undefined;
358
+ placeholder?: string | undefined | undefined;
358
359
  checked?: boolean | undefined | undefined;
359
360
  required?: boolean | undefined | undefined;
360
361
  alt?: string | undefined | undefined;
@@ -364,7 +365,6 @@ export declare const AntdSearchInput: import('react').ForwardRefExoticComponent<
364
365
  maxLength?: number | undefined | undefined;
365
366
  minLength?: number | undefined | undefined;
366
367
  src?: string | undefined | undefined;
367
- placeholder?: string | undefined | undefined;
368
368
  onClear?: (() => void) | undefined;
369
369
  allowClear?: boolean | {
370
370
  disabled?: boolean;
@@ -0,0 +1,65 @@
1
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
+ const require_Checkbox = require("../checkbox/Checkbox.cjs");
3
+ const require_Radio = require("../radio/Radio.cjs");
4
+ let react_jsx_runtime = require("react/jsx-runtime");
5
+ let classnames = require("classnames");
6
+ classnames = require_runtime.__toESM(classnames, 1);
7
+ //#region src/components/listRow/ListRow.tsx
8
+ /**
9
+ * A row in a list of records, with hover, selected and pending states.
10
+ * Precedence: pending, then selected, then hover. A selected row keeps its
11
+ * own fill under the cursor rather than stacking a hover tint on top.
12
+ */
13
+ var ListRow = ({ selected = false, pending = false, highlighted = false, onClick, onHoverChange, selection, onSelectedChange, selectionLabel, className, children, onKeyDown, onMouseEnter, onMouseLeave, ...props }) => {
14
+ const resting = !pending && !selected;
15
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
16
+ ...props,
17
+ "data-selected": selected || void 0,
18
+ "data-pending": pending || void 0,
19
+ role: onClick ? "button" : props.role,
20
+ tabIndex: onClick ? 0 : props.tabIndex,
21
+ "aria-pressed": onClick && !selection ? selected : void 0,
22
+ onClick,
23
+ onKeyDown: (event) => {
24
+ onKeyDown?.(event);
25
+ if (!onClick || event.defaultPrevented) return;
26
+ if (event.target !== event.currentTarget) return;
27
+ if (event.key === "Enter" || event.key === " ") {
28
+ event.preventDefault();
29
+ onClick();
30
+ }
31
+ },
32
+ onMouseEnter: (event) => {
33
+ onMouseEnter?.(event);
34
+ onHoverChange?.(true);
35
+ },
36
+ onMouseLeave: (event) => {
37
+ onMouseLeave?.(event);
38
+ onHoverChange?.(false);
39
+ },
40
+ className: (0, classnames.default)("border-b border-j2-gray-3 px-4 py-3 transition-colors", onClick && "cursor-pointer", pending && "bg-[var(--j2-color-warning-bg)]", !pending && selected && "bg-[var(--j2-color-primary-bg-hover)]", resting && (highlighted ? "bg-j2-gray-3" : "hover:bg-j2-gray-3"), className),
41
+ children: selection ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
42
+ className: "flex items-start gap-2",
43
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
44
+ className: "flex shrink-0 pt-0.5",
45
+ onClick: (event) => event.stopPropagation(),
46
+ children: selection === "checkbox" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Checkbox.Checkbox, {
47
+ checked: selected,
48
+ "aria-label": selectionLabel,
49
+ onChange: (event) => onSelectedChange?.(event.target.checked)
50
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Radio.Radio, {
51
+ checked: selected,
52
+ "aria-label": selectionLabel,
53
+ onChange: () => onSelectedChange?.(true)
54
+ })
55
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
56
+ className: "min-w-0 flex-1",
57
+ children
58
+ })]
59
+ }) : children
60
+ });
61
+ };
62
+ //#endregion
63
+ exports.ListRow = ListRow;
64
+
65
+ //# sourceMappingURL=ListRow.cjs.map