@atom-learning/components 11.4.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/badge/Badge.colorscheme.config.d.ts +10 -0
- package/dist/components/badge/Badge.colorscheme.config.js +2 -1
- package/dist/components/badge/Badge.colorscheme.config.js.map +1 -1
- 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 +209 -79
- package/dist/index.cjs.js.map +1 -1
- package/package.json +2 -2
- 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
|
};
|
|
@@ -1746,7 +1746,8 @@ var colorSchemes$3 = {
|
|
|
1746
1746
|
"--text-on-white": "var(--color-lapis-700)"
|
|
1747
1747
|
}),
|
|
1748
1748
|
maroon: createScheme("maroon", { "--text-on-white": "var(--color-maroon-700)" }),
|
|
1749
|
-
marsh: createScheme("marsh", { "--text-on-white": "var(--color-marsh-700)" })
|
|
1749
|
+
marsh: createScheme("marsh", { "--text-on-white": "var(--color-marsh-700)" }),
|
|
1750
|
+
emerald: createScheme("emerald")
|
|
1750
1751
|
};
|
|
1751
1752
|
//#endregion
|
|
1752
1753
|
//#region src/components/badge/Badge.context.tsx
|
|
@@ -2762,12 +2763,12 @@ var StyledCheckbox = styled(_radix_ui_react_checkbox.Root, {
|
|
|
2762
2763
|
}
|
|
2763
2764
|
}
|
|
2764
2765
|
});
|
|
2765
|
-
var toIconSize$
|
|
2766
|
+
var toIconSize$3 = {
|
|
2766
2767
|
md: "sm",
|
|
2767
2768
|
lg: "sm"
|
|
2768
2769
|
};
|
|
2769
2770
|
var Checkbox = ({ ref, size = "md", checked, ...rest }) => {
|
|
2770
|
-
const iconSize = overrideStyledVariantValue(size, (s) => toIconSize$
|
|
2771
|
+
const iconSize = overrideStyledVariantValue(size, (s) => toIconSize$3[s]);
|
|
2771
2772
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2772
2773
|
className: "relative z-1",
|
|
2773
2774
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledCheckbox, {
|
|
@@ -3437,14 +3438,14 @@ var StyledChipContent = styled("span", { base: [
|
|
|
3437
3438
|
"whitespace-nowrap",
|
|
3438
3439
|
"*:not-last:mr-1"
|
|
3439
3440
|
] });
|
|
3440
|
-
var toIconSize$
|
|
3441
|
+
var toIconSize$2 = {
|
|
3441
3442
|
sm: "sm",
|
|
3442
3443
|
md: "sm",
|
|
3443
3444
|
lg: "md"
|
|
3444
3445
|
};
|
|
3445
3446
|
var ChipIcon = (props) => {
|
|
3446
3447
|
const { size } = react.use(ChipRootContext);
|
|
3447
|
-
const iconSize = overrideStyledVariantValue(size, (s) => toIconSize$
|
|
3448
|
+
const iconSize = overrideStyledVariantValue(size, (s) => toIconSize$2[s]);
|
|
3448
3449
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
3449
3450
|
...props,
|
|
3450
3451
|
size: iconSize
|
|
@@ -3872,12 +3873,12 @@ var FormCustomContext = react.createContext({ appearance: "standard" });
|
|
|
3872
3873
|
var useFormCustomContext = () => react.use(FormCustomContext);
|
|
3873
3874
|
//#endregion
|
|
3874
3875
|
//#region src/utilities/style/get-icon-size.ts
|
|
3875
|
-
var toIconSize = {
|
|
3876
|
+
var toIconSize$1 = {
|
|
3876
3877
|
sm: "sm",
|
|
3877
3878
|
md: "md",
|
|
3878
3879
|
lg: "md"
|
|
3879
3880
|
};
|
|
3880
|
-
var getFieldIconSize = (size) => overrideStyledVariantValue(size, (s) => toIconSize[s]);
|
|
3881
|
+
var getFieldIconSize = (size) => overrideStyledVariantValue(size, (s) => toIconSize$1[s]);
|
|
3881
3882
|
//#endregion
|
|
3882
3883
|
//#region src/components/input/Input.tsx
|
|
3883
3884
|
var InputBackground = styled("div", {
|
|
@@ -8670,7 +8671,8 @@ SelectField.displayName = "SelectField";
|
|
|
8670
8671
|
//#region src/components/select-menu/SelectMenu.context.tsx
|
|
8671
8672
|
var SelectMenuContext = react.createContext({
|
|
8672
8673
|
size: "md",
|
|
8673
|
-
theme: "grey"
|
|
8674
|
+
theme: "grey",
|
|
8675
|
+
colorMode: "light"
|
|
8674
8676
|
});
|
|
8675
8677
|
var useSelectMenuContext = () => react.use(SelectMenuContext);
|
|
8676
8678
|
//#endregion
|
|
@@ -8684,10 +8686,16 @@ var Content$2 = styled(react_aria_components.Popover, {
|
|
|
8684
8686
|
"overflow-hidden",
|
|
8685
8687
|
"will-change-transform"
|
|
8686
8688
|
],
|
|
8687
|
-
variants: {
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
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
|
+
}
|
|
8691
8699
|
}, { enablePolymorphism: false });
|
|
8692
8700
|
var Viewport = styled(react_aria_components.ListBox, { base: [
|
|
8693
8701
|
"max-h-[inherit]",
|
|
@@ -8696,14 +8704,18 @@ var Viewport = styled(react_aria_components.ListBox, { base: [
|
|
|
8696
8704
|
"p-1",
|
|
8697
8705
|
"outline-none"
|
|
8698
8706
|
] }, { enablePolymorphism: false });
|
|
8699
|
-
var SelectMenuContent = ({ ref, children, offset = 4, matchTriggerWidth = false, ...rest }) =>
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
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
|
+
};
|
|
8707
8719
|
//#endregion
|
|
8708
8720
|
//#region src/components/select-menu/SelectMenuItem.tsx
|
|
8709
8721
|
var Item = styled(react_aria_components.ListBoxItem, {
|
|
@@ -8724,29 +8736,40 @@ var Item = styled(react_aria_components.ListBoxItem, {
|
|
|
8724
8736
|
"data-[focused]:bg-grey-100",
|
|
8725
8737
|
"data-[focus-visible]:outline-none"
|
|
8726
8738
|
],
|
|
8727
|
-
variants: {
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
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
|
+
}
|
|
8745
8767
|
}, { enablePolymorphism: false });
|
|
8746
8768
|
var SelectMenuItem = ({ children, textValue, ...rest }) => {
|
|
8747
|
-
const { size } = useSelectMenuContext();
|
|
8769
|
+
const { size, colorMode } = useSelectMenuContext();
|
|
8748
8770
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Item, {
|
|
8749
8771
|
size,
|
|
8772
|
+
colorMode,
|
|
8750
8773
|
textValue: textValue ?? (typeof children === "string" || typeof children === "number" ? String(children) : void 0),
|
|
8751
8774
|
...rest,
|
|
8752
8775
|
children: ({ isSelected }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -8760,21 +8783,37 @@ var SelectMenuItem = ({ children, textValue, ...rest }) => {
|
|
|
8760
8783
|
};
|
|
8761
8784
|
//#endregion
|
|
8762
8785
|
//#region src/components/select-menu/SelectMenuLabel.tsx
|
|
8763
|
-
var SelectMenuLabel = ({ className, ...rest }) =>
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
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
|
+
};
|
|
8769
8795
|
SelectMenuLabel.displayName = "SelectMenuLabel";
|
|
8770
8796
|
//#endregion
|
|
8771
8797
|
//#region src/components/select-menu/SelectMenuSeparator.tsx
|
|
8772
|
-
var
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
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
|
+
};
|
|
8778
8817
|
//#endregion
|
|
8779
8818
|
//#region src/components/select-menu/SelectMenuTrigger.tsx
|
|
8780
8819
|
var Trigger$2 = styled(react_aria_components.Button, {
|
|
@@ -8826,8 +8865,21 @@ var Trigger$2 = styled(react_aria_components.Button, {
|
|
|
8826
8865
|
white: ["bg-white"],
|
|
8827
8866
|
grey: ["bg-grey-100"]
|
|
8828
8867
|
},
|
|
8868
|
+
colorMode: {
|
|
8869
|
+
light: [],
|
|
8870
|
+
dark: [
|
|
8871
|
+
"bg-grey-900",
|
|
8872
|
+
"text-grey-200",
|
|
8873
|
+
"hover:bg-grey-800"
|
|
8874
|
+
]
|
|
8875
|
+
},
|
|
8829
8876
|
state: { error: ["bg-danger-light", "data-[focus-visible]:outline-danger"] }
|
|
8830
|
-
}
|
|
8877
|
+
},
|
|
8878
|
+
compoundVariants: [{
|
|
8879
|
+
colorMode: "dark",
|
|
8880
|
+
state: "error",
|
|
8881
|
+
class: ["text-grey-1000", "hover:bg-danger-light"]
|
|
8882
|
+
}]
|
|
8831
8883
|
}, { enablePolymorphism: false });
|
|
8832
8884
|
var TriggerIcon = styled(Icon, {
|
|
8833
8885
|
base: [
|
|
@@ -8837,18 +8889,25 @@ var TriggerIcon = styled(Icon, {
|
|
|
8837
8889
|
"pointer-events-none",
|
|
8838
8890
|
"text-grey-700"
|
|
8839
8891
|
],
|
|
8840
|
-
variants: {
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
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
|
+
}
|
|
8845
8903
|
});
|
|
8846
8904
|
var SelectMenuTrigger = ({ ref, placeholder, children, ...rest }) => {
|
|
8847
|
-
const { size, theme, state } = useSelectMenuContext();
|
|
8905
|
+
const { size, theme, colorMode, state } = useSelectMenuContext();
|
|
8848
8906
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Trigger$2, {
|
|
8849
8907
|
ref,
|
|
8850
8908
|
size,
|
|
8851
8909
|
theme,
|
|
8910
|
+
colorMode,
|
|
8852
8911
|
state,
|
|
8853
8912
|
...rest,
|
|
8854
8913
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.SelectValue, {
|
|
@@ -8856,21 +8915,24 @@ var SelectMenuTrigger = ({ ref, placeholder, children, ...rest }) => {
|
|
|
8856
8915
|
children: ({ isPlaceholder, selectedText }) => isPlaceholder ? placeholder ?? "" : children ?? selectedText
|
|
8857
8916
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TriggerIcon, {
|
|
8858
8917
|
is: _atom_learning_icons.ChevronDown,
|
|
8859
|
-
size
|
|
8918
|
+
size,
|
|
8919
|
+
colorMode
|
|
8860
8920
|
})]
|
|
8861
8921
|
});
|
|
8862
8922
|
};
|
|
8863
8923
|
//#endregion
|
|
8864
8924
|
//#region src/components/select-menu/SelectMenu.tsx
|
|
8865
|
-
var SelectMenuRoot = ({ size = "md", theme = "grey", state, className, children, ...rest }) => {
|
|
8925
|
+
var SelectMenuRoot = ({ size = "md", theme = "grey", colorMode = "light", state, className, children, ...rest }) => {
|
|
8866
8926
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectMenuContext, {
|
|
8867
8927
|
value: react.useMemo(() => ({
|
|
8868
8928
|
size,
|
|
8869
8929
|
theme,
|
|
8930
|
+
colorMode,
|
|
8870
8931
|
state
|
|
8871
8932
|
}), [
|
|
8872
8933
|
size,
|
|
8873
8934
|
theme,
|
|
8935
|
+
colorMode,
|
|
8874
8936
|
state
|
|
8875
8937
|
]),
|
|
8876
8938
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Select, {
|
|
@@ -10388,13 +10450,10 @@ var standardVariant = [
|
|
|
10388
10450
|
"not-disabled:data-[state=on]:before:bg-none",
|
|
10389
10451
|
"not-disabled:focus-visible:before:bg-none",
|
|
10390
10452
|
"not-disabled:focus-visible:data-[state=off]:border-grey-600!",
|
|
10391
|
-
"not-disabled:focus-visible:data-[state=on]:shadow-[var(--color-primary-800)_0px_0px_0px_4px]",
|
|
10392
10453
|
"not-disabled:focus-visible:data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px]",
|
|
10393
|
-
"not-disabled:focus-visible:data-[state=on]:shadow-[white_0px_0px_0px_2px]",
|
|
10394
10454
|
"not-disabled:focus-visible:outline-none",
|
|
10395
10455
|
"not-disabled:focus-visible:relative",
|
|
10396
|
-
"not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]",
|
|
10397
|
-
"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]!",
|
|
10398
10457
|
"not-disabled:focus-visible:z-1",
|
|
10399
10458
|
"not-disabled:hover:before:bg-none",
|
|
10400
10459
|
"not-disabled:hover:border-current!",
|
|
@@ -10412,26 +10471,54 @@ var modernVariant = [
|
|
|
10412
10471
|
"data-[state=on]:shadow-none!",
|
|
10413
10472
|
"data-[state=on]:text-grey-900",
|
|
10414
10473
|
"not-disabled:focus-visible:data-[state=off]:border-grey-600!",
|
|
10415
|
-
"not-disabled:focus-visible:data-[state=on]:shadow-[var(--color-primary-800)_0px_0px_0px_4px]",
|
|
10416
|
-
"not-disabled:focus-visible:data-[state=on]:inset-shadow-[currentColor_0px_0px_0px_1px_white_0px_0px_0px_2px]",
|
|
10417
10474
|
"not-disabled:focus-visible:outline-none",
|
|
10418
10475
|
"not-disabled:focus-visible:relative",
|
|
10419
|
-
"not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]",
|
|
10420
|
-
"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]!",
|
|
10421
10477
|
"not-disabled:focus-visible:z-1",
|
|
10422
10478
|
"not-disabled:hover:text-primary-900"
|
|
10423
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
|
+
];
|
|
10424
10493
|
var ToggleGroupItem = styled(_radix_ui_react_toggle_group.Item, {
|
|
10425
10494
|
base: [
|
|
10426
10495
|
"cursor-pointer",
|
|
10427
10496
|
"disabled:cursor-not-allowed",
|
|
10428
10497
|
"disabled:opacity-30"
|
|
10429
10498
|
],
|
|
10430
|
-
variants: {
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
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
|
+
}
|
|
10435
10522
|
}, { enablePolymorphism: false });
|
|
10436
10523
|
//#endregion
|
|
10437
10524
|
//#region src/components/toggle-group/ToggleGroupButton.tsx
|
|
@@ -10450,6 +10537,12 @@ var StyledButton$1 = styled(_radix_ui_react_toggle_group.Item, {
|
|
|
10450
10537
|
],
|
|
10451
10538
|
variants: {
|
|
10452
10539
|
size: {
|
|
10540
|
+
xs: [
|
|
10541
|
+
"*:not-last:mr-2",
|
|
10542
|
+
"min-h-8",
|
|
10543
|
+
"px-3",
|
|
10544
|
+
"text-sm"
|
|
10545
|
+
],
|
|
10453
10546
|
sm: [
|
|
10454
10547
|
"*:not-last:mr-2",
|
|
10455
10548
|
"min-h-8",
|
|
@@ -10473,9 +10566,28 @@ var StyledButton$1 = styled(_radix_ui_react_toggle_group.Item, {
|
|
|
10473
10566
|
theme: {
|
|
10474
10567
|
standard: standardVariant,
|
|
10475
10568
|
modern: modernVariant
|
|
10569
|
+
},
|
|
10570
|
+
colorMode: {
|
|
10571
|
+
light: [],
|
|
10572
|
+
dark: []
|
|
10476
10573
|
}
|
|
10477
10574
|
},
|
|
10478
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
|
+
},
|
|
10479
10591
|
{
|
|
10480
10592
|
isIconOnly: true,
|
|
10481
10593
|
size: "sm",
|
|
@@ -10511,7 +10623,8 @@ var StyledButton$1 = styled(_radix_ui_react_toggle_group.Item, {
|
|
|
10511
10623
|
}
|
|
10512
10624
|
]
|
|
10513
10625
|
}, { enableResponsiveVariants: true });
|
|
10514
|
-
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 }) => {
|
|
10515
10628
|
const childrenArray = react.Children.toArray(children);
|
|
10516
10629
|
const isSingleChild = childrenArray.length <= 1;
|
|
10517
10630
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButton$1, {
|
|
@@ -10519,13 +10632,14 @@ var ToggleGroupButton = ({ ref, size = "md", theme = "standard", children, ...re
|
|
|
10519
10632
|
size,
|
|
10520
10633
|
isIconOnly: isSingleChild && react.isValidElement(childrenArray[0]) && childrenArray[0]?.type === Icon,
|
|
10521
10634
|
theme,
|
|
10635
|
+
colorMode,
|
|
10522
10636
|
...rest,
|
|
10523
10637
|
children: childrenArray.map((child) => {
|
|
10524
10638
|
if (!isSingleChild && (typeof child === "string" || typeof child === "number")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: child }, child);
|
|
10525
10639
|
if (react.isValidElement(child)) {
|
|
10526
10640
|
if (child?.type === Icon) return react.cloneElement(child, {
|
|
10527
10641
|
...child.props,
|
|
10528
|
-
size
|
|
10642
|
+
size: toIconSize(size)
|
|
10529
10643
|
});
|
|
10530
10644
|
}
|
|
10531
10645
|
return child;
|
|
@@ -10561,6 +10675,10 @@ var StyledRoot$1 = styled(ToggleGroup$1.Root, {
|
|
|
10561
10675
|
theme: {
|
|
10562
10676
|
standard: [],
|
|
10563
10677
|
modern: ["bg-grey-200"]
|
|
10678
|
+
},
|
|
10679
|
+
colorMode: {
|
|
10680
|
+
light: [],
|
|
10681
|
+
dark: []
|
|
10564
10682
|
}
|
|
10565
10683
|
},
|
|
10566
10684
|
compoundVariants: [
|
|
@@ -10610,6 +10728,16 @@ var StyledRoot$1 = styled(ToggleGroup$1.Root, {
|
|
|
10610
10728
|
"**:data-radix-collection-item:rounded-none",
|
|
10611
10729
|
"bg-white"
|
|
10612
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"]
|
|
10613
10741
|
}
|
|
10614
10742
|
]
|
|
10615
10743
|
});
|
|
@@ -10620,7 +10748,7 @@ var gapClassMap = {
|
|
|
10620
10748
|
3: "gap-3"
|
|
10621
10749
|
};
|
|
10622
10750
|
var orientationToDirection = (orientation) => orientation === "horizontal" ? "row" : "column";
|
|
10623
|
-
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 }) => {
|
|
10624
10752
|
const hasGap = typeof gap === "number";
|
|
10625
10753
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledRoot$1, {
|
|
10626
10754
|
ref,
|
|
@@ -10629,13 +10757,15 @@ var ToggleGroupRoot = ({ ref, orientation = "horizontal", gap, isFullWidth, chil
|
|
|
10629
10757
|
isFullWidth,
|
|
10630
10758
|
orientation,
|
|
10631
10759
|
theme,
|
|
10760
|
+
colorMode,
|
|
10632
10761
|
...rest,
|
|
10633
10762
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
10634
10763
|
className: cn("flex", hasGap && gapClassMap[gap], orientation === "horizontal" ? "flex-row" : "flex-col", wrap ? "flex-wrap" : "flex-nowrap"),
|
|
10635
10764
|
children: react.Children.toArray(children).map((child) => {
|
|
10636
10765
|
if (react.isValidElement(child)) return react.cloneElement(child, {
|
|
10637
10766
|
...child.props,
|
|
10638
|
-
theme
|
|
10767
|
+
theme,
|
|
10768
|
+
colorMode
|
|
10639
10769
|
});
|
|
10640
10770
|
return child;
|
|
10641
10771
|
})
|