@atom-learning/components 9.0.0-beta.5 → 9.0.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/button/Button.js +5 -1
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/dialog/DialogContent.js +19 -6
- package/dist/components/dialog/DialogContent.js.map +1 -1
- package/dist/components/index.d.ts +0 -3
- package/dist/components/index.js +1 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/navigation/NavigationMenu.js +1 -1
- package/dist/components/navigation/NavigationMenu.js.map +1 -1
- package/dist/components/segmented-control/SegmentedControlRoot.js +4 -1
- package/dist/components/segmented-control/SegmentedControlRoot.js.map +1 -1
- package/dist/components/skeleton-loader/SkeletonCard.js.map +1 -1
- package/dist/components/toast/ToastProvider.js +2 -2
- package/dist/components/toast/ToastProvider.js.map +1 -1
- package/dist/components/top-bar/TopBar.js +4 -4
- package/dist/components/top-bar/TopBar.js.map +1 -1
- package/dist/docgen.json +1 -1
- package/dist/index.cjs.js +35 -135
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -4
- package/package.json +3 -1
- package/src/index.css +2 -0
- package/src/responsive-variant-classes.css +1 -1
- package/src/utilities.css +6 -0
- package/dist/components/box/Box.d.ts +0 -1
- package/dist/components/box/Box.js +0 -8
- package/dist/components/box/Box.js.map +0 -1
- package/dist/components/flex/Flex.d.ts +0 -7
- package/dist/components/flex/Flex.js +0 -88
- package/dist/components/flex/Flex.js.map +0 -1
- package/dist/components/grid/Grid.d.ts +0 -13
- package/dist/components/grid/Grid.js +0 -35
- package/dist/components/grid/Grid.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -380,7 +380,11 @@ var StyledButton = styled("button", {
|
|
|
380
380
|
"[&_svg]:size-[22px]"
|
|
381
381
|
]
|
|
382
382
|
},
|
|
383
|
-
isLoading: { true: [
|
|
383
|
+
isLoading: { true: [
|
|
384
|
+
"cursor-not-allowed",
|
|
385
|
+
"opacity-60",
|
|
386
|
+
"pointer-events-none"
|
|
387
|
+
] },
|
|
384
388
|
fullWidth: {
|
|
385
389
|
true: ["w-full"],
|
|
386
390
|
false: ["w-max"]
|
|
@@ -2359,10 +2363,6 @@ var BannerSlim = /* @__PURE__ */ Object.assign(BannerSlimComponent, {
|
|
|
2359
2363
|
});
|
|
2360
2364
|
BannerSlimComponent.displayName = "BannerSlim";
|
|
2361
2365
|
//#endregion
|
|
2362
|
-
//#region src/components/box/Box.tsx
|
|
2363
|
-
var Box = styled("div", { base: [] });
|
|
2364
|
-
Box.displayName = "Box";
|
|
2365
|
-
//#endregion
|
|
2366
2366
|
//#region src/components/carousel/CarouselArrows.tsx
|
|
2367
2367
|
var ArrowButton = /* @__PURE__ */ styled("button", { base: [
|
|
2368
2368
|
"items-center",
|
|
@@ -6418,7 +6418,9 @@ var StyledDialogContent = styled(_radix_ui_react_dialog.Content, {
|
|
|
6418
6418
|
"max-h-[90vh]",
|
|
6419
6419
|
"supports-svh:h-auto",
|
|
6420
6420
|
"supports-svh:max-h-[90vh]",
|
|
6421
|
-
"w-95"
|
|
6421
|
+
"w-95",
|
|
6422
|
+
"[&>[data-dialog-close]]:top-4",
|
|
6423
|
+
"[&>[data-dialog-close]]:right-4"
|
|
6422
6424
|
],
|
|
6423
6425
|
sm: [
|
|
6424
6426
|
"rounded-md",
|
|
@@ -6427,7 +6429,9 @@ var StyledDialogContent = styled(_radix_ui_react_dialog.Content, {
|
|
|
6427
6429
|
"max-h-[90vh]",
|
|
6428
6430
|
"supports-svh:h-auto",
|
|
6429
6431
|
"supports-svh:max-h-[90vh]",
|
|
6430
|
-
"w-120"
|
|
6432
|
+
"w-120",
|
|
6433
|
+
"[&>[data-dialog-close]]:top-4",
|
|
6434
|
+
"[&>[data-dialog-close]]:right-4"
|
|
6431
6435
|
],
|
|
6432
6436
|
md: [
|
|
6433
6437
|
"rounded-md",
|
|
@@ -6436,7 +6440,9 @@ var StyledDialogContent = styled(_radix_ui_react_dialog.Content, {
|
|
|
6436
6440
|
"max-h-[90vh]",
|
|
6437
6441
|
"supports-svh:h-auto",
|
|
6438
6442
|
"supports-svh:max-h-[90vh]",
|
|
6439
|
-
"w-150"
|
|
6443
|
+
"w-150",
|
|
6444
|
+
"[&>[data-dialog-close]]:top-4",
|
|
6445
|
+
"[&>[data-dialog-close]]:right-4"
|
|
6440
6446
|
],
|
|
6441
6447
|
lg: [
|
|
6442
6448
|
"rounded-md",
|
|
@@ -6445,7 +6451,9 @@ var StyledDialogContent = styled(_radix_ui_react_dialog.Content, {
|
|
|
6445
6451
|
"max-h-[90vh]",
|
|
6446
6452
|
"supports-svh:h-auto",
|
|
6447
6453
|
"supports-svh:max-h-[90vh]",
|
|
6448
|
-
"w-200"
|
|
6454
|
+
"w-200",
|
|
6455
|
+
"[&>[data-dialog-close]]:top-4",
|
|
6456
|
+
"[&>[data-dialog-close]]:right-4"
|
|
6449
6457
|
],
|
|
6450
6458
|
xl: [
|
|
6451
6459
|
"rounded-md",
|
|
@@ -6454,7 +6462,9 @@ var StyledDialogContent = styled(_radix_ui_react_dialog.Content, {
|
|
|
6454
6462
|
"max-h-[90vh]",
|
|
6455
6463
|
"supports-svh:h-auto",
|
|
6456
6464
|
"supports-svh:max-h-[90vh]",
|
|
6457
|
-
"w-275"
|
|
6465
|
+
"w-275",
|
|
6466
|
+
"[&>[data-dialog-close]]:top-4",
|
|
6467
|
+
"[&>[data-dialog-close]]:right-4"
|
|
6458
6468
|
],
|
|
6459
6469
|
fullscreen: [
|
|
6460
6470
|
"rounded-none",
|
|
@@ -6463,7 +6473,9 @@ var StyledDialogContent = styled(_radix_ui_react_dialog.Content, {
|
|
|
6463
6473
|
"max-w-screen",
|
|
6464
6474
|
"max-h-screen",
|
|
6465
6475
|
"supports-svh:h-svh",
|
|
6466
|
-
"supports-svh:max-h-svh"
|
|
6476
|
+
"supports-svh:max-h-svh",
|
|
6477
|
+
"[&>[data-dialog-close]]:top-safe-offset-4",
|
|
6478
|
+
"[&>[data-dialog-close]]:right-safe-offset-4"
|
|
6467
6479
|
]
|
|
6468
6480
|
},
|
|
6469
6481
|
layout: { panel: [
|
|
@@ -6488,6 +6500,7 @@ var DialogContent = ({ size = "sm", children, closeDialogText = "Close dialog",
|
|
|
6488
6500
|
hasTooltip: false,
|
|
6489
6501
|
size: "md",
|
|
6490
6502
|
theme: "neutral",
|
|
6503
|
+
"data-dialog-close": true,
|
|
6491
6504
|
className: "absolute top-4 right-4 size-12",
|
|
6492
6505
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { is: _atom_learning_icons.Close })
|
|
6493
6506
|
}), react.Children.map(children, (child) => react.isValidElement(child) && child.type === DialogBackground ? null : child)]
|
|
@@ -6812,90 +6825,6 @@ var FileInput = ({ accept, children, className, disabled = false, multiple = fal
|
|
|
6812
6825
|
};
|
|
6813
6826
|
FileInput.displayName = "FileInput";
|
|
6814
6827
|
//#endregion
|
|
6815
|
-
//#region src/components/flex/Flex.tsx
|
|
6816
|
-
var Flex = styled("div", {
|
|
6817
|
-
base: ["flex"],
|
|
6818
|
-
variants: {
|
|
6819
|
-
direction: {
|
|
6820
|
-
row: ["flex-row"],
|
|
6821
|
-
"row-reverse": ["flex-row-reverse"],
|
|
6822
|
-
column: ["flex-col"],
|
|
6823
|
-
"column-reverse": ["flex-col-reverse"],
|
|
6824
|
-
inherit: ["direction-[inherit]"],
|
|
6825
|
-
initial: ["direction-[initial]"],
|
|
6826
|
-
revert: ["direction-[revert]"],
|
|
6827
|
-
"revert-layer": ["direction-[revert-layer]"],
|
|
6828
|
-
unset: ["direction-[unset]"]
|
|
6829
|
-
},
|
|
6830
|
-
wrap: {
|
|
6831
|
-
nowrap: ["flex-nowrap"],
|
|
6832
|
-
wrap: ["flex-wrap"],
|
|
6833
|
-
"wrap-reverse": ["flex-wrap-reverse"],
|
|
6834
|
-
inherit: ["[flex-wrap:inherit]"],
|
|
6835
|
-
initial: ["[flex-wrap:initial]"],
|
|
6836
|
-
revert: ["[flex-wrap:revert]"],
|
|
6837
|
-
"revert-layer": ["[flex-wrap:revert-layer]"],
|
|
6838
|
-
unset: ["[flex-wrap:unset]"]
|
|
6839
|
-
},
|
|
6840
|
-
justify: {
|
|
6841
|
-
normal: ["justify-normal"],
|
|
6842
|
-
unsafe: ["[justify-content:unsafe]"],
|
|
6843
|
-
safe: ["[justify-content:safe]"],
|
|
6844
|
-
start: ["justify-start"],
|
|
6845
|
-
center: ["justify-center"],
|
|
6846
|
-
end: ["justify-end"],
|
|
6847
|
-
"flex-start": ["justify-start"],
|
|
6848
|
-
"flex-end": ["justify-end"],
|
|
6849
|
-
left: ["[justify-content:left]"],
|
|
6850
|
-
right: ["[justify-content:right]"],
|
|
6851
|
-
"space-between": ["justify-between"],
|
|
6852
|
-
"space-around": ["justify-around"],
|
|
6853
|
-
"space-evenly": ["justify-evenly"],
|
|
6854
|
-
stretch: ["justify-stretch"],
|
|
6855
|
-
inherit: ["[justify-content:inherit]"],
|
|
6856
|
-
initial: ["[justify-content:initial]"],
|
|
6857
|
-
revert: ["[justify-content:revert]"],
|
|
6858
|
-
"revert-layer": ["[justify-content:revert-layer]"],
|
|
6859
|
-
unset: ["[justify-content:unset]"]
|
|
6860
|
-
},
|
|
6861
|
-
align: {
|
|
6862
|
-
normal: ["[align-items:normal]"],
|
|
6863
|
-
unsafe: ["[align-items:unsafe]"],
|
|
6864
|
-
safe: ["[align-items:safe]"],
|
|
6865
|
-
center: ["items-center"],
|
|
6866
|
-
start: ["items-start"],
|
|
6867
|
-
end: ["items-end"],
|
|
6868
|
-
"self-start": ["[align-items:self-start]"],
|
|
6869
|
-
"self-end": ["[align-items:self-end]"],
|
|
6870
|
-
"flex-start": ["items-start"],
|
|
6871
|
-
"flex-end": ["items-end"],
|
|
6872
|
-
baseline: ["items-baseline"],
|
|
6873
|
-
"first baseline": ["[align-items:first baseline]"],
|
|
6874
|
-
"last baseline": ["[align-items:last baseline]"],
|
|
6875
|
-
stretch: ["items-stretch"],
|
|
6876
|
-
inherit: ["[align-items:inherit]"],
|
|
6877
|
-
initial: ["[align-items:initial]"],
|
|
6878
|
-
revert: ["[align-items:revert]"],
|
|
6879
|
-
"revert-layer": ["[align-items:revert-layer]"],
|
|
6880
|
-
unset: ["[align-items:unset]"]
|
|
6881
|
-
},
|
|
6882
|
-
gap: {
|
|
6883
|
-
0: ["gap-0.5"],
|
|
6884
|
-
1: ["gap-1"],
|
|
6885
|
-
2: ["gap-2"],
|
|
6886
|
-
3: ["gap-3"],
|
|
6887
|
-
4: ["gap-4"],
|
|
6888
|
-
24: ["gap-6"],
|
|
6889
|
-
5: ["gap-8"],
|
|
6890
|
-
6: ["gap-10"],
|
|
6891
|
-
7: ["gap-12"],
|
|
6892
|
-
8: ["gap-16"],
|
|
6893
|
-
9: ["gap-20"]
|
|
6894
|
-
}
|
|
6895
|
-
}
|
|
6896
|
-
}, { enableResponsiveVariants: true });
|
|
6897
|
-
Flex.displayName = "Flex";
|
|
6898
|
-
//#endregion
|
|
6899
6828
|
//#region src/components/form/Form.tsx
|
|
6900
6829
|
var Form = (props) => {
|
|
6901
6830
|
const { children, defaultValues, validationMode = "onBlur", onSubmit, onError, appearance, theme, ...rest } = props;
|
|
@@ -6921,35 +6850,6 @@ var Form = (props) => {
|
|
|
6921
6850
|
};
|
|
6922
6851
|
Form.displayName = "Form";
|
|
6923
6852
|
//#endregion
|
|
6924
|
-
//#region src/components/grid/Grid.tsx
|
|
6925
|
-
var GridContainer = styled("div", {
|
|
6926
|
-
base: ["grid"],
|
|
6927
|
-
variants: { gap: {
|
|
6928
|
-
0: ["gap-0.5"],
|
|
6929
|
-
1: ["gap-1"],
|
|
6930
|
-
2: ["gap-2"],
|
|
6931
|
-
3: ["gap-3"],
|
|
6932
|
-
4: ["gap-4"],
|
|
6933
|
-
24: ["gap-6"],
|
|
6934
|
-
5: ["gap-8"],
|
|
6935
|
-
6: ["gap-10"],
|
|
6936
|
-
7: ["gap-12"],
|
|
6937
|
-
8: ["gap-16"],
|
|
6938
|
-
9: ["gap-20"]
|
|
6939
|
-
} }
|
|
6940
|
-
}, { enableResponsiveVariants: true });
|
|
6941
|
-
var Grid = ({ className, style, gap = "2", minItemSize, maxItemSize = "1fr", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GridContainer, {
|
|
6942
|
-
...rest,
|
|
6943
|
-
style: {
|
|
6944
|
-
...style,
|
|
6945
|
-
...minItemSize && { "--min-item-size": minItemSize },
|
|
6946
|
-
...maxItemSize && { "--max-item-size": maxItemSize }
|
|
6947
|
-
},
|
|
6948
|
-
gap,
|
|
6949
|
-
className: cn(minItemSize && ["grid-cols-[repeat(auto-fit,minmax(var(--min-item-size,0),var(--max-item-size,0)))]"], className)
|
|
6950
|
-
});
|
|
6951
|
-
Grid.displayName = "Grid";
|
|
6952
|
-
//#endregion
|
|
6953
6853
|
//#region src/components/input-field/InputField.tsx
|
|
6954
6854
|
var InputField = ({ className, label, name, validation, prompt, description, hideLabel, appearance, theme, ...rest }) => {
|
|
6955
6855
|
const { register } = (0, react_hook_form.useFormContext)();
|
|
@@ -7433,7 +7333,7 @@ var NavigationMenuComponent = ({ children, className, ...rest }) => {
|
|
|
7433
7333
|
const [activeItem, setActiveItem] = react.useState();
|
|
7434
7334
|
const [listWidth, setListWidth] = react.useState(0);
|
|
7435
7335
|
const listRef = react.useRef(null);
|
|
7436
|
-
react.
|
|
7336
|
+
react.useEffect(() => {
|
|
7437
7337
|
if (listRef.current) setListWidth(listRef.current.offsetWidth);
|
|
7438
7338
|
}, [react.Children.toArray(children).length]);
|
|
7439
7339
|
react.useEffect(() => {
|
|
@@ -10212,9 +10112,9 @@ var Toast$1 = /* @__PURE__ */ Object.assign(ToastComponent, {
|
|
|
10212
10112
|
var ToastProviderBase = /* @__PURE__ */ styled("div", { base: [
|
|
10213
10113
|
"fixed",
|
|
10214
10114
|
"z-2147483647",
|
|
10215
|
-
"inset-2",
|
|
10115
|
+
"inset-safe-offset-2",
|
|
10216
10116
|
"pointer-events-none",
|
|
10217
|
-
"sm:top-3"
|
|
10117
|
+
"sm:top-safe-offset-3"
|
|
10218
10118
|
] });
|
|
10219
10119
|
var ToastWrapper = /* @__PURE__ */ styled("div", {
|
|
10220
10120
|
base: [
|
|
@@ -10625,21 +10525,21 @@ var StyledRoot = styled("header", {
|
|
|
10625
10525
|
variants: {
|
|
10626
10526
|
hasScrolled: { true: ["shadow-[0px_4px_4px_-2px_rgba(31,31,31,0.1)]"] },
|
|
10627
10527
|
size: {
|
|
10628
|
-
md: ["h-16"],
|
|
10629
|
-
lg: ["h-24"]
|
|
10528
|
+
md: ["h-safe-offset-top-16", "pt-safe"],
|
|
10529
|
+
lg: ["h-safe-offset-top-24", "pt-safe"]
|
|
10630
10530
|
},
|
|
10631
10531
|
diffused: { true: ["supports-color-mix:bg-[color-mix(in_hsl,(--base-1)_70%,transparent)]", "supports-color-mix:backdrop-blur-sm"] },
|
|
10632
10532
|
appearance: {
|
|
10633
10533
|
standard: [
|
|
10634
10534
|
"w-screen",
|
|
10635
10535
|
"max-w-full",
|
|
10636
|
-
"top-
|
|
10536
|
+
"top-safe",
|
|
10637
10537
|
"border-b",
|
|
10638
10538
|
"border-b-(--border-bottom)"
|
|
10639
10539
|
],
|
|
10640
10540
|
rounded: [
|
|
10641
10541
|
"w-full",
|
|
10642
|
-
"top-2",
|
|
10542
|
+
"top-safe-offset-2",
|
|
10643
10543
|
"p-2",
|
|
10644
10544
|
"border",
|
|
10645
10545
|
"border-white",
|
|
@@ -11004,7 +10904,10 @@ var SegmentedControlRoot = ({ size, theme = "primary", defaultValue, children, v
|
|
|
11004
10904
|
const isControlled = value !== void 0;
|
|
11005
10905
|
const [internalValue, setInternalValue] = react.useState(defaultValue);
|
|
11006
10906
|
const currentValue = isControlled ? value : internalValue;
|
|
11007
|
-
const handleValueChange =
|
|
10907
|
+
const handleValueChange = react.useCallback((newValue) => {
|
|
10908
|
+
if (!isControlled) setInternalValue(newValue);
|
|
10909
|
+
onValueChange?.(newValue);
|
|
10910
|
+
}, [isControlled, onValueChange]);
|
|
11008
10911
|
react.useEffect(() => {
|
|
11009
10912
|
if (!isControlled && defaultValue) setInternalValue(defaultValue);
|
|
11010
10913
|
}, [defaultValue, isControlled]);
|
|
@@ -11132,7 +11035,6 @@ exports.Avatar = Avatar;
|
|
|
11132
11035
|
exports.Badge = Badge;
|
|
11133
11036
|
exports.BannerRegular = BannerRegular;
|
|
11134
11037
|
exports.BannerSlim = BannerSlim;
|
|
11135
|
-
exports.Box = Box;
|
|
11136
11038
|
exports.Button = Button;
|
|
11137
11039
|
exports.Carousel = Carousel;
|
|
11138
11040
|
exports.Checkbox = Checkbox;
|
|
@@ -11159,9 +11061,7 @@ exports.EmptyState = EmptyState;
|
|
|
11159
11061
|
exports.FieldWrapper = FieldWrapper;
|
|
11160
11062
|
exports.FileDrop = FileDrop;
|
|
11161
11063
|
exports.FileInput = FileInput;
|
|
11162
|
-
exports.Flex = Flex;
|
|
11163
11064
|
exports.Form = Form;
|
|
11164
|
-
exports.Grid = Grid;
|
|
11165
11065
|
exports.Heading = Heading;
|
|
11166
11066
|
exports.Icon = Icon;
|
|
11167
11067
|
exports.Image = Image;
|