@blockle/blocks 0.20.0-alpha1 → 1.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/README.md +1 -70
- package/dist/index.cjs +21 -71
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -0
- package/dist/index.spec.d.ts +0 -0
- package/dist/reset.cjs +1 -2
- package/dist/reset.d.ts +0 -2
- package/dist/reset.js +1 -0
- package/package.json +24 -81
- package/LICENSE +0 -21
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.cjs +0 -19
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.mjs +0 -20
- package/dist/components/accessibility/VisuallyHidden/index.cjs +0 -1
- package/dist/components/accessibility/VisuallyHidden/index.mjs +0 -1
- package/dist/components/accessibility/VisuallyHidden/visually-hidden.css.cjs +0 -15
- package/dist/components/accessibility/VisuallyHidden/visually-hidden.css.mjs +0 -16
- package/dist/components/display/Divider/Divider.cjs +0 -25
- package/dist/components/display/Divider/Divider.mjs +0 -26
- package/dist/components/display/Divider/divider.css.cjs +0 -15
- package/dist/components/display/Divider/divider.css.mjs +0 -16
- package/dist/components/display/Divider/index.cjs +0 -1
- package/dist/components/display/Divider/index.mjs +0 -1
- package/dist/components/feedback/Progress/Progress.cjs +0 -53
- package/dist/components/feedback/Progress/Progress.mjs +0 -54
- package/dist/components/feedback/Progress/index.cjs +0 -1
- package/dist/components/feedback/Progress/index.mjs +0 -1
- package/dist/components/feedback/Spinner/Spinner.cjs +0 -25
- package/dist/components/feedback/Spinner/Spinner.mjs +0 -26
- package/dist/components/feedback/Spinner/index.cjs +0 -1
- package/dist/components/feedback/Spinner/index.mjs +0 -1
- package/dist/components/form/Button/Button.cjs +0 -58
- package/dist/components/form/Button/Button.css.cjs +0 -15
- package/dist/components/form/Button/Button.css.mjs +0 -16
- package/dist/components/form/Button/Button.mjs +0 -59
- package/dist/components/form/Button/index.cjs +0 -1
- package/dist/components/form/Button/index.mjs +0 -1
- package/dist/components/form/Checkbox/Checkbox.cjs +0 -78
- package/dist/components/form/Checkbox/Checkbox.mjs +0 -79
- package/dist/components/form/Checkbox/checkbox.css.cjs +0 -31
- package/dist/components/form/Checkbox/checkbox.css.mjs +0 -32
- package/dist/components/form/Checkbox/index.cjs +0 -1
- package/dist/components/form/Checkbox/index.mjs +0 -1
- package/dist/components/form/Input/Input.cjs +0 -50
- package/dist/components/form/Input/Input.mjs +0 -51
- package/dist/components/form/Input/index.cjs +0 -1
- package/dist/components/form/Input/index.mjs +0 -1
- package/dist/components/form/Input/input.css.cjs +0 -20
- package/dist/components/form/Input/input.css.mjs +0 -21
- package/dist/components/form/Label/Label.cjs +0 -29
- package/dist/components/form/Label/Label.mjs +0 -30
- package/dist/components/form/Label/index.cjs +0 -1
- package/dist/components/form/Label/index.mjs +0 -1
- package/dist/components/form/Radio/Radio.cjs +0 -47
- package/dist/components/form/Radio/Radio.mjs +0 -48
- package/dist/components/form/Radio/RadioGroup.cjs +0 -1
- package/dist/components/form/Radio/RadioGroup.mjs +0 -1
- package/dist/components/form/Radio/index.cjs +0 -1
- package/dist/components/form/Radio/index.mjs +0 -1
- package/dist/components/form/Radio/radio.css.cjs +0 -31
- package/dist/components/form/Radio/radio.css.mjs +0 -32
- package/dist/components/form/Select/Select.cjs +0 -64
- package/dist/components/form/Select/Select.mjs +0 -65
- package/dist/components/form/Select/index.cjs +0 -1
- package/dist/components/form/Select/index.mjs +0 -1
- package/dist/components/form/Select/select.css.cjs +0 -37
- package/dist/components/form/Select/select.css.mjs +0 -38
- package/dist/components/form/Slider/Slider.cjs +0 -139
- package/dist/components/form/Slider/Slider.mjs +0 -142
- package/dist/components/form/Slider/index.cjs +0 -1
- package/dist/components/form/Slider/index.mjs +0 -1
- package/dist/components/form/Slider/slider.css.cjs +0 -74
- package/dist/components/form/Slider/slider.css.mjs +0 -75
- package/dist/components/form/Slider/usePointerProgress.cjs +0 -44
- package/dist/components/form/Slider/usePointerProgress.mjs +0 -45
- package/dist/components/form/Switch/Switch.cjs +0 -71
- package/dist/components/form/Switch/Switch.mjs +0 -74
- package/dist/components/form/Switch/index.cjs +0 -1
- package/dist/components/form/Switch/index.mjs +0 -1
- package/dist/components/form/Switch/switch.css.cjs +0 -26
- package/dist/components/form/Switch/switch.css.mjs +0 -27
- package/dist/components/layout/Box/Box.cjs +0 -27
- package/dist/components/layout/Box/Box.mjs +0 -28
- package/dist/components/layout/Box/index.cjs +0 -1
- package/dist/components/layout/Box/index.mjs +0 -1
- package/dist/components/layout/Inline/Inline.cjs +0 -29
- package/dist/components/layout/Inline/Inline.mjs +0 -30
- package/dist/components/layout/Inline/index.cjs +0 -1
- package/dist/components/layout/Inline/index.mjs +0 -1
- package/dist/components/layout/Stack/Stack.cjs +0 -29
- package/dist/components/layout/Stack/Stack.mjs +0 -30
- package/dist/components/layout/Stack/index.cjs +0 -1
- package/dist/components/layout/Stack/index.mjs +0 -1
- package/dist/components/navigation/Link/Link.cjs +0 -31
- package/dist/components/navigation/Link/Link.mjs +0 -32
- package/dist/components/navigation/Link/index.cjs +0 -1
- package/dist/components/navigation/Link/index.mjs +0 -1
- package/dist/components/other/BlocksProvider/BlocksProvider.cjs +0 -36
- package/dist/components/other/BlocksProvider/BlocksProvider.mjs +0 -39
- package/dist/components/other/BlocksProvider/context.cjs +0 -4
- package/dist/components/other/BlocksProvider/context.mjs +0 -7
- package/dist/components/other/BlocksProvider/index.cjs +0 -1
- package/dist/components/other/BlocksProvider/index.mjs +0 -1
- package/dist/components/other/Portal/Portal.cjs +0 -7
- package/dist/components/other/Portal/Portal.mjs +0 -8
- package/dist/components/other/Portal/index.cjs +0 -1
- package/dist/components/other/Portal/index.mjs +0 -1
- package/dist/components/overlay/Dialog/Dialog.cjs +0 -77
- package/dist/components/overlay/Dialog/Dialog.mjs +0 -80
- package/dist/components/overlay/Dialog/dialog.css.cjs +0 -21
- package/dist/components/overlay/Dialog/dialog.css.mjs +0 -22
- package/dist/components/overlay/Dialog/dialogHelper.cjs +0 -20
- package/dist/components/overlay/Dialog/dialogHelper.mjs +0 -21
- package/dist/components/overlay/Dialog/index.cjs +0 -1
- package/dist/components/overlay/Dialog/index.mjs +0 -1
- package/dist/components/overlay/Popover/Popover.cjs +0 -111
- package/dist/components/overlay/Popover/Popover.mjs +0 -112
- package/dist/components/overlay/Popover/popover-utils.cjs +0 -61
- package/dist/components/overlay/Popover/popover-utils.mjs +0 -62
- package/dist/components/overlay/Tooltip/Tooltip.cjs +0 -71
- package/dist/components/overlay/Tooltip/Tooltip.mjs +0 -74
- package/dist/components/overlay/Tooltip/index.cjs +0 -1
- package/dist/components/overlay/Tooltip/index.mjs +0 -1
- package/dist/components/typography/Heading/Heading.cjs +0 -23
- package/dist/components/typography/Heading/Heading.mjs +0 -24
- package/dist/components/typography/Heading/heading.css.cjs +0 -15
- package/dist/components/typography/Heading/heading.css.mjs +0 -16
- package/dist/components/typography/Heading/index.cjs +0 -1
- package/dist/components/typography/Heading/index.mjs +0 -1
- package/dist/components/typography/Text/Text.cjs +0 -20
- package/dist/components/typography/Text/Text.mjs +0 -21
- package/dist/components/typography/Text/index.cjs +0 -1
- package/dist/components/typography/Text/index.mjs +0 -1
- package/dist/components/typography/Text/text.css.cjs +0 -15
- package/dist/components/typography/Text/text.css.mjs +0 -16
- package/dist/hooks/useClickOutside/useClickOutside.cjs +0 -22
- package/dist/hooks/useClickOutside/useClickOutside.mjs +0 -23
- package/dist/hooks/useControlledValue/useControlledValue.cjs +0 -31
- package/dist/hooks/useControlledValue/useControlledValue.mjs +0 -32
- package/dist/hooks/useIsomorphicLayoutEffect/index.cjs +0 -1
- package/dist/hooks/useIsomorphicLayoutEffect/index.mjs +0 -1
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs +0 -4
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.mjs +0 -7
- package/dist/hooks/useKeyboard/index.cjs +0 -1
- package/dist/hooks/useKeyboard/index.mjs +0 -1
- package/dist/hooks/useKeyboard/useKeyboard.cjs +0 -19
- package/dist/hooks/useKeyboard/useKeyboard.mjs +0 -22
- package/dist/hooks/useLayer/index.cjs +0 -1
- package/dist/hooks/useLayer/index.mjs +0 -1
- package/dist/hooks/useLayer/useLayer.cjs +0 -25
- package/dist/hooks/useLayer/useLayer.mjs +0 -26
- package/dist/hooks/usePreventBodyScroll/index.cjs +0 -1
- package/dist/hooks/usePreventBodyScroll/index.mjs +0 -1
- package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.cjs +0 -29
- package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.mjs +0 -30
- package/dist/hooks/useRestoreFocus/index.cjs +0 -1
- package/dist/hooks/useRestoreFocus/index.mjs +0 -1
- package/dist/hooks/useRestoreFocus/useRestoreFocus.cjs +0 -17
- package/dist/hooks/useRestoreFocus/useRestoreFocus.mjs +0 -18
- package/dist/hooks/useRootAriaHidden/index.cjs +0 -1
- package/dist/hooks/useRootAriaHidden/index.mjs +0 -1
- package/dist/hooks/useRootAriaHidden/useRootAriaHidden.cjs +0 -11
- package/dist/hooks/useRootAriaHidden/useRootAriaHidden.mjs +0 -12
- package/dist/hooks/useVisibilityState/index.cjs +0 -1
- package/dist/hooks/useVisibilityState/index.mjs +0 -1
- package/dist/hooks/useVisibilityState/useVisibilityState.cjs +0 -15
- package/dist/hooks/useVisibilityState/useVisibilityState.mjs +0 -16
- package/dist/index.d.mts +0 -1
- package/dist/index.mjs +0 -73
- package/dist/lib/asChildRenderer/createAsChildTemplate.cjs +0 -72
- package/dist/lib/asChildRenderer/createAsChildTemplate.mjs +0 -73
- package/dist/lib/css/atoms/atomicProperties.cjs +0 -89
- package/dist/lib/css/atoms/atomicProperties.mjs +0 -90
- package/dist/lib/css/atoms/atoms.cjs +0 -2
- package/dist/lib/css/atoms/atoms.mjs +0 -1
- package/dist/lib/css/atoms/breakpoints.cjs +0 -13
- package/dist/lib/css/atoms/breakpoints.mjs +0 -14
- package/dist/lib/css/atoms/index.cjs +0 -2
- package/dist/lib/css/atoms/index.mjs +0 -1
- package/dist/lib/css/atoms/sprinkles.css.cjs +0 -38
- package/dist/lib/css/atoms/sprinkles.css.mjs +0 -39
- package/dist/lib/css/flexbox/flexbox.cjs +0 -16
- package/dist/lib/css/flexbox/flexbox.mjs +0 -17
- package/dist/lib/css/layers/layers.css.cjs +0 -7
- package/dist/lib/css/layers/layers.css.mjs +0 -8
- package/dist/lib/css/reset/reset.css.cjs +0 -38
- package/dist/lib/css/reset/reset.css.mjs +0 -37
- package/dist/lib/css/style/style.cjs +0 -28
- package/dist/lib/css/style/style.mjs +0 -29
- package/dist/lib/css/utils/cssUtils.cjs +0 -5
- package/dist/lib/css/utils/cssUtils.mjs +0 -6
- package/dist/lib/react/mergeProps.cjs +0 -42
- package/dist/lib/react/mergeProps.mjs +0 -43
- package/dist/lib/react/refs.cjs +0 -16
- package/dist/lib/react/refs.mjs +0 -17
- package/dist/lib/theme/makeComponentTheme.cjs +0 -5
- package/dist/lib/theme/makeComponentTheme.mjs +0 -6
- package/dist/lib/theme/makeTheme.cjs +0 -12
- package/dist/lib/theme/makeTheme.mjs +0 -13
- package/dist/lib/theme/makeVanillaTheme.cjs +0 -19
- package/dist/lib/theme/makeVanillaTheme.mjs +0 -20
- package/dist/lib/theme/store/theme.cjs +0 -92
- package/dist/lib/theme/store/theme.mjs +0 -93
- package/dist/lib/theme/tokens.cjs +0 -81
- package/dist/lib/theme/tokens.mjs +0 -82
- package/dist/lib/theme/vars.css.cjs +0 -9
- package/dist/lib/theme/vars.css.mjs +0 -10
- package/dist/lib/utils/atom-props.cjs +0 -15
- package/dist/lib/utils/atom-props.mjs +0 -16
- package/dist/lib/utils/classnames.cjs +0 -6
- package/dist/lib/utils/classnames.mjs +0 -7
- package/dist/lib/utils/dom.cjs +0 -12
- package/dist/lib/utils/dom.mjs +0 -13
- package/dist/lib/utils/math.cjs +0 -12
- package/dist/lib/utils/math.mjs +0 -13
- package/dist/momotaro.chunk.d.ts +0 -906
- package/dist/reset.d.mts +0 -2
- package/dist/reset.mjs +0 -2
- package/dist/themes/momotaro/components/button.css.cjs +0 -103
- package/dist/themes/momotaro/components/button.css.mjs +0 -104
- package/dist/themes/momotaro/components/checkbox.css.cjs +0 -59
- package/dist/themes/momotaro/components/checkbox.css.mjs +0 -60
- package/dist/themes/momotaro/components/dialog.css.cjs +0 -78
- package/dist/themes/momotaro/components/dialog.css.mjs +0 -79
- package/dist/themes/momotaro/components/divider.css.cjs +0 -15
- package/dist/themes/momotaro/components/divider.css.mjs +0 -16
- package/dist/themes/momotaro/components/helpers.css.cjs +0 -43
- package/dist/themes/momotaro/components/helpers.css.mjs +0 -44
- package/dist/themes/momotaro/components/index.cjs +0 -34
- package/dist/themes/momotaro/components/index.mjs +0 -35
- package/dist/themes/momotaro/components/input.css.cjs +0 -41
- package/dist/themes/momotaro/components/input.css.mjs +0 -42
- package/dist/themes/momotaro/components/label.css.cjs +0 -33
- package/dist/themes/momotaro/components/label.css.mjs +0 -34
- package/dist/themes/momotaro/components/link.css.cjs +0 -53
- package/dist/themes/momotaro/components/link.css.mjs +0 -54
- package/dist/themes/momotaro/components/popover.css.cjs +0 -32
- package/dist/themes/momotaro/components/popover.css.mjs +0 -33
- package/dist/themes/momotaro/components/progress.css.cjs +0 -55
- package/dist/themes/momotaro/components/progress.css.mjs +0 -56
- package/dist/themes/momotaro/components/radio.css.cjs +0 -60
- package/dist/themes/momotaro/components/radio.css.mjs +0 -61
- package/dist/themes/momotaro/components/select.css.cjs +0 -44
- package/dist/themes/momotaro/components/select.css.mjs +0 -45
- package/dist/themes/momotaro/components/slider.css.cjs +0 -89
- package/dist/themes/momotaro/components/slider.css.mjs +0 -90
- package/dist/themes/momotaro/components/spinner.css.cjs +0 -43
- package/dist/themes/momotaro/components/spinner.css.mjs +0 -44
- package/dist/themes/momotaro/components/switch.css.cjs +0 -58
- package/dist/themes/momotaro/components/switch.css.mjs +0 -59
- package/dist/themes/momotaro/components/tooltip.css.cjs +0 -30
- package/dist/themes/momotaro/components/tooltip.css.mjs +0 -31
- package/dist/themes/momotaro/components/transitions.cjs +0 -3
- package/dist/themes/momotaro/components/transitions.mjs +0 -4
- package/dist/themes/momotaro/index.cjs +0 -2
- package/dist/themes/momotaro/index.mjs +0 -1
- package/dist/themes/momotaro/momotaro.css.cjs +0 -13
- package/dist/themes/momotaro/momotaro.css.mjs +0 -14
- package/dist/themes/momotaro/tokens.css.cjs +0 -85
- package/dist/themes/momotaro/tokens.css.mjs +0 -86
- package/dist/themes/momotaro.cjs +0 -4
- package/dist/themes/momotaro.d.mts +0 -1
- package/dist/themes/momotaro.d.ts +0 -1
- package/dist/themes/momotaro.mjs +0 -4
- package/reset/index.d.ts +0 -1
- package/reset/package.json +0 -5
- package/themes/momotaro/index.d.ts +0 -1
- package/themes/momotaro/package.json +0 -5
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
3
|
-
const sprinkles = require("@vanilla-extract/sprinkles");
|
|
4
|
-
const lib_css_atoms_atomicProperties_cjs = require("./atomicProperties.cjs");
|
|
5
|
-
const lib_css_atoms_breakpoints_cjs = require("./breakpoints.cjs");
|
|
6
|
-
fileScope.setFileScope("src/lib/css/atoms/sprinkles.css.ts", "@blockle/blocks");
|
|
7
|
-
const unresponsiveAtomicProperties = sprinkles.defineProperties({
|
|
8
|
-
properties: lib_css_atoms_atomicProperties_cjs.unresponsiveProperties,
|
|
9
|
-
shorthands: {
|
|
10
|
-
inset: ["insetBlockStart", "insetBlockEnd", "insetInlineStart", "insetInlineEnd"]
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
const responsiveAtomicProperties = sprinkles.defineProperties({
|
|
14
|
-
defaultCondition: "mobile",
|
|
15
|
-
conditions: {
|
|
16
|
-
mobile: {},
|
|
17
|
-
tablet: {
|
|
18
|
-
"@media": lib_css_atoms_breakpoints_cjs.minMediaQuery("tablet")
|
|
19
|
-
},
|
|
20
|
-
desktop: {
|
|
21
|
-
"@media": lib_css_atoms_breakpoints_cjs.minMediaQuery("desktop")
|
|
22
|
-
},
|
|
23
|
-
wide: {
|
|
24
|
-
"@media": lib_css_atoms_breakpoints_cjs.minMediaQuery("wide")
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
responsiveArray: lib_css_atoms_breakpoints_cjs.breakpointNames,
|
|
28
|
-
properties: lib_css_atoms_atomicProperties_cjs.responsiveProperties,
|
|
29
|
-
shorthands: {
|
|
30
|
-
margin: ["marginBlockStart", "marginBlockEnd", "marginInlineStart", "marginInlineEnd"],
|
|
31
|
-
marginBlock: ["marginBlockStart", "marginBlockEnd"],
|
|
32
|
-
marginInline: ["marginInlineStart", "marginInlineEnd"],
|
|
33
|
-
placeItems: ["justifyContent", "alignItems"]
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
const atoms = sprinkles.createSprinkles(unresponsiveAtomicProperties, responsiveAtomicProperties);
|
|
37
|
-
fileScope.endFileScope();
|
|
38
|
-
exports.atoms = atoms;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
|
-
import { defineProperties, createSprinkles } from "@vanilla-extract/sprinkles";
|
|
3
|
-
import { unresponsiveProperties, responsiveProperties } from "./atomicProperties.mjs";
|
|
4
|
-
import { breakpointNames, minMediaQuery } from "./breakpoints.mjs";
|
|
5
|
-
setFileScope("src/lib/css/atoms/sprinkles.css.ts", "@blockle/blocks");
|
|
6
|
-
const unresponsiveAtomicProperties = defineProperties({
|
|
7
|
-
properties: unresponsiveProperties,
|
|
8
|
-
shorthands: {
|
|
9
|
-
inset: ["insetBlockStart", "insetBlockEnd", "insetInlineStart", "insetInlineEnd"]
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
const responsiveAtomicProperties = defineProperties({
|
|
13
|
-
defaultCondition: "mobile",
|
|
14
|
-
conditions: {
|
|
15
|
-
mobile: {},
|
|
16
|
-
tablet: {
|
|
17
|
-
"@media": minMediaQuery("tablet")
|
|
18
|
-
},
|
|
19
|
-
desktop: {
|
|
20
|
-
"@media": minMediaQuery("desktop")
|
|
21
|
-
},
|
|
22
|
-
wide: {
|
|
23
|
-
"@media": minMediaQuery("wide")
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
responsiveArray: breakpointNames,
|
|
27
|
-
properties: responsiveProperties,
|
|
28
|
-
shorthands: {
|
|
29
|
-
margin: ["marginBlockStart", "marginBlockEnd", "marginInlineStart", "marginInlineEnd"],
|
|
30
|
-
marginBlock: ["marginBlockStart", "marginBlockEnd"],
|
|
31
|
-
marginInline: ["marginInlineStart", "marginInlineEnd"],
|
|
32
|
-
placeItems: ["justifyContent", "alignItems"]
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
const atoms = createSprinkles(unresponsiveAtomicProperties, responsiveAtomicProperties);
|
|
36
|
-
endFileScope();
|
|
37
|
-
export {
|
|
38
|
-
atoms
|
|
39
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const justifyContentMap = {
|
|
3
|
-
left: "flex-start",
|
|
4
|
-
right: "flex-end",
|
|
5
|
-
center: "center",
|
|
6
|
-
between: "space-between",
|
|
7
|
-
around: "space-around"
|
|
8
|
-
};
|
|
9
|
-
const alignItemsMap = {
|
|
10
|
-
left: "flex-start",
|
|
11
|
-
right: "flex-end",
|
|
12
|
-
center: "center",
|
|
13
|
-
stretch: "stretch"
|
|
14
|
-
};
|
|
15
|
-
exports.alignItemsMap = alignItemsMap;
|
|
16
|
-
exports.justifyContentMap = justifyContentMap;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const justifyContentMap = {
|
|
2
|
-
left: "flex-start",
|
|
3
|
-
right: "flex-end",
|
|
4
|
-
center: "center",
|
|
5
|
-
between: "space-between",
|
|
6
|
-
around: "space-around"
|
|
7
|
-
};
|
|
8
|
-
const alignItemsMap = {
|
|
9
|
-
left: "flex-start",
|
|
10
|
-
right: "flex-end",
|
|
11
|
-
center: "center",
|
|
12
|
-
stretch: "stretch"
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
alignItemsMap,
|
|
16
|
-
justifyContentMap
|
|
17
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
3
|
-
const css = require("@vanilla-extract/css");
|
|
4
|
-
fileScope.setFileScope("src/lib/css/layers/layers.css.ts", "@blockle/blocks");
|
|
5
|
-
const blocksLayer = css.layer("blockle-blocks");
|
|
6
|
-
fileScope.endFileScope();
|
|
7
|
-
exports.blocksLayer = blocksLayer;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
|
-
import { layer } from "@vanilla-extract/css";
|
|
3
|
-
setFileScope("src/lib/css/layers/layers.css.ts", "@blockle/blocks");
|
|
4
|
-
const blocksLayer = layer("blockle-blocks");
|
|
5
|
-
endFileScope();
|
|
6
|
-
export {
|
|
7
|
-
blocksLayer
|
|
8
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
3
|
-
const css = require("@vanilla-extract/css");
|
|
4
|
-
fileScope.setFileScope("src/lib/css/reset/reset.css.ts", "@blockle/blocks");
|
|
5
|
-
css.globalStyle(":where(*, *::before, *::after)", {
|
|
6
|
-
boxSizing: "inherit",
|
|
7
|
-
WebkitTapHighlightColor: "transparent"
|
|
8
|
-
});
|
|
9
|
-
css.globalStyle(":where(html)", {
|
|
10
|
-
lineHeight: 1.5,
|
|
11
|
-
boxSizing: "border-box",
|
|
12
|
-
WebkitFontSmoothing: "antialiased"
|
|
13
|
-
});
|
|
14
|
-
css.globalStyle(":where(body)", {
|
|
15
|
-
margin: 0,
|
|
16
|
-
padding: 0,
|
|
17
|
-
fontFamily: "Calibri, sans-serif"
|
|
18
|
-
});
|
|
19
|
-
css.globalStyle(":where(button, input, optgroup, select, textarea)", {
|
|
20
|
-
fontFamily: "inherit",
|
|
21
|
-
fontSize: "100%",
|
|
22
|
-
lineHeight: "inherit",
|
|
23
|
-
margin: 0,
|
|
24
|
-
padding: 0
|
|
25
|
-
});
|
|
26
|
-
css.globalStyle(":where(p, ul, ol, pre, blockquote)", {
|
|
27
|
-
margin: 0,
|
|
28
|
-
padding: 0
|
|
29
|
-
});
|
|
30
|
-
css.globalStyle(":where(h1, h2, h3, h4, h5, h6)", {
|
|
31
|
-
margin: 0,
|
|
32
|
-
padding: 0,
|
|
33
|
-
fontSize: "inherit"
|
|
34
|
-
});
|
|
35
|
-
css.globalStyle(":where(pre)", {
|
|
36
|
-
whiteSpace: "pre-wrap"
|
|
37
|
-
});
|
|
38
|
-
fileScope.endFileScope();
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
|
-
import { globalStyle } from "@vanilla-extract/css";
|
|
3
|
-
setFileScope("src/lib/css/reset/reset.css.ts", "@blockle/blocks");
|
|
4
|
-
globalStyle(":where(*, *::before, *::after)", {
|
|
5
|
-
boxSizing: "inherit",
|
|
6
|
-
WebkitTapHighlightColor: "transparent"
|
|
7
|
-
});
|
|
8
|
-
globalStyle(":where(html)", {
|
|
9
|
-
lineHeight: 1.5,
|
|
10
|
-
boxSizing: "border-box",
|
|
11
|
-
WebkitFontSmoothing: "antialiased"
|
|
12
|
-
});
|
|
13
|
-
globalStyle(":where(body)", {
|
|
14
|
-
margin: 0,
|
|
15
|
-
padding: 0,
|
|
16
|
-
fontFamily: "Calibri, sans-serif"
|
|
17
|
-
});
|
|
18
|
-
globalStyle(":where(button, input, optgroup, select, textarea)", {
|
|
19
|
-
fontFamily: "inherit",
|
|
20
|
-
fontSize: "100%",
|
|
21
|
-
lineHeight: "inherit",
|
|
22
|
-
margin: 0,
|
|
23
|
-
padding: 0
|
|
24
|
-
});
|
|
25
|
-
globalStyle(":where(p, ul, ol, pre, blockquote)", {
|
|
26
|
-
margin: 0,
|
|
27
|
-
padding: 0
|
|
28
|
-
});
|
|
29
|
-
globalStyle(":where(h1, h2, h3, h4, h5, h6)", {
|
|
30
|
-
margin: 0,
|
|
31
|
-
padding: 0,
|
|
32
|
-
fontSize: "inherit"
|
|
33
|
-
});
|
|
34
|
-
globalStyle(":where(pre)", {
|
|
35
|
-
whiteSpace: "pre-wrap"
|
|
36
|
-
});
|
|
37
|
-
endFileScope();
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const css = require("@vanilla-extract/css");
|
|
3
|
-
const lib_css_atoms_sprinkles_css_cjs = require("../atoms/sprinkles.css.cjs");
|
|
4
|
-
function style(props) {
|
|
5
|
-
const styleRule = {};
|
|
6
|
-
const atomClassNames = [];
|
|
7
|
-
if (Array.isArray(props)) {
|
|
8
|
-
return props.map((rule) => {
|
|
9
|
-
if (typeof rule === "string") {
|
|
10
|
-
return rule;
|
|
11
|
-
}
|
|
12
|
-
return style(rule);
|
|
13
|
-
}).join(" ");
|
|
14
|
-
}
|
|
15
|
-
for (const [name, value] of Object.entries(props)) {
|
|
16
|
-
if (lib_css_atoms_sprinkles_css_cjs.atoms.properties.has(name)) {
|
|
17
|
-
try {
|
|
18
|
-
atomClassNames.push(lib_css_atoms_sprinkles_css_cjs.atoms({ [name]: value }));
|
|
19
|
-
} catch {
|
|
20
|
-
styleRule[name] = value;
|
|
21
|
-
}
|
|
22
|
-
} else {
|
|
23
|
-
styleRule[name] = value;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return css.style([styleRule, ...atomClassNames]);
|
|
27
|
-
}
|
|
28
|
-
exports.style = style;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { style as style$1 } from "@vanilla-extract/css";
|
|
2
|
-
import { atoms } from "../atoms/sprinkles.css.mjs";
|
|
3
|
-
function style(props) {
|
|
4
|
-
const styleRule = {};
|
|
5
|
-
const atomClassNames = [];
|
|
6
|
-
if (Array.isArray(props)) {
|
|
7
|
-
return props.map((rule) => {
|
|
8
|
-
if (typeof rule === "string") {
|
|
9
|
-
return rule;
|
|
10
|
-
}
|
|
11
|
-
return style(rule);
|
|
12
|
-
}).join(" ");
|
|
13
|
-
}
|
|
14
|
-
for (const [name, value] of Object.entries(props)) {
|
|
15
|
-
if (atoms.properties.has(name)) {
|
|
16
|
-
try {
|
|
17
|
-
atomClassNames.push(atoms({ [name]: value }));
|
|
18
|
-
} catch {
|
|
19
|
-
styleRule[name] = value;
|
|
20
|
-
}
|
|
21
|
-
} else {
|
|
22
|
-
styleRule[name] = value;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return style$1([styleRule, ...atomClassNames]);
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
style
|
|
29
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const lib_utils_classnames_cjs = require("../utils/classnames.cjs");
|
|
3
|
-
const lib_react_refs_cjs = require("./refs.cjs");
|
|
4
|
-
function mergeProps(slotProps, childProps) {
|
|
5
|
-
const overrideProps = {};
|
|
6
|
-
for (const propName in childProps) {
|
|
7
|
-
const slotPropValue = slotProps[propName];
|
|
8
|
-
const childPropValue = childProps[propName];
|
|
9
|
-
if (childPropValue === void 0) {
|
|
10
|
-
continue;
|
|
11
|
-
}
|
|
12
|
-
if (slotPropValue === void 0) {
|
|
13
|
-
overrideProps[propName] = childPropValue;
|
|
14
|
-
continue;
|
|
15
|
-
}
|
|
16
|
-
if (typeof slotPropValue === "function" && typeof childPropValue === "function") {
|
|
17
|
-
overrideProps[propName] = (...args) => {
|
|
18
|
-
childPropValue(...args);
|
|
19
|
-
slotPropValue(...args);
|
|
20
|
-
};
|
|
21
|
-
} else
|
|
22
|
-
switch (propName) {
|
|
23
|
-
case "style": {
|
|
24
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
case "className": {
|
|
28
|
-
overrideProps[propName] = lib_utils_classnames_cjs.classnames(slotPropValue, childPropValue);
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
case "ref": {
|
|
32
|
-
overrideProps[propName] = lib_react_refs_cjs.composeRefs(slotPropValue, childPropValue);
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
default: {
|
|
36
|
-
overrideProps[propName] = childPropValue;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return { ...slotProps, ...overrideProps };
|
|
41
|
-
}
|
|
42
|
-
exports.mergeProps = mergeProps;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { classnames } from "../utils/classnames.mjs";
|
|
2
|
-
import { composeRefs } from "./refs.mjs";
|
|
3
|
-
function mergeProps(slotProps, childProps) {
|
|
4
|
-
const overrideProps = {};
|
|
5
|
-
for (const propName in childProps) {
|
|
6
|
-
const slotPropValue = slotProps[propName];
|
|
7
|
-
const childPropValue = childProps[propName];
|
|
8
|
-
if (childPropValue === void 0) {
|
|
9
|
-
continue;
|
|
10
|
-
}
|
|
11
|
-
if (slotPropValue === void 0) {
|
|
12
|
-
overrideProps[propName] = childPropValue;
|
|
13
|
-
continue;
|
|
14
|
-
}
|
|
15
|
-
if (typeof slotPropValue === "function" && typeof childPropValue === "function") {
|
|
16
|
-
overrideProps[propName] = (...args) => {
|
|
17
|
-
childPropValue(...args);
|
|
18
|
-
slotPropValue(...args);
|
|
19
|
-
};
|
|
20
|
-
} else
|
|
21
|
-
switch (propName) {
|
|
22
|
-
case "style": {
|
|
23
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
case "className": {
|
|
27
|
-
overrideProps[propName] = classnames(slotPropValue, childPropValue);
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
case "ref": {
|
|
31
|
-
overrideProps[propName] = composeRefs(slotPropValue, childPropValue);
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
default: {
|
|
35
|
-
overrideProps[propName] = childPropValue;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return { ...slotProps, ...overrideProps };
|
|
40
|
-
}
|
|
41
|
-
export {
|
|
42
|
-
mergeProps
|
|
43
|
-
};
|
package/dist/lib/react/refs.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
function setRef(ref, value) {
|
|
3
|
-
if (typeof ref === "function") {
|
|
4
|
-
ref(value);
|
|
5
|
-
} else if (ref !== null && ref !== void 0) {
|
|
6
|
-
ref.current = value;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
function composeRefs(...refs) {
|
|
10
|
-
return (node) => {
|
|
11
|
-
for (const ref of refs) {
|
|
12
|
-
setRef(ref, node);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
exports.composeRefs = composeRefs;
|
package/dist/lib/react/refs.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
function setRef(ref, value) {
|
|
2
|
-
if (typeof ref === "function") {
|
|
3
|
-
ref(value);
|
|
4
|
-
} else if (ref !== null && ref !== void 0) {
|
|
5
|
-
ref.current = value;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
function composeRefs(...refs) {
|
|
9
|
-
return (node) => {
|
|
10
|
-
for (const ref of refs) {
|
|
11
|
-
setRef(ref, node);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
composeRefs
|
|
17
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const css = require("@vanilla-extract/css");
|
|
3
|
-
const lib_theme_makeVanillaTheme_cjs = require("./makeVanillaTheme.cjs");
|
|
4
|
-
const lib_theme_vars_css_cjs = require("./vars.css.cjs");
|
|
5
|
-
function makeTheme(theme) {
|
|
6
|
-
return {
|
|
7
|
-
name: theme.name,
|
|
8
|
-
vars: css.createTheme(lib_theme_vars_css_cjs.vars, lib_theme_makeVanillaTheme_cjs.makeVanillaTheme(theme.tokens)),
|
|
9
|
-
components: theme.components
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
exports.makeTheme = makeTheme;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createTheme } from "@vanilla-extract/css";
|
|
2
|
-
import { makeVanillaTheme } from "./makeVanillaTheme.mjs";
|
|
3
|
-
import { vars } from "./vars.css.mjs";
|
|
4
|
-
function makeTheme(theme) {
|
|
5
|
-
return {
|
|
6
|
-
name: theme.name,
|
|
7
|
-
vars: createTheme(vars, makeVanillaTheme(theme.tokens)),
|
|
8
|
-
components: theme.components
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
makeTheme
|
|
13
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const makeVanillaTheme = (tokens) => {
|
|
3
|
-
return {
|
|
4
|
-
space: tokens.spacing,
|
|
5
|
-
borderRadius: tokens.border.radius,
|
|
6
|
-
color: tokens.color,
|
|
7
|
-
borderWidth: tokens.border.width,
|
|
8
|
-
fontFamily: tokens.typography.fontFamily,
|
|
9
|
-
fontSize: tokens.typography.fontSize,
|
|
10
|
-
fontWeight: tokens.typography.fontWeight,
|
|
11
|
-
lineHeight: tokens.typography.lineHeight,
|
|
12
|
-
transition: tokens.transition,
|
|
13
|
-
shadow: tokens.shadow,
|
|
14
|
-
focus: {
|
|
15
|
-
boxShadow: tokens.focus.boxShadow
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
exports.makeVanillaTheme = makeVanillaTheme;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const makeVanillaTheme = (tokens) => {
|
|
2
|
-
return {
|
|
3
|
-
space: tokens.spacing,
|
|
4
|
-
borderRadius: tokens.border.radius,
|
|
5
|
-
color: tokens.color,
|
|
6
|
-
borderWidth: tokens.border.width,
|
|
7
|
-
fontFamily: tokens.typography.fontFamily,
|
|
8
|
-
fontSize: tokens.typography.fontSize,
|
|
9
|
-
fontWeight: tokens.typography.fontWeight,
|
|
10
|
-
lineHeight: tokens.typography.lineHeight,
|
|
11
|
-
transition: tokens.transition,
|
|
12
|
-
shadow: tokens.shadow,
|
|
13
|
-
focus: {
|
|
14
|
-
boxShadow: tokens.focus.boxShadow
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
makeVanillaTheme
|
|
20
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
let currentTheme = null;
|
|
3
|
-
function setTheme(theme) {
|
|
4
|
-
currentTheme = theme;
|
|
5
|
-
}
|
|
6
|
-
function getTheme() {
|
|
7
|
-
if (!currentTheme) {
|
|
8
|
-
throw new Error("No theme has been set. Use setTheme() to set a theme.");
|
|
9
|
-
}
|
|
10
|
-
return currentTheme;
|
|
11
|
-
}
|
|
12
|
-
function getComponentStyles(name, props, useDefaultVariants = true) {
|
|
13
|
-
const { components } = getTheme();
|
|
14
|
-
const component = components[name];
|
|
15
|
-
if (!component) {
|
|
16
|
-
console.warn(`Component ${name} is not defined in the theme`);
|
|
17
|
-
return "";
|
|
18
|
-
}
|
|
19
|
-
const classNames = [];
|
|
20
|
-
const variants = props.variants ?? {};
|
|
21
|
-
const variantsWithDefaults = { ...variants };
|
|
22
|
-
for (const key in props) {
|
|
23
|
-
const value = props[key];
|
|
24
|
-
if (typeof value === "boolean" && value) {
|
|
25
|
-
classNames.push(
|
|
26
|
-
// biome-ignore lint/suspicious/noExplicitAny: This is a type assertion for a dynamic key
|
|
27
|
-
component[key]
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (!component.variants) {
|
|
32
|
-
return classNames.join(" ");
|
|
33
|
-
}
|
|
34
|
-
const { defaultVariants } = component;
|
|
35
|
-
if (useDefaultVariants && defaultVariants) {
|
|
36
|
-
const keys2 = Object.keys(defaultVariants);
|
|
37
|
-
for (const key of keys2) {
|
|
38
|
-
if (variantsWithDefaults[key] === void 0 && defaultVariants[key]) {
|
|
39
|
-
variantsWithDefaults[key] = defaultVariants[key];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const keys = Object.keys(variantsWithDefaults);
|
|
44
|
-
const componentVariants = component.variants;
|
|
45
|
-
for (const key of keys) {
|
|
46
|
-
const value = variantsWithDefaults[key];
|
|
47
|
-
if (value === void 0 || componentVariants[key] === void 0) {
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
if (typeof value === "boolean") {
|
|
51
|
-
if (value && componentVariants[key]) {
|
|
52
|
-
classNames.push(componentVariants[key]);
|
|
53
|
-
}
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
const variant = componentVariants[key][value];
|
|
57
|
-
if (variant) {
|
|
58
|
-
classNames.push(variant);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const { compoundVariants } = component;
|
|
62
|
-
if (compoundVariants) {
|
|
63
|
-
for (const compoundVariant of compoundVariants) {
|
|
64
|
-
const keys2 = Object.keys(
|
|
65
|
-
compoundVariant.variants
|
|
66
|
-
);
|
|
67
|
-
const matches = keys2.every((key) => {
|
|
68
|
-
const value = variantsWithDefaults[key];
|
|
69
|
-
if (value === void 0) {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
return value === compoundVariant.variants[key];
|
|
73
|
-
});
|
|
74
|
-
if (matches) {
|
|
75
|
-
classNames.push(compoundVariant.style);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return classNames.join(" ");
|
|
80
|
-
}
|
|
81
|
-
function getComponentStyleDefaults(name) {
|
|
82
|
-
const { components } = getTheme();
|
|
83
|
-
const component = components[name];
|
|
84
|
-
if (!component) {
|
|
85
|
-
return {};
|
|
86
|
-
}
|
|
87
|
-
return component.defaultVariants ?? {};
|
|
88
|
-
}
|
|
89
|
-
exports.getComponentStyleDefaults = getComponentStyleDefaults;
|
|
90
|
-
exports.getComponentStyles = getComponentStyles;
|
|
91
|
-
exports.getTheme = getTheme;
|
|
92
|
-
exports.setTheme = setTheme;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
let currentTheme = null;
|
|
2
|
-
function setTheme(theme) {
|
|
3
|
-
currentTheme = theme;
|
|
4
|
-
}
|
|
5
|
-
function getTheme() {
|
|
6
|
-
if (!currentTheme) {
|
|
7
|
-
throw new Error("No theme has been set. Use setTheme() to set a theme.");
|
|
8
|
-
}
|
|
9
|
-
return currentTheme;
|
|
10
|
-
}
|
|
11
|
-
function getComponentStyles(name, props, useDefaultVariants = true) {
|
|
12
|
-
const { components } = getTheme();
|
|
13
|
-
const component = components[name];
|
|
14
|
-
if (!component) {
|
|
15
|
-
console.warn(`Component ${name} is not defined in the theme`);
|
|
16
|
-
return "";
|
|
17
|
-
}
|
|
18
|
-
const classNames = [];
|
|
19
|
-
const variants = props.variants ?? {};
|
|
20
|
-
const variantsWithDefaults = { ...variants };
|
|
21
|
-
for (const key in props) {
|
|
22
|
-
const value = props[key];
|
|
23
|
-
if (typeof value === "boolean" && value) {
|
|
24
|
-
classNames.push(
|
|
25
|
-
// biome-ignore lint/suspicious/noExplicitAny: This is a type assertion for a dynamic key
|
|
26
|
-
component[key]
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (!component.variants) {
|
|
31
|
-
return classNames.join(" ");
|
|
32
|
-
}
|
|
33
|
-
const { defaultVariants } = component;
|
|
34
|
-
if (useDefaultVariants && defaultVariants) {
|
|
35
|
-
const keys2 = Object.keys(defaultVariants);
|
|
36
|
-
for (const key of keys2) {
|
|
37
|
-
if (variantsWithDefaults[key] === void 0 && defaultVariants[key]) {
|
|
38
|
-
variantsWithDefaults[key] = defaultVariants[key];
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
const keys = Object.keys(variantsWithDefaults);
|
|
43
|
-
const componentVariants = component.variants;
|
|
44
|
-
for (const key of keys) {
|
|
45
|
-
const value = variantsWithDefaults[key];
|
|
46
|
-
if (value === void 0 || componentVariants[key] === void 0) {
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
if (typeof value === "boolean") {
|
|
50
|
-
if (value && componentVariants[key]) {
|
|
51
|
-
classNames.push(componentVariants[key]);
|
|
52
|
-
}
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
const variant = componentVariants[key][value];
|
|
56
|
-
if (variant) {
|
|
57
|
-
classNames.push(variant);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
const { compoundVariants } = component;
|
|
61
|
-
if (compoundVariants) {
|
|
62
|
-
for (const compoundVariant of compoundVariants) {
|
|
63
|
-
const keys2 = Object.keys(
|
|
64
|
-
compoundVariant.variants
|
|
65
|
-
);
|
|
66
|
-
const matches = keys2.every((key) => {
|
|
67
|
-
const value = variantsWithDefaults[key];
|
|
68
|
-
if (value === void 0) {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
return value === compoundVariant.variants[key];
|
|
72
|
-
});
|
|
73
|
-
if (matches) {
|
|
74
|
-
classNames.push(compoundVariant.style);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return classNames.join(" ");
|
|
79
|
-
}
|
|
80
|
-
function getComponentStyleDefaults(name) {
|
|
81
|
-
const { components } = getTheme();
|
|
82
|
-
const component = components[name];
|
|
83
|
-
if (!component) {
|
|
84
|
-
return {};
|
|
85
|
-
}
|
|
86
|
-
return component.defaultVariants ?? {};
|
|
87
|
-
}
|
|
88
|
-
export {
|
|
89
|
-
getComponentStyleDefaults,
|
|
90
|
-
getComponentStyles,
|
|
91
|
-
getTheme,
|
|
92
|
-
setTheme
|
|
93
|
-
};
|