@octavius2929-personal/design-system 0.21.0 → 0.22.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.
- package/dist/index.cjs +33 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +11 -5
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +33 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -979,7 +979,8 @@ function useStyles8({
|
|
|
979
979
|
|
|
980
980
|
// src/components/chip/index.tsx
|
|
981
981
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
982
|
-
var
|
|
982
|
+
var ICON_SIZE2 = 13;
|
|
983
|
+
var Chip = (0, import_react21.forwardRef)(function Chip2({ selected: selected3, tone: tone4, onDelete, onClick, startIcon: StartIcon, children, testId, ...rest }, ref) {
|
|
983
984
|
const clickable2 = Boolean(onClick);
|
|
984
985
|
const { root: root24, deleteBtn: deleteBtn2 } = useStyles8({ selected: selected3, tone: tone4, clickable: clickable2 });
|
|
985
986
|
const { testId: dataTestId, slot } = useTestId("media", testId);
|
|
@@ -997,6 +998,7 @@ var Chip = (0, import_react21.forwardRef)(function Chip2({ selected: selected3,
|
|
|
997
998
|
"data-state": states({ selected: selected3 }),
|
|
998
999
|
...rest,
|
|
999
1000
|
children: [
|
|
1001
|
+
StartIcon ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(StartIcon, { size: ICON_SIZE2 }) : null,
|
|
1000
1002
|
children,
|
|
1001
1003
|
onDelete && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1002
1004
|
"button",
|
|
@@ -1006,7 +1008,7 @@ var Chip = (0, import_react21.forwardRef)(function Chip2({ selected: selected3,
|
|
|
1006
1008
|
"aria-label": "Remove",
|
|
1007
1009
|
onClick: handleDelete,
|
|
1008
1010
|
"data-testid": slot("delete"),
|
|
1009
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(XIcon, { size:
|
|
1011
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(XIcon, { size: ICON_SIZE2 })
|
|
1010
1012
|
}
|
|
1011
1013
|
)
|
|
1012
1014
|
]
|
|
@@ -2504,6 +2506,7 @@ function useStyles24() {
|
|
|
2504
2506
|
|
|
2505
2507
|
// src/components/tabs/index.tsx
|
|
2506
2508
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2509
|
+
var ICON_SIZE3 = 16;
|
|
2507
2510
|
var Tabs = (0, import_react55.forwardRef)(function Tabs2({ items, value, onChange, testId, ...rest }, ref) {
|
|
2508
2511
|
const { root: root24, tabClass, panel: panel3 } = useStyles24();
|
|
2509
2512
|
const { testId: dataTestId, slot } = useTestId("nav", testId);
|
|
@@ -2544,7 +2547,8 @@ var Tabs = (0, import_react55.forwardRef)(function Tabs2({ items, value, onChang
|
|
|
2544
2547
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { ref, role: "tablist", className: root24, "data-testid": dataTestId, ...rest, children: items.map((item3, index) => {
|
|
2545
2548
|
const active2 = item3.value === value;
|
|
2546
2549
|
const tabbable = active2 || activeIndex === -1 && index === 0;
|
|
2547
|
-
|
|
2550
|
+
const ItemIcon = item3.icon;
|
|
2551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
2548
2552
|
"button",
|
|
2549
2553
|
{
|
|
2550
2554
|
ref: (el) => {
|
|
@@ -2561,7 +2565,10 @@ var Tabs = (0, import_react55.forwardRef)(function Tabs2({ items, value, onChang
|
|
|
2561
2565
|
"data-state": states({ selected: active2 }),
|
|
2562
2566
|
onClick: () => onChange?.(item3.value),
|
|
2563
2567
|
onKeyDown: (event) => onKeyDown(event, index),
|
|
2564
|
-
children:
|
|
2568
|
+
children: [
|
|
2569
|
+
ItemIcon ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ItemIcon, { size: ICON_SIZE3 }) : null,
|
|
2570
|
+
item3.label
|
|
2571
|
+
]
|
|
2565
2572
|
},
|
|
2566
2573
|
item3.value
|
|
2567
2574
|
);
|
|
@@ -2611,6 +2618,7 @@ function useStyles25() {
|
|
|
2611
2618
|
|
|
2612
2619
|
// src/components/menu/index.tsx
|
|
2613
2620
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2621
|
+
var ICON_SIZE4 = 16;
|
|
2614
2622
|
function assignRef(ref, value) {
|
|
2615
2623
|
if (typeof ref === "function") ref(value);
|
|
2616
2624
|
else if (ref) ref.current = value;
|
|
@@ -2733,22 +2741,28 @@ var Menu = (0, import_react57.forwardRef)(function Menu2({ trigger: trigger2, it
|
|
|
2733
2741
|
"data-align": alignEnd ? "end" : "start",
|
|
2734
2742
|
"data-testid": slot("list"),
|
|
2735
2743
|
onKeyDown: onMenuKeyDown,
|
|
2736
|
-
children: items.map((entry, index) =>
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2744
|
+
children: items.map((entry, index) => {
|
|
2745
|
+
const ItemIcon = entry.icon;
|
|
2746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2747
|
+
"button",
|
|
2748
|
+
{
|
|
2749
|
+
type: "button",
|
|
2750
|
+
role: "menuitem",
|
|
2751
|
+
tabIndex: -1,
|
|
2752
|
+
className: entry.danger ? dangerItem : item3,
|
|
2753
|
+
"data-testid": slot(`item-${index}`),
|
|
2754
|
+
onClick: () => {
|
|
2755
|
+
entry.onClick?.();
|
|
2756
|
+
setOpen(false);
|
|
2757
|
+
},
|
|
2758
|
+
children: [
|
|
2759
|
+
ItemIcon ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ItemIcon, { size: ICON_SIZE4 }) : null,
|
|
2760
|
+
entry.label
|
|
2761
|
+
]
|
|
2747
2762
|
},
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
))
|
|
2763
|
+
index
|
|
2764
|
+
);
|
|
2765
|
+
})
|
|
2752
2766
|
}
|
|
2753
2767
|
)
|
|
2754
2768
|
]
|