@atom-learning/components 11.5.0 → 11.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.
- package/dist/components/select-menu/SelectMenu.context.d.ts +1 -0
- package/dist/components/select-menu/SelectMenu.context.js +2 -1
- package/dist/components/select-menu/SelectMenu.context.js.map +1 -1
- package/dist/components/select-menu/SelectMenu.d.ts +5 -2
- package/dist/components/select-menu/SelectMenu.js +3 -1
- package/dist/components/select-menu/SelectMenu.js.map +1 -1
- package/dist/components/select-menu/SelectMenuContent.js +23 -12
- package/dist/components/select-menu/SelectMenuContent.js.map +1 -1
- package/dist/components/select-menu/SelectMenuItem.js +30 -19
- package/dist/components/select-menu/SelectMenuItem.js.map +1 -1
- package/dist/components/select-menu/SelectMenuLabel.js +10 -6
- package/dist/components/select-menu/SelectMenuLabel.js.map +1 -1
- package/dist/components/select-menu/SelectMenuSeparator.d.ts +6 -1
- package/dist/components/select-menu/SelectMenuSeparator.js +22 -6
- package/dist/components/select-menu/SelectMenuSeparator.js.map +1 -1
- package/dist/components/select-menu/SelectMenuTrigger.js +29 -8
- package/dist/components/select-menu/SelectMenuTrigger.js.map +1 -1
- package/dist/components/toggle-group/ToggleGroupButton.d.ts +3 -2
- package/dist/components/toggle-group/ToggleGroupButton.js +30 -3
- package/dist/components/toggle-group/ToggleGroupButton.js.map +1 -1
- package/dist/components/toggle-group/ToggleGroupItem.d.ts +3 -0
- package/dist/components/toggle-group/ToggleGroupItem.js +39 -14
- package/dist/components/toggle-group/ToggleGroupItem.js.map +1 -1
- package/dist/components/toggle-group/ToggleGroupRoot.d.ts +2 -1
- package/dist/components/toggle-group/ToggleGroupRoot.js +18 -2
- package/dist/components/toggle-group/ToggleGroupRoot.js.map +1 -1
- package/dist/components/toggle-group/index.d.ts +3 -2
- package/dist/docgen.json +1 -1
- package/dist/index.cjs.js +207 -78
- package/dist/index.cjs.js.map +1 -1
- package/package.json +1 -1
- package/src/responsive-variant-classes.css +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1303,7 +1303,7 @@ var overrideStyledVariantValue = (prop, overrideFunction) => {
|
|
|
1303
1303
|
};
|
|
1304
1304
|
//#endregion
|
|
1305
1305
|
//#region src/components/avatar/AvatarIcon.tsx
|
|
1306
|
-
var toIconSize$
|
|
1306
|
+
var toIconSize$4 = {
|
|
1307
1307
|
xs: "sm",
|
|
1308
1308
|
sm: "sm",
|
|
1309
1309
|
md: "md",
|
|
@@ -1314,7 +1314,7 @@ var toIconSize$3 = {
|
|
|
1314
1314
|
var AvatarIcon = ({ is }) => {
|
|
1315
1315
|
const { size } = react.use(AvatarRootContext);
|
|
1316
1316
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
1317
|
-
size: overrideStyledVariantValue(size, (s) => toIconSize$
|
|
1317
|
+
size: overrideStyledVariantValue(size, (s) => toIconSize$4[s]),
|
|
1318
1318
|
is
|
|
1319
1319
|
});
|
|
1320
1320
|
};
|
|
@@ -2763,12 +2763,12 @@ var StyledCheckbox = styled(_radix_ui_react_checkbox.Root, {
|
|
|
2763
2763
|
}
|
|
2764
2764
|
}
|
|
2765
2765
|
});
|
|
2766
|
-
var toIconSize$
|
|
2766
|
+
var toIconSize$3 = {
|
|
2767
2767
|
md: "sm",
|
|
2768
2768
|
lg: "sm"
|
|
2769
2769
|
};
|
|
2770
2770
|
var Checkbox = ({ ref, size = "md", checked, ...rest }) => {
|
|
2771
|
-
const iconSize = overrideStyledVariantValue(size, (s) => toIconSize$
|
|
2771
|
+
const iconSize = overrideStyledVariantValue(size, (s) => toIconSize$3[s]);
|
|
2772
2772
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2773
2773
|
className: "relative z-1",
|
|
2774
2774
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledCheckbox, {
|
|
@@ -3438,14 +3438,14 @@ var StyledChipContent = styled("span", { base: [
|
|
|
3438
3438
|
"whitespace-nowrap",
|
|
3439
3439
|
"*:not-last:mr-1"
|
|
3440
3440
|
] });
|
|
3441
|
-
var toIconSize$
|
|
3441
|
+
var toIconSize$2 = {
|
|
3442
3442
|
sm: "sm",
|
|
3443
3443
|
md: "sm",
|
|
3444
3444
|
lg: "md"
|
|
3445
3445
|
};
|
|
3446
3446
|
var ChipIcon = (props) => {
|
|
3447
3447
|
const { size } = react.use(ChipRootContext);
|
|
3448
|
-
const iconSize = overrideStyledVariantValue(size, (s) => toIconSize$
|
|
3448
|
+
const iconSize = overrideStyledVariantValue(size, (s) => toIconSize$2[s]);
|
|
3449
3449
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
3450
3450
|
...props,
|
|
3451
3451
|
size: iconSize
|
|
@@ -3873,12 +3873,12 @@ var FormCustomContext = react.createContext({ appearance: "standard" });
|
|
|
3873
3873
|
var useFormCustomContext = () => react.use(FormCustomContext);
|
|
3874
3874
|
//#endregion
|
|
3875
3875
|
//#region src/utilities/style/get-icon-size.ts
|
|
3876
|
-
var toIconSize = {
|
|
3876
|
+
var toIconSize$1 = {
|
|
3877
3877
|
sm: "sm",
|
|
3878
3878
|
md: "md",
|
|
3879
3879
|
lg: "md"
|
|
3880
3880
|
};
|
|
3881
|
-
var getFieldIconSize = (size) => overrideStyledVariantValue(size, (s) => toIconSize[s]);
|
|
3881
|
+
var getFieldIconSize = (size) => overrideStyledVariantValue(size, (s) => toIconSize$1[s]);
|
|
3882
3882
|
//#endregion
|
|
3883
3883
|
//#region src/components/input/Input.tsx
|
|
3884
3884
|
var InputBackground = styled("div", {
|
|
@@ -8671,7 +8671,8 @@ SelectField.displayName = "SelectField";
|
|
|
8671
8671
|
//#region src/components/select-menu/SelectMenu.context.tsx
|
|
8672
8672
|
var SelectMenuContext = react.createContext({
|
|
8673
8673
|
size: "md",
|
|
8674
|
-
theme: "grey"
|
|
8674
|
+
theme: "grey",
|
|
8675
|
+
colorMode: "light"
|
|
8675
8676
|
});
|
|
8676
8677
|
var useSelectMenuContext = () => react.use(SelectMenuContext);
|
|
8677
8678
|
//#endregion
|
|
@@ -8685,10 +8686,16 @@ var Content$2 = styled(react_aria_components.Popover, {
|
|
|
8685
8686
|
"overflow-hidden",
|
|
8686
8687
|
"will-change-transform"
|
|
8687
8688
|
],
|
|
8688
|
-
variants: {
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8689
|
+
variants: {
|
|
8690
|
+
colorMode: {
|
|
8691
|
+
light: [],
|
|
8692
|
+
dark: ["bg-grey-900"]
|
|
8693
|
+
},
|
|
8694
|
+
matchTriggerWidth: {
|
|
8695
|
+
true: ["w-(--trigger-width)"],
|
|
8696
|
+
false: ["min-w-(--trigger-width)", "max-w-[min(calc(100vw-(--spacing(4))),--spacing(100))]"]
|
|
8697
|
+
}
|
|
8698
|
+
}
|
|
8692
8699
|
}, { enablePolymorphism: false });
|
|
8693
8700
|
var Viewport = styled(react_aria_components.ListBox, { base: [
|
|
8694
8701
|
"max-h-[inherit]",
|
|
@@ -8697,14 +8704,18 @@ var Viewport = styled(react_aria_components.ListBox, { base: [
|
|
|
8697
8704
|
"p-1",
|
|
8698
8705
|
"outline-none"
|
|
8699
8706
|
] }, { enablePolymorphism: false });
|
|
8700
|
-
var SelectMenuContent = ({ ref, children, offset = 4, matchTriggerWidth = false, ...rest }) =>
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8707
|
+
var SelectMenuContent = ({ ref, children, offset = 4, matchTriggerWidth = false, ...rest }) => {
|
|
8708
|
+
const { colorMode } = useSelectMenuContext();
|
|
8709
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Content$2, {
|
|
8710
|
+
ref,
|
|
8711
|
+
offset,
|
|
8712
|
+
containerPadding: 8,
|
|
8713
|
+
colorMode,
|
|
8714
|
+
matchTriggerWidth,
|
|
8715
|
+
...rest,
|
|
8716
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Viewport, { children })
|
|
8717
|
+
});
|
|
8718
|
+
};
|
|
8708
8719
|
//#endregion
|
|
8709
8720
|
//#region src/components/select-menu/SelectMenuItem.tsx
|
|
8710
8721
|
var Item = styled(react_aria_components.ListBoxItem, {
|
|
@@ -8725,29 +8736,40 @@ var Item = styled(react_aria_components.ListBoxItem, {
|
|
|
8725
8736
|
"data-[focused]:bg-grey-100",
|
|
8726
8737
|
"data-[focus-visible]:outline-none"
|
|
8727
8738
|
],
|
|
8728
|
-
variants: {
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8739
|
+
variants: {
|
|
8740
|
+
size: {
|
|
8741
|
+
sm: [
|
|
8742
|
+
"py-2",
|
|
8743
|
+
"pl-7",
|
|
8744
|
+
"pr-4",
|
|
8745
|
+
"text-sm"
|
|
8746
|
+
],
|
|
8747
|
+
md: [
|
|
8748
|
+
"py-2.5",
|
|
8749
|
+
"pl-8",
|
|
8750
|
+
"pr-6"
|
|
8751
|
+
],
|
|
8752
|
+
lg: [
|
|
8753
|
+
"py-2.5",
|
|
8754
|
+
"pl-8",
|
|
8755
|
+
"pr-6"
|
|
8756
|
+
]
|
|
8757
|
+
},
|
|
8758
|
+
colorMode: {
|
|
8759
|
+
light: [],
|
|
8760
|
+
dark: [
|
|
8761
|
+
"text-white",
|
|
8762
|
+
"data-[hovered]:bg-grey-800",
|
|
8763
|
+
"data-[focused]:bg-grey-800"
|
|
8764
|
+
]
|
|
8765
|
+
}
|
|
8766
|
+
}
|
|
8746
8767
|
}, { enablePolymorphism: false });
|
|
8747
8768
|
var SelectMenuItem = ({ children, textValue, ...rest }) => {
|
|
8748
|
-
const { size } = useSelectMenuContext();
|
|
8769
|
+
const { size, colorMode } = useSelectMenuContext();
|
|
8749
8770
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Item, {
|
|
8750
8771
|
size,
|
|
8772
|
+
colorMode,
|
|
8751
8773
|
textValue: textValue ?? (typeof children === "string" || typeof children === "number" ? String(children) : void 0),
|
|
8752
8774
|
...rest,
|
|
8753
8775
|
children: ({ isSelected }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -8761,21 +8783,37 @@ var SelectMenuItem = ({ children, textValue, ...rest }) => {
|
|
|
8761
8783
|
};
|
|
8762
8784
|
//#endregion
|
|
8763
8785
|
//#region src/components/select-menu/SelectMenuLabel.tsx
|
|
8764
|
-
var SelectMenuLabel = ({ className, ...rest }) =>
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8786
|
+
var SelectMenuLabel = ({ className, ...rest }) => {
|
|
8787
|
+
const { colorMode } = useSelectMenuContext();
|
|
8788
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
|
|
8789
|
+
as: react_aria_components.Header,
|
|
8790
|
+
size: "sm",
|
|
8791
|
+
className: cn("p-2", "mb-1", colorMode === "dark" ? "text-grey-500" : "text-text-subtle", className),
|
|
8792
|
+
...rest
|
|
8793
|
+
});
|
|
8794
|
+
};
|
|
8770
8795
|
SelectMenuLabel.displayName = "SelectMenuLabel";
|
|
8771
8796
|
//#endregion
|
|
8772
8797
|
//#region src/components/select-menu/SelectMenuSeparator.tsx
|
|
8773
|
-
var
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8798
|
+
var Separator = styled(react_aria_components.Separator, {
|
|
8799
|
+
base: [
|
|
8800
|
+
"h-px",
|
|
8801
|
+
"bg-grey-200",
|
|
8802
|
+
"my-2",
|
|
8803
|
+
"mx-1"
|
|
8804
|
+
],
|
|
8805
|
+
variants: { colorMode: {
|
|
8806
|
+
light: [],
|
|
8807
|
+
dark: ["bg-grey-800"]
|
|
8808
|
+
} }
|
|
8809
|
+
}, { enablePolymorphism: false });
|
|
8810
|
+
var SelectMenuSeparator = (props) => {
|
|
8811
|
+
const { colorMode } = useSelectMenuContext();
|
|
8812
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Separator, {
|
|
8813
|
+
colorMode,
|
|
8814
|
+
...props
|
|
8815
|
+
});
|
|
8816
|
+
};
|
|
8779
8817
|
//#endregion
|
|
8780
8818
|
//#region src/components/select-menu/SelectMenuTrigger.tsx
|
|
8781
8819
|
var Trigger$2 = styled(react_aria_components.Button, {
|
|
@@ -8827,8 +8865,21 @@ var Trigger$2 = styled(react_aria_components.Button, {
|
|
|
8827
8865
|
white: ["bg-white"],
|
|
8828
8866
|
grey: ["bg-grey-100"]
|
|
8829
8867
|
},
|
|
8868
|
+
colorMode: {
|
|
8869
|
+
light: [],
|
|
8870
|
+
dark: [
|
|
8871
|
+
"bg-grey-900",
|
|
8872
|
+
"text-grey-200",
|
|
8873
|
+
"hover:bg-grey-800"
|
|
8874
|
+
]
|
|
8875
|
+
},
|
|
8830
8876
|
state: { error: ["bg-danger-light", "data-[focus-visible]:outline-danger"] }
|
|
8831
|
-
}
|
|
8877
|
+
},
|
|
8878
|
+
compoundVariants: [{
|
|
8879
|
+
colorMode: "dark",
|
|
8880
|
+
state: "error",
|
|
8881
|
+
class: ["text-grey-1000", "hover:bg-danger-light"]
|
|
8882
|
+
}]
|
|
8832
8883
|
}, { enablePolymorphism: false });
|
|
8833
8884
|
var TriggerIcon = styled(Icon, {
|
|
8834
8885
|
base: [
|
|
@@ -8838,18 +8889,25 @@ var TriggerIcon = styled(Icon, {
|
|
|
8838
8889
|
"pointer-events-none",
|
|
8839
8890
|
"text-grey-700"
|
|
8840
8891
|
],
|
|
8841
|
-
variants: {
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8892
|
+
variants: {
|
|
8893
|
+
size: {
|
|
8894
|
+
sm: ["right-2", "size-4"],
|
|
8895
|
+
md: ["right-3", "size-5"],
|
|
8896
|
+
lg: ["right-3", "size-5"]
|
|
8897
|
+
},
|
|
8898
|
+
colorMode: {
|
|
8899
|
+
light: [],
|
|
8900
|
+
dark: ["text-grey-200"]
|
|
8901
|
+
}
|
|
8902
|
+
}
|
|
8846
8903
|
});
|
|
8847
8904
|
var SelectMenuTrigger = ({ ref, placeholder, children, ...rest }) => {
|
|
8848
|
-
const { size, theme, state } = useSelectMenuContext();
|
|
8905
|
+
const { size, theme, colorMode, state } = useSelectMenuContext();
|
|
8849
8906
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Trigger$2, {
|
|
8850
8907
|
ref,
|
|
8851
8908
|
size,
|
|
8852
8909
|
theme,
|
|
8910
|
+
colorMode,
|
|
8853
8911
|
state,
|
|
8854
8912
|
...rest,
|
|
8855
8913
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.SelectValue, {
|
|
@@ -8857,21 +8915,24 @@ var SelectMenuTrigger = ({ ref, placeholder, children, ...rest }) => {
|
|
|
8857
8915
|
children: ({ isPlaceholder, selectedText }) => isPlaceholder ? placeholder ?? "" : children ?? selectedText
|
|
8858
8916
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TriggerIcon, {
|
|
8859
8917
|
is: _atom_learning_icons.ChevronDown,
|
|
8860
|
-
size
|
|
8918
|
+
size,
|
|
8919
|
+
colorMode
|
|
8861
8920
|
})]
|
|
8862
8921
|
});
|
|
8863
8922
|
};
|
|
8864
8923
|
//#endregion
|
|
8865
8924
|
//#region src/components/select-menu/SelectMenu.tsx
|
|
8866
|
-
var SelectMenuRoot = ({ size = "md", theme = "grey", state, className, children, ...rest }) => {
|
|
8925
|
+
var SelectMenuRoot = ({ size = "md", theme = "grey", colorMode = "light", state, className, children, ...rest }) => {
|
|
8867
8926
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectMenuContext, {
|
|
8868
8927
|
value: react.useMemo(() => ({
|
|
8869
8928
|
size,
|
|
8870
8929
|
theme,
|
|
8930
|
+
colorMode,
|
|
8871
8931
|
state
|
|
8872
8932
|
}), [
|
|
8873
8933
|
size,
|
|
8874
8934
|
theme,
|
|
8935
|
+
colorMode,
|
|
8875
8936
|
state
|
|
8876
8937
|
]),
|
|
8877
8938
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Select, {
|
|
@@ -10389,13 +10450,10 @@ var standardVariant = [
|
|
|
10389
10450
|
"not-disabled:data-[state=on]:before:bg-none",
|
|
10390
10451
|
"not-disabled:focus-visible:before:bg-none",
|
|
10391
10452
|
"not-disabled:focus-visible:data-[state=off]:border-grey-600!",
|
|
10392
|
-
"not-disabled:focus-visible:data-[state=on]:shadow-[var(--color-primary-800)_0px_0px_0px_4px]",
|
|
10393
10453
|
"not-disabled:focus-visible:data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px]",
|
|
10394
|
-
"not-disabled:focus-visible:data-[state=on]:shadow-[white_0px_0px_0px_2px]",
|
|
10395
10454
|
"not-disabled:focus-visible:outline-none",
|
|
10396
10455
|
"not-disabled:focus-visible:relative",
|
|
10397
|
-
"not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]",
|
|
10398
|
-
"not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]",
|
|
10456
|
+
"not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px,var(--color-primary-800)_0px_0px_0px_4px]!",
|
|
10399
10457
|
"not-disabled:focus-visible:z-1",
|
|
10400
10458
|
"not-disabled:hover:before:bg-none",
|
|
10401
10459
|
"not-disabled:hover:border-current!",
|
|
@@ -10413,26 +10471,54 @@ var modernVariant = [
|
|
|
10413
10471
|
"data-[state=on]:shadow-none!",
|
|
10414
10472
|
"data-[state=on]:text-grey-900",
|
|
10415
10473
|
"not-disabled:focus-visible:data-[state=off]:border-grey-600!",
|
|
10416
|
-
"not-disabled:focus-visible:data-[state=on]:shadow-[var(--color-primary-800)_0px_0px_0px_4px]",
|
|
10417
|
-
"not-disabled:focus-visible:data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px_white_0px_0px_0px_2px]",
|
|
10418
10474
|
"not-disabled:focus-visible:outline-none",
|
|
10419
10475
|
"not-disabled:focus-visible:relative",
|
|
10420
|
-
"not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]",
|
|
10421
|
-
"not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]",
|
|
10476
|
+
"not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px,var(--color-primary-800)_0px_0px_0px_4px]!",
|
|
10422
10477
|
"not-disabled:focus-visible:z-1",
|
|
10423
10478
|
"not-disabled:hover:text-primary-900"
|
|
10424
10479
|
];
|
|
10480
|
+
var darkBase = [
|
|
10481
|
+
"bg-transparent",
|
|
10482
|
+
"text-grey-200",
|
|
10483
|
+
"data-[state=on]:text-white",
|
|
10484
|
+
"not-disabled:hover:text-white",
|
|
10485
|
+
"not-disabled:focus-visible:shadow-[var(--color-grey-1000)_0px_0px_0px_2px,var(--color-primary-800)_0px_0px_0px_4px]!"
|
|
10486
|
+
];
|
|
10487
|
+
var standardDarkVariant = darkBase;
|
|
10488
|
+
var modernDarkVariant = [
|
|
10489
|
+
...darkBase,
|
|
10490
|
+
"data-[state=on]:bg-grey-900",
|
|
10491
|
+
"data-[state=on]:border-grey-800!"
|
|
10492
|
+
];
|
|
10425
10493
|
var ToggleGroupItem = styled(_radix_ui_react_toggle_group.Item, {
|
|
10426
10494
|
base: [
|
|
10427
10495
|
"cursor-pointer",
|
|
10428
10496
|
"disabled:cursor-not-allowed",
|
|
10429
10497
|
"disabled:opacity-30"
|
|
10430
10498
|
],
|
|
10431
|
-
variants: {
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10499
|
+
variants: {
|
|
10500
|
+
theme: {
|
|
10501
|
+
standard: standardVariant,
|
|
10502
|
+
modern: modernVariant
|
|
10503
|
+
},
|
|
10504
|
+
colorMode: {
|
|
10505
|
+
light: [],
|
|
10506
|
+
dark: []
|
|
10507
|
+
}
|
|
10508
|
+
},
|
|
10509
|
+
compoundVariants: [{
|
|
10510
|
+
theme: "standard",
|
|
10511
|
+
colorMode: "dark",
|
|
10512
|
+
class: standardDarkVariant
|
|
10513
|
+
}, {
|
|
10514
|
+
theme: "modern",
|
|
10515
|
+
colorMode: "dark",
|
|
10516
|
+
class: modernDarkVariant
|
|
10517
|
+
}],
|
|
10518
|
+
defaultVariants: {
|
|
10519
|
+
theme: "standard",
|
|
10520
|
+
colorMode: "light"
|
|
10521
|
+
}
|
|
10436
10522
|
}, { enablePolymorphism: false });
|
|
10437
10523
|
//#endregion
|
|
10438
10524
|
//#region src/components/toggle-group/ToggleGroupButton.tsx
|
|
@@ -10451,6 +10537,12 @@ var StyledButton$1 = styled(_radix_ui_react_toggle_group.Item, {
|
|
|
10451
10537
|
],
|
|
10452
10538
|
variants: {
|
|
10453
10539
|
size: {
|
|
10540
|
+
xs: [
|
|
10541
|
+
"*:not-last:mr-2",
|
|
10542
|
+
"min-h-8",
|
|
10543
|
+
"px-3",
|
|
10544
|
+
"text-sm"
|
|
10545
|
+
],
|
|
10454
10546
|
sm: [
|
|
10455
10547
|
"*:not-last:mr-2",
|
|
10456
10548
|
"min-h-8",
|
|
@@ -10474,9 +10566,28 @@ var StyledButton$1 = styled(_radix_ui_react_toggle_group.Item, {
|
|
|
10474
10566
|
theme: {
|
|
10475
10567
|
standard: standardVariant,
|
|
10476
10568
|
modern: modernVariant
|
|
10569
|
+
},
|
|
10570
|
+
colorMode: {
|
|
10571
|
+
light: [],
|
|
10572
|
+
dark: []
|
|
10477
10573
|
}
|
|
10478
10574
|
},
|
|
10479
10575
|
compoundVariants: [
|
|
10576
|
+
{
|
|
10577
|
+
theme: "standard",
|
|
10578
|
+
colorMode: "dark",
|
|
10579
|
+
class: standardDarkVariant
|
|
10580
|
+
},
|
|
10581
|
+
{
|
|
10582
|
+
theme: "modern",
|
|
10583
|
+
colorMode: "dark",
|
|
10584
|
+
class: modernDarkVariant
|
|
10585
|
+
},
|
|
10586
|
+
{
|
|
10587
|
+
isIconOnly: true,
|
|
10588
|
+
size: "xs",
|
|
10589
|
+
class: ["min-w-8", "p-0"]
|
|
10590
|
+
},
|
|
10480
10591
|
{
|
|
10481
10592
|
isIconOnly: true,
|
|
10482
10593
|
size: "sm",
|
|
@@ -10512,7 +10623,8 @@ var StyledButton$1 = styled(_radix_ui_react_toggle_group.Item, {
|
|
|
10512
10623
|
}
|
|
10513
10624
|
]
|
|
10514
10625
|
}, { enableResponsiveVariants: true });
|
|
10515
|
-
var
|
|
10626
|
+
var toIconSize = (size) => typeof size === "object" ? Object.fromEntries(Object.entries(size).map(([bp, s]) => [bp, s === "xs" ? "sm" : s])) : size === "xs" ? "sm" : size;
|
|
10627
|
+
var ToggleGroupButton = ({ ref, size = "md", theme = "standard", colorMode = "light", children, ...rest }) => {
|
|
10516
10628
|
const childrenArray = react.Children.toArray(children);
|
|
10517
10629
|
const isSingleChild = childrenArray.length <= 1;
|
|
10518
10630
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButton$1, {
|
|
@@ -10520,13 +10632,14 @@ var ToggleGroupButton = ({ ref, size = "md", theme = "standard", children, ...re
|
|
|
10520
10632
|
size,
|
|
10521
10633
|
isIconOnly: isSingleChild && react.isValidElement(childrenArray[0]) && childrenArray[0]?.type === Icon,
|
|
10522
10634
|
theme,
|
|
10635
|
+
colorMode,
|
|
10523
10636
|
...rest,
|
|
10524
10637
|
children: childrenArray.map((child) => {
|
|
10525
10638
|
if (!isSingleChild && (typeof child === "string" || typeof child === "number")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: child }, child);
|
|
10526
10639
|
if (react.isValidElement(child)) {
|
|
10527
10640
|
if (child?.type === Icon) return react.cloneElement(child, {
|
|
10528
10641
|
...child.props,
|
|
10529
|
-
size
|
|
10642
|
+
size: toIconSize(size)
|
|
10530
10643
|
});
|
|
10531
10644
|
}
|
|
10532
10645
|
return child;
|
|
@@ -10562,6 +10675,10 @@ var StyledRoot$1 = styled(ToggleGroup$1.Root, {
|
|
|
10562
10675
|
theme: {
|
|
10563
10676
|
standard: [],
|
|
10564
10677
|
modern: ["bg-grey-200"]
|
|
10678
|
+
},
|
|
10679
|
+
colorMode: {
|
|
10680
|
+
light: [],
|
|
10681
|
+
dark: []
|
|
10565
10682
|
}
|
|
10566
10683
|
},
|
|
10567
10684
|
compoundVariants: [
|
|
@@ -10611,6 +10728,16 @@ var StyledRoot$1 = styled(ToggleGroup$1.Root, {
|
|
|
10611
10728
|
"**:data-radix-collection-item:rounded-none",
|
|
10612
10729
|
"bg-white"
|
|
10613
10730
|
]
|
|
10731
|
+
},
|
|
10732
|
+
{
|
|
10733
|
+
theme: "standard",
|
|
10734
|
+
colorMode: "dark",
|
|
10735
|
+
class: ["bg-transparent"]
|
|
10736
|
+
},
|
|
10737
|
+
{
|
|
10738
|
+
theme: "modern",
|
|
10739
|
+
colorMode: "dark",
|
|
10740
|
+
class: ["bg-grey-800"]
|
|
10614
10741
|
}
|
|
10615
10742
|
]
|
|
10616
10743
|
});
|
|
@@ -10621,7 +10748,7 @@ var gapClassMap = {
|
|
|
10621
10748
|
3: "gap-3"
|
|
10622
10749
|
};
|
|
10623
10750
|
var orientationToDirection = (orientation) => orientation === "horizontal" ? "row" : "column";
|
|
10624
|
-
var ToggleGroupRoot = ({ ref, orientation = "horizontal", gap, isFullWidth, children, theme = "standard", wrap, ...rest }) => {
|
|
10751
|
+
var ToggleGroupRoot = ({ ref, orientation = "horizontal", gap, isFullWidth, children, theme = "standard", colorMode = "light", wrap, ...rest }) => {
|
|
10625
10752
|
const hasGap = typeof gap === "number";
|
|
10626
10753
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledRoot$1, {
|
|
10627
10754
|
ref,
|
|
@@ -10630,13 +10757,15 @@ var ToggleGroupRoot = ({ ref, orientation = "horizontal", gap, isFullWidth, chil
|
|
|
10630
10757
|
isFullWidth,
|
|
10631
10758
|
orientation,
|
|
10632
10759
|
theme,
|
|
10760
|
+
colorMode,
|
|
10633
10761
|
...rest,
|
|
10634
10762
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
10635
10763
|
className: cn("flex", hasGap && gapClassMap[gap], orientation === "horizontal" ? "flex-row" : "flex-col", wrap ? "flex-wrap" : "flex-nowrap"),
|
|
10636
10764
|
children: react.Children.toArray(children).map((child) => {
|
|
10637
10765
|
if (react.isValidElement(child)) return react.cloneElement(child, {
|
|
10638
10766
|
...child.props,
|
|
10639
|
-
theme
|
|
10767
|
+
theme,
|
|
10768
|
+
colorMode
|
|
10640
10769
|
});
|
|
10641
10770
|
return child;
|
|
10642
10771
|
})
|