@stokelp/styled-system 2.127.0 → 3.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/css/conditions.d.ts +7 -0
- package/css/conditions.js +32 -0
- package/css/css.d.ts +6 -6
- package/css/css.js +63 -0
- package/css/cva.d.ts +3 -4
- package/css/cva.js +51 -0
- package/css/cx.d.ts +5 -4
- package/css/{cx.mjs → cx.js} +5 -4
- package/css/first-that-works.d.ts +22 -0
- package/css/first-that-works.js +1 -0
- package/css/index.d.ts +8 -5
- package/css/index.js +8 -0
- package/css/keyframes.d.ts +5 -0
- package/css/keyframes.js +8 -0
- package/css/position-try.d.ts +5 -0
- package/css/position-try.js +11 -0
- package/css/sva.d.ts +2 -3
- package/css/sva.js +49 -0
- package/css/view-transition.d.ts +7 -0
- package/css/view-transition.js +18 -0
- package/dist/panda/buildinfo.json +20580 -0
- package/dist/panda/lib.json +15 -0
- package/dist/panda/preset.mjs +9505 -0
- package/helpers.d.ts +67 -0
- package/helpers.js +624 -0
- package/jsx/aspect-ratio.d.ts +5 -8
- package/jsx/aspect-ratio.js +11 -0
- package/jsx/bleed.d.ts +6 -9
- package/jsx/bleed.js +11 -0
- package/jsx/box.d.ts +6 -9
- package/jsx/box.js +11 -0
- package/jsx/center.d.ts +6 -9
- package/jsx/center.js +11 -0
- package/jsx/circle.d.ts +6 -9
- package/jsx/circle.js +11 -0
- package/jsx/container.d.ts +6 -9
- package/jsx/container.js +11 -0
- package/jsx/cq.d.ts +6 -9
- package/jsx/cq.js +11 -0
- package/jsx/create-recipe-context.d.ts +31 -0
- package/jsx/create-recipe-context.js +38 -0
- package/jsx/create-slot-recipe-context.d.ts +49 -0
- package/jsx/create-slot-recipe-context.js +124 -0
- package/jsx/divider.d.ts +6 -9
- package/jsx/divider.js +11 -0
- package/jsx/factory.d.ts +3 -3
- package/jsx/factory.js +91 -0
- package/jsx/flex.d.ts +6 -9
- package/jsx/flex.js +11 -0
- package/jsx/float.d.ts +6 -9
- package/jsx/float.js +11 -0
- package/jsx/grid-item.d.ts +6 -9
- package/jsx/grid-item.js +11 -0
- package/jsx/grid.d.ts +6 -9
- package/jsx/grid.js +11 -0
- package/jsx/helper.d.ts +34 -0
- package/jsx/helper.js +92 -0
- package/jsx/hstack.d.ts +6 -9
- package/jsx/hstack.js +11 -0
- package/jsx/index.d.ts +25 -25
- package/jsx/index.js +24 -0
- package/jsx/is-valid-prop.d.ts +5 -10
- package/jsx/is-valid-prop.js +12 -0
- package/jsx/link-overlay.d.ts +6 -9
- package/jsx/link-overlay.js +11 -0
- package/jsx/spacer.d.ts +6 -9
- package/jsx/spacer.js +11 -0
- package/jsx/square.d.ts +6 -9
- package/jsx/square.js +11 -0
- package/jsx/stack.d.ts +6 -9
- package/jsx/stack.js +11 -0
- package/jsx/visually-hidden.d.ts +6 -9
- package/jsx/visually-hidden.js +11 -0
- package/jsx/vstack.d.ts +6 -9
- package/jsx/vstack.js +11 -0
- package/jsx/wrap.d.ts +6 -9
- package/jsx/wrap.js +11 -0
- package/package.json +32 -18
- package/patterns/aspect-ratio.d.ts +8 -9
- package/patterns/aspect-ratio.js +37 -0
- package/patterns/bleed.d.ts +9 -10
- package/patterns/bleed.js +30 -0
- package/patterns/box.d.ts +8 -11
- package/patterns/box.js +16 -0
- package/patterns/center.d.ts +8 -9
- package/patterns/center.js +22 -0
- package/patterns/circle.d.ts +8 -9
- package/patterns/circle.js +26 -0
- package/patterns/container.d.ts +8 -11
- package/patterns/container.js +26 -0
- package/patterns/cq.d.ts +10 -10
- package/patterns/cq.js +24 -0
- package/patterns/divider.d.ts +11 -11
- package/patterns/divider.js +31 -0
- package/patterns/flex.d.ts +14 -15
- package/patterns/flex.js +27 -0
- package/patterns/float.d.ts +12 -12
- package/patterns/float.js +78 -0
- package/patterns/grid-item.d.ts +13 -14
- package/patterns/grid-item.js +26 -0
- package/patterns/grid.d.ts +13 -13
- package/patterns/grid.js +30 -0
- package/patterns/hstack.d.ts +9 -10
- package/patterns/hstack.js +27 -0
- package/patterns/index.d.ts +20 -21
- package/patterns/index.js +20 -0
- package/patterns/link-overlay.d.ts +8 -11
- package/patterns/link-overlay.js +25 -0
- package/patterns/runtime.js +25 -0
- package/patterns/spacer.d.ts +9 -9
- package/patterns/spacer.js +25 -0
- package/patterns/square.d.ts +8 -9
- package/patterns/square.js +25 -0
- package/patterns/stack.d.ts +11 -12
- package/patterns/stack.js +30 -0
- package/patterns/visually-hidden.d.ts +8 -11
- package/patterns/visually-hidden.js +19 -0
- package/patterns/vstack.d.ts +9 -10
- package/patterns/vstack.js +27 -0
- package/patterns/wrap.d.ts +12 -13
- package/patterns/wrap.js +26 -0
- package/recipes/accordion.d.ts +10 -26
- package/recipes/accordion.js +5 -0
- package/recipes/action-card.d.ts +9 -26
- package/recipes/action-card.js +5 -0
- package/recipes/alert.d.ts +10 -28
- package/recipes/alert.js +5 -0
- package/recipes/app-navigation-language-select.d.ts +12 -34
- package/recipes/app-navigation-language-select.js +5 -0
- package/recipes/app-navigation.d.ts +10 -28
- package/recipes/app-navigation.js +5 -0
- package/recipes/avatar-group.d.ts +8 -26
- package/recipes/avatar-group.js +5 -0
- package/recipes/avatar.d.ts +11 -30
- package/recipes/avatar.js +5 -0
- package/recipes/breadcrumb.d.ts +9 -24
- package/recipes/breadcrumb.js +5 -0
- package/recipes/button-filter.d.ts +8 -27
- package/recipes/button-filter.js +5 -0
- package/recipes/button.d.ts +10 -37
- package/recipes/button.js +5 -0
- package/recipes/chat-document-message.d.ts +8 -27
- package/recipes/chat-document-message.js +5 -0
- package/recipes/chat-message.d.ts +10 -33
- package/recipes/chat-message.js +5 -0
- package/recipes/chat-profile-avatar.d.ts +9 -29
- package/recipes/chat-profile-avatar.js +5 -0
- package/recipes/chat-text-input.d.ts +8 -27
- package/recipes/chat-text-input.js +5 -0
- package/recipes/chat.d.ts +9 -26
- package/recipes/chat.js +5 -0
- package/recipes/checkbox-card.d.ts +10 -26
- package/recipes/checkbox-card.js +5 -0
- package/recipes/checkbox-group.d.ts +7 -24
- package/recipes/checkbox-group.js +5 -0
- package/recipes/checkbox.d.ts +10 -26
- package/recipes/checkbox.js +5 -0
- package/recipes/chip.d.ts +11 -32
- package/recipes/chip.js +5 -0
- package/recipes/collapsible.d.ts +9 -24
- package/recipes/collapsible.js +5 -0
- package/recipes/combobox.d.ts +11 -27
- package/recipes/combobox.js +5 -0
- package/recipes/datepicker.d.ts +9 -24
- package/recipes/datepicker.js +5 -0
- package/recipes/dialog.d.ts +9 -24
- package/recipes/dialog.js +5 -0
- package/recipes/drawer.d.ts +10 -26
- package/recipes/drawer.js +5 -0
- package/recipes/flag.d.ts +8 -26
- package/recipes/flag.js +5 -0
- package/recipes/form-control.d.ts +8 -27
- package/recipes/form-control.js +5 -0
- package/recipes/form-helper-text.d.ts +8 -27
- package/recipes/form-helper-text.js +5 -0
- package/recipes/form-label.d.ts +10 -28
- package/recipes/form-label.js +5 -0
- package/recipes/heading.d.ts +10 -28
- package/recipes/heading.js +5 -0
- package/recipes/highlighted-input.d.ts +9 -26
- package/recipes/highlighted-input.js +5 -0
- package/recipes/icon-button.d.ts +10 -37
- package/recipes/icon-button.js +5 -0
- package/recipes/icon.d.ts +8 -26
- package/recipes/icon.js +5 -0
- package/recipes/illustration.d.ts +9 -29
- package/recipes/illustration.js +5 -0
- package/recipes/index.d.ts +62 -63
- package/recipes/index.js +62 -0
- package/recipes/input-addon.d.ts +8 -27
- package/recipes/input-addon.js +5 -0
- package/recipes/input-group.d.ts +8 -27
- package/recipes/input-group.js +5 -0
- package/recipes/input.d.ts +9 -29
- package/recipes/input.js +5 -0
- package/recipes/menu.d.ts +10 -26
- package/recipes/menu.js +5 -0
- package/recipes/mobile-navigation.d.ts +10 -28
- package/recipes/mobile-navigation.js +5 -0
- package/recipes/pagination.d.ts +9 -26
- package/recipes/pagination.js +5 -0
- package/recipes/phone-number-input.d.ts +9 -29
- package/recipes/phone-number-input.js +5 -0
- package/recipes/popover.d.ts +9 -24
- package/recipes/popover.js +5 -0
- package/recipes/price-tag.d.ts +10 -26
- package/recipes/price-tag.js +5 -0
- package/recipes/product-card-catalog.d.ts +9 -26
- package/recipes/product-card-catalog.js +5 -0
- package/recipes/radio-button-group.d.ts +10 -26
- package/recipes/radio-button-group.js +5 -0
- package/recipes/radio-card-group.d.ts +10 -26
- package/recipes/radio-card-group.js +5 -0
- package/recipes/radio-group.d.ts +10 -26
- package/recipes/radio-group.js +5 -0
- package/recipes/runtime.js +133 -0
- package/recipes/select-language.d.ts +10 -26
- package/recipes/select-language.js +5 -0
- package/recipes/select.d.ts +11 -27
- package/recipes/select.js +5 -0
- package/recipes/status-tag-select.d.ts +11 -30
- package/recipes/status-tag-select.js +5 -0
- package/recipes/steps.d.ts +9 -24
- package/recipes/steps.js +5 -0
- package/recipes/switch-card.d.ts +10 -26
- package/recipes/switch-card.js +5 -0
- package/recipes/switch-recipe.d.ts +10 -26
- package/recipes/switch-recipe.js +5 -0
- package/recipes/table-container.d.ts +7 -24
- package/recipes/table-container.js +5 -0
- package/recipes/table-empty-row.d.ts +7 -24
- package/recipes/table-empty-row.js +5 -0
- package/recipes/table-group-title.d.ts +8 -26
- package/recipes/table-group-title.js +5 -0
- package/recipes/table.d.ts +9 -24
- package/recipes/table.js +5 -0
- package/recipes/tabs-chip.d.ts +9 -29
- package/recipes/tabs-chip.js +5 -0
- package/recipes/tabs.d.ts +11 -30
- package/recipes/tabs.js +5 -0
- package/recipes/tag.d.ts +11 -32
- package/recipes/tag.js +5 -0
- package/recipes/text.d.ts +12 -30
- package/recipes/text.js +5 -0
- package/recipes/textarea.d.ts +7 -24
- package/recipes/textarea.js +5 -0
- package/recipes/tooltip.d.ts +9 -24
- package/recipes/tooltip.js +5 -0
- package/tokens/index.d.ts +4 -5
- package/tokens/index.js +18 -0
- package/types/index.d.ts +6 -8
- package/types/jsx.d.ts +37 -28
- package/types/pattern.d.ts +18 -70
- package/types/recipe.d.ts +58 -150
- package/types/register.d.ts +40 -0
- package/types/system.d.ts +1816 -0
- package/types/tokens.d.ts +72 -0
- package/css/conditions.mjs +0 -36
- package/css/css.mjs +0 -45
- package/css/cva.mjs +0 -87
- package/css/index.mjs +0 -4
- package/css/sva.mjs +0 -46
- package/helpers.mjs +0 -328
- package/jsx/aspect-ratio.mjs +0 -14
- package/jsx/bleed.mjs +0 -14
- package/jsx/box.mjs +0 -14
- package/jsx/center.mjs +0 -14
- package/jsx/circle.mjs +0 -14
- package/jsx/container.mjs +0 -14
- package/jsx/cq.mjs +0 -14
- package/jsx/create-style-context.d.ts +0 -54
- package/jsx/create-style-context.mjs +0 -118
- package/jsx/divider.mjs +0 -14
- package/jsx/factory-helper.mjs +0 -22
- package/jsx/factory.mjs +0 -89
- package/jsx/flex.mjs +0 -14
- package/jsx/float.mjs +0 -14
- package/jsx/grid-item.mjs +0 -14
- package/jsx/grid.mjs +0 -14
- package/jsx/hstack.mjs +0 -14
- package/jsx/index.mjs +0 -23
- package/jsx/is-valid-prop.mjs +0 -17
- package/jsx/link-overlay.mjs +0 -14
- package/jsx/spacer.mjs +0 -14
- package/jsx/square.mjs +0 -14
- package/jsx/stack.mjs +0 -14
- package/jsx/visually-hidden.mjs +0 -14
- package/jsx/vstack.mjs +0 -14
- package/jsx/wrap.mjs +0 -14
- package/panda.buildinfo.json +0 -471
- package/patterns/aspect-ratio.mjs +0 -38
- package/patterns/bleed.mjs +0 -24
- package/patterns/box.mjs +0 -15
- package/patterns/center.mjs +0 -21
- package/patterns/circle.mjs +0 -25
- package/patterns/container.mjs +0 -21
- package/patterns/cq.mjs +0 -21
- package/patterns/divider.mjs +0 -25
- package/patterns/flex.mjs +0 -26
- package/patterns/float.mjs +0 -52
- package/patterns/grid-item.mjs +0 -25
- package/patterns/grid.mjs +0 -27
- package/patterns/hstack.mjs +0 -24
- package/patterns/index.mjs +0 -20
- package/patterns/link-overlay.mjs +0 -24
- package/patterns/spacer.mjs +0 -25
- package/patterns/square.mjs +0 -24
- package/patterns/stack.mjs +0 -24
- package/patterns/visually-hidden.mjs +0 -18
- package/patterns/vstack.mjs +0 -24
- package/patterns/wrap.mjs +0 -25
- package/recipes/accordion.mjs +0 -57
- package/recipes/action-card.mjs +0 -45
- package/recipes/alert.mjs +0 -57
- package/recipes/app-navigation-language-select.mjs +0 -109
- package/recipes/app-navigation.mjs +0 -84
- package/recipes/avatar-group.mjs +0 -32
- package/recipes/avatar.mjs +0 -57
- package/recipes/breadcrumb.mjs +0 -45
- package/recipes/button-filter.mjs +0 -24
- package/recipes/button.mjs +0 -212
- package/recipes/chat-document-message.mjs +0 -24
- package/recipes/chat-message.mjs +0 -36
- package/recipes/chat-profile-avatar.mjs +0 -31
- package/recipes/chat-text-input.mjs +0 -24
- package/recipes/chat.mjs +0 -45
- package/recipes/checkbox-card.mjs +0 -73
- package/recipes/checkbox-group.mjs +0 -24
- package/recipes/checkbox.mjs +0 -57
- package/recipes/chip.mjs +0 -76
- package/recipes/collapsible.mjs +0 -45
- package/recipes/combobox.mjs +0 -101
- package/recipes/create-recipe.mjs +0 -82
- package/recipes/datepicker.mjs +0 -133
- package/recipes/dialog.mjs +0 -69
- package/recipes/drawer.mjs +0 -78
- package/recipes/flag.mjs +0 -33
- package/recipes/form-control.mjs +0 -24
- package/recipes/form-helper-text.mjs +0 -24
- package/recipes/form-label.mjs +0 -50
- package/recipes/heading.mjs +0 -41
- package/recipes/highlighted-input.mjs +0 -45
- package/recipes/icon-button.mjs +0 -233
- package/recipes/icon.mjs +0 -34
- package/recipes/illustration.mjs +0 -37
- package/recipes/index.mjs +0 -62
- package/recipes/input-addon.mjs +0 -24
- package/recipes/input-group.mjs +0 -24
- package/recipes/input.mjs +0 -30
- package/recipes/menu.mjs +0 -93
- package/recipes/mobile-navigation.mjs +0 -56
- package/recipes/pagination.mjs +0 -41
- package/recipes/phone-number-input.mjs +0 -30
- package/recipes/popover.mjs +0 -69
- package/recipes/price-tag.mjs +0 -51
- package/recipes/product-card-catalog.mjs +0 -73
- package/recipes/radio-button-group.mjs +0 -62
- package/recipes/radio-card-group.mjs +0 -77
- package/recipes/radio-group.mjs +0 -61
- package/recipes/select-language.mjs +0 -98
- package/recipes/select.mjs +0 -101
- package/recipes/status-tag-select.mjs +0 -108
- package/recipes/steps.mjs +0 -69
- package/recipes/switch-card.mjs +0 -69
- package/recipes/switch-recipe.mjs +0 -53
- package/recipes/table-container.mjs +0 -24
- package/recipes/table-empty-row.mjs +0 -24
- package/recipes/table-group-title.mjs +0 -32
- package/recipes/table.mjs +0 -61
- package/recipes/tabs-chip.mjs +0 -35
- package/recipes/tabs.mjs +0 -63
- package/recipes/tag.mjs +0 -61
- package/recipes/text.mjs +0 -41
- package/recipes/textarea.mjs +0 -24
- package/recipes/tooltip.mjs +0 -49
- package/tokens/index.mjs +0 -1728
- package/tokens/tokens.d.ts +0 -63
- package/types/composition.d.ts +0 -227
- package/types/conditions.d.ts +0 -300
- package/types/csstype.d.ts +0 -22570
- package/types/global.d.ts +0 -20
- package/types/parts.d.ts +0 -8
- package/types/prop-type.d.ts +0 -251
- package/types/selectors.d.ts +0 -59
- package/types/static-css.d.ts +0 -56
- package/types/style-props.d.ts +0 -8089
- package/types/system-types.d.ts +0 -151
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Registered } from './register.js';
|
|
2
|
+
|
|
3
|
+
export type AnimationToken = Registered<"AnimationToken", "backdrop-in" | "backdrop-out" | "bounce" | "collapse-in" | "collapse-out" | "dialog-in" | "dialog-out" | "drawer-in-left" | "drawer-in-right" | "drawer-out-left" | "drawer-out-right" | "fade-in" | "ping" | "pulse" | "skeleton-pulse" | "spin">
|
|
4
|
+
|
|
5
|
+
export type AspectRatioToken = Registered<"AspectRatioToken", "golden" | "landscape" | "portrait" | "square" | "ultrawide" | "wide">
|
|
6
|
+
|
|
7
|
+
export type BlurToken = Registered<"BlurToken", "2xl" | "3xl" | "base" | "lg" | "md" | "sm" | "xl">
|
|
8
|
+
|
|
9
|
+
export type BorderToken = Registered<"BorderToken", "border.none">
|
|
10
|
+
|
|
11
|
+
export type BreakpointToken = Registered<"BreakpointToken", "lg" | "md" | "sm" | "xl">
|
|
12
|
+
|
|
13
|
+
export type ColorToken = Registered<"ColorToken", "black" | "blue.100" | "blue.200" | "blue.300" | "blue.400" | "blue.500" | "blue.600" | "blue.700" | "blue.800" | "blue.900" | "colorPalette" | "colorPalette.10" | "colorPalette.100" | "colorPalette.200" | "colorPalette.300" | "colorPalette.400" | "colorPalette.50" | "colorPalette.500" | "colorPalette.600" | "colorPalette.700" | "colorPalette.800" | "colorPalette.900" | "colorPalette.aromatic.dark" | "colorPalette.aromatic.light" | "colorPalette.aromatic.mid" | "colorPalette.blue.dark" | "colorPalette.blue.light" | "colorPalette.blue.mid" | "colorPalette.brown.dark" | "colorPalette.brown.light" | "colorPalette.brown.mid" | "colorPalette.cereal.dark" | "colorPalette.cereal.light" | "colorPalette.cereal.mid" | "colorPalette.dark" | "colorPalette.disabled" | "colorPalette.fish.dark" | "colorPalette.fish.light" | "colorPalette.fish.mid" | "colorPalette.fruit.dark" | "colorPalette.fruit.light" | "colorPalette.fruit.mid" | "colorPalette.green.dark" | "colorPalette.green.light" | "colorPalette.green.mid" | "colorPalette.heading" | "colorPalette.light" | "colorPalette.meat.dark" | "colorPalette.meat.light" | "colorPalette.meat.mid" | "colorPalette.mid" | "colorPalette.oil.dark" | "colorPalette.oil.light" | "colorPalette.oil.mid" | "colorPalette.purple.dark" | "colorPalette.purple.light" | "colorPalette.purple.mid" | "colorPalette.red.dark" | "colorPalette.red.light" | "colorPalette.red.mid" | "colorPalette.vegetable.dark" | "colorPalette.vegetable.light" | "colorPalette.vegetable.mid" | "colorPalette.yellow.dark" | "colorPalette.yellow.light" | "colorPalette.yellow.mid" | "current" | "decorative.blue.dark" | "decorative.blue.light" | "decorative.blue.mid" | "decorative.brown.dark" | "decorative.brown.light" | "decorative.brown.mid" | "decorative.green.dark" | "decorative.green.light" | "decorative.green.mid" | "decorative.purple.dark" | "decorative.purple.light" | "decorative.purple.mid" | "decorative.red.dark" | "decorative.red.light" | "decorative.red.mid" | "decorative.yellow.dark" | "decorative.yellow.light" | "decorative.yellow.mid" | "error.100" | "error.200" | "error.300" | "error.400" | "error.500" | "error.600" | "error.700" | "error.800" | "error.900" | "green.100" | "green.200" | "green.300" | "green.400" | "green.500" | "green.600" | "green.700" | "green.800" | "green.900" | "grey.10" | "grey.100" | "grey.200" | "grey.300" | "grey.400" | "grey.50" | "grey.500" | "grey.600" | "grey.700" | "grey.800" | "grey.900" | "primary.100" | "primary.200" | "primary.300" | "primary.400" | "primary.500" | "primary.600" | "primary.700" | "primary.800" | "primary.900" | "purple.100" | "purple.200" | "purple.300" | "purple.400" | "purple.500" | "purple.600" | "purple.700" | "purple.800" | "purple.900" | "red.100" | "red.200" | "red.300" | "red.400" | "red.500" | "red.600" | "red.700" | "red.800" | "red.900" | "secondary.100" | "secondary.200" | "secondary.300" | "secondary.400" | "secondary.500" | "secondary.600" | "secondary.700" | "secondary.800" | "secondary.900" | "success.100" | "success.200" | "success.300" | "success.400" | "success.500" | "success.600" | "success.700" | "success.800" | "success.900" | "text" | "text.disabled" | "text.heading" | "transparent" | "typology.aromatic.dark" | "typology.aromatic.light" | "typology.aromatic.mid" | "typology.cereal.dark" | "typology.cereal.light" | "typology.cereal.mid" | "typology.fish.dark" | "typology.fish.light" | "typology.fish.mid" | "typology.fruit.dark" | "typology.fruit.light" | "typology.fruit.mid" | "typology.meat.dark" | "typology.meat.light" | "typology.meat.mid" | "typology.oil.dark" | "typology.oil.light" | "typology.oil.mid" | "typology.vegetable.dark" | "typology.vegetable.light" | "typology.vegetable.mid" | "warning.100" | "warning.200" | "warning.300" | "warning.400" | "warning.500" | "warning.600" | "warning.700" | "warning.800" | "warning.900" | "white" | "yellow.100" | "yellow.200" | "yellow.300" | "yellow.400" | "yellow.500" | "yellow.600" | "yellow.700" | "yellow.800" | "yellow.900">
|
|
14
|
+
|
|
15
|
+
export type DurationToken = Registered<"DurationToken", "fast" | "faster" | "fastest" | "normal" | "slow" | "slower" | "slowest">
|
|
16
|
+
|
|
17
|
+
export type EasingToken = Registered<"EasingToken", "default" | "ease-bounce-1" | "ease-bounce-2" | "ease-bounce-3" | "ease-bounce-4" | "ease-bounce-5" | "ease-spring-1" | "ease-spring-2" | "ease-spring-3" | "ease-spring-4" | "ease-spring-5" | "emphasized-in" | "emphasized-out" | "in" | "in-out" | "linear" | "out" | "pulse">
|
|
18
|
+
|
|
19
|
+
export type FontSizeToken = Registered<"FontSizeToken", "body.lg" | "body.md" | "body.sm" | "heading.desktop.2xl" | "heading.desktop.lg" | "heading.desktop.md" | "heading.desktop.sm" | "heading.desktop.xs" | "heading.mobile.2xl" | "heading.mobile.lg" | "heading.mobile.md" | "heading.mobile.sm" | "heading.mobile.xs">
|
|
20
|
+
|
|
21
|
+
export type FontWeightToken = Registered<"FontWeightToken", "black" | "bold" | "extrabold" | "extralight" | "light" | "medium" | "normal" | "semibold" | "thin">
|
|
22
|
+
|
|
23
|
+
export type FontToken = Registered<"FontToken", "cabinet" | "mono" | "sans" | "satoshi" | "serif">
|
|
24
|
+
|
|
25
|
+
export type GradientToken = Registered<"GradientToken", "band.night" | "band.quality" | "band.violet">
|
|
26
|
+
|
|
27
|
+
export type LetterSpacingToken = Registered<"LetterSpacingToken", "normal" | "tight" | "tighter" | "wide" | "wider" | "widest">
|
|
28
|
+
|
|
29
|
+
export type RadiusToken = Registered<"RadiusToken", "full" | "radius-0" | "radius-10" | "radius-12" | "radius-16" | "radius-2" | "radius-20" | "radius-24" | "radius-28" | "radius-32" | "radius-36" | "radius-4" | "radius-40" | "radius-44" | "radius-48" | "radius-52" | "radius-56" | "radius-6" | "radius-60" | "radius-64" | "radius-8">
|
|
30
|
+
|
|
31
|
+
export type ShadowToken = Registered<"ShadowToken", "2xl" | "inner" | "lg" | "lift.bar" | "lift.form" | "lift.mock" | "lift.mockNight" | "lift.soft" | "lift.softHover" | "md" | "sm" | "xl" | "xs">
|
|
32
|
+
|
|
33
|
+
export type SizeToken = Registered<"SizeToken", "breakpoint-lg" | "breakpoint-md" | "breakpoint-sm" | "breakpoint-xl" | "fit" | "full" | "max" | "min" | "size-0" | "size-12" | "size-14" | "size-16" | "size-18" | "size-2" | "size-20" | "size-24" | "size-28" | "size-32" | "size-36" | "size-4" | "size-40" | "size-44" | "size-48" | "size-52" | "size-56" | "size-6" | "size-60" | "size-64" | "size-68" | "size-72" | "size-76" | "size-8" | "size-80">
|
|
34
|
+
|
|
35
|
+
export type SpacingToken = Registered<"SpacingToken", "-space-10" | "-space-12" | "-space-14" | "-space-16" | "-space-18" | "-space-2" | "-space-20" | "-space-24" | "-space-28" | "-space-32" | "-space-36" | "-space-4" | "-space-40" | "-space-44" | "-space-48" | "-space-52" | "-space-56" | "-space-6" | "-space-60" | "-space-64" | "-space-68" | "-space-72" | "-space-76" | "-space-8" | "-space-80" | "space-0" | "space-10" | "space-12" | "space-14" | "space-16" | "space-18" | "space-2" | "space-20" | "space-24" | "space-28" | "space-32" | "space-36" | "space-4" | "space-40" | "space-44" | "space-48" | "space-52" | "space-56" | "space-6" | "space-60" | "space-64" | "space-68" | "space-72" | "space-76" | "space-8" | "space-80">
|
|
36
|
+
|
|
37
|
+
export type ZIndexToken = Registered<"ZIndexToken", "banner" | "base" | "docked" | "dropdown" | "hide" | "modal" | "overlay" | "popover" | "skipLink" | "sticky" | "toast" | "tooltip">
|
|
38
|
+
|
|
39
|
+
interface LocalTokens {
|
|
40
|
+
animations: AnimationToken
|
|
41
|
+
aspectRatios: AspectRatioToken
|
|
42
|
+
blurs: BlurToken
|
|
43
|
+
borders: BorderToken
|
|
44
|
+
breakpoints: BreakpointToken
|
|
45
|
+
colors: ColorToken
|
|
46
|
+
durations: DurationToken
|
|
47
|
+
easings: EasingToken
|
|
48
|
+
fontSizes: FontSizeToken
|
|
49
|
+
fontWeights: FontWeightToken
|
|
50
|
+
fonts: FontToken
|
|
51
|
+
gradients: GradientToken
|
|
52
|
+
letterSpacings: LetterSpacingToken
|
|
53
|
+
radii: RadiusToken
|
|
54
|
+
shadows: ShadowToken
|
|
55
|
+
sizes: SizeToken
|
|
56
|
+
spacing: SpacingToken
|
|
57
|
+
zIndex: ZIndexToken
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface Tokens extends Registered<"Tokens", LocalTokens> {}
|
|
61
|
+
|
|
62
|
+
export type Token = Registered<"Token", `animations.${AnimationToken}` | `aspectRatios.${AspectRatioToken}` | `blurs.${BlurToken}` | `borders.${BorderToken}` | `breakpoints.${BreakpointToken}` | `colors.${ColorToken}` | `durations.${DurationToken}` | `easings.${EasingToken}` | `fontSizes.${FontSizeToken}` | `fontWeights.${FontWeightToken}` | `fonts.${FontToken}` | `gradients.${GradientToken}` | `letterSpacings.${LetterSpacingToken}` | `radii.${RadiusToken}` | `shadows.${ShadowToken}` | `sizes.${SizeToken}` | `spacing.${SpacingToken}` | `zIndex.${ZIndexToken}`>
|
|
63
|
+
|
|
64
|
+
export type ColorOpacityModifier = Registered<"ColorOpacityModifier", `${number}`>
|
|
65
|
+
|
|
66
|
+
export type ColorOpacityToken = Registered<"ColorOpacityToken", `colors.${ColorToken}/${ColorOpacityModifier}`>
|
|
67
|
+
|
|
68
|
+
export type TokenPath = Token | ColorOpacityToken
|
|
69
|
+
|
|
70
|
+
export type ColorPalette = Registered<"ColorPalette", "black" | "blue" | "current" | "decorative" | "decorative.blue" | "decorative.brown" | "decorative.green" | "decorative.purple" | "decorative.red" | "decorative.yellow" | "error" | "green" | "grey" | "primary" | "purple" | "red" | "secondary" | "success" | "text" | "transparent" | "typology" | "typology.aromatic" | "typology.cereal" | "typology.fish" | "typology.fruit" | "typology.meat" | "typology.oil" | "typology.vegetable" | "warning" | "white" | "yellow">
|
|
71
|
+
|
|
72
|
+
export type TokenValue<T extends string> = T extends keyof Tokens ? Tokens[T] : never
|
package/css/conditions.mjs
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { withoutSpace } from '../helpers.mjs';
|
|
2
|
-
|
|
3
|
-
const conditionsStr = "_liveQuoteTheme,_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_collapsed,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,smToMd,smToLg,smToXl,mdToLg,mdToXl,lgToXl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,@/lg,@/md,@/sm,@/xl,@/xs,base"
|
|
4
|
-
const conditions = new Set(conditionsStr.split(','))
|
|
5
|
-
|
|
6
|
-
const conditionRegex = /^@|&|&$/
|
|
7
|
-
|
|
8
|
-
export function isCondition(value){
|
|
9
|
-
return conditions.has(value) || conditionRegex.test(value)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const underscoreRegex = /^_/
|
|
13
|
-
const conditionsSelectorRegex = /&|@/
|
|
14
|
-
|
|
15
|
-
export function finalizeConditions(paths){
|
|
16
|
-
return paths.map((path) => {
|
|
17
|
-
if (conditions.has(path)){
|
|
18
|
-
return path.replace(underscoreRegex, '')
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (conditionsSelectorRegex.test(path)){
|
|
22
|
-
return `[${withoutSpace(path.trim())}]`
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return path
|
|
26
|
-
})}
|
|
27
|
-
|
|
28
|
-
export function sortConditions(paths){
|
|
29
|
-
return paths.sort((a, b) => {
|
|
30
|
-
const aa = isCondition(a)
|
|
31
|
-
const bb = isCondition(b)
|
|
32
|
-
if (aa && !bb) return 1
|
|
33
|
-
if (!aa && bb) return -1
|
|
34
|
-
return 0
|
|
35
|
-
})
|
|
36
|
-
}
|
package/css/css.mjs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { createCss, createMergeCss, hypenateProperty, withoutSpace } from '../helpers.mjs';
|
|
2
|
-
import { sortConditions, finalizeConditions } from './conditions.mjs';
|
|
3
|
-
|
|
4
|
-
const utilities = "aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos/1,top:top,left:left,inset:inset,insetInline:inset-x/insetX,insetBlock:inset-y/insetY,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e/insetEnd/end,insetInlineStart:inset-s/insetStart/start,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d/flexDir,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/1/paddingY,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px/paddingX/1,paddingInlineEnd:pe/1/paddingEnd,paddingInlineStart:ps/1/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/1/marginY,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx/1/marginX,marginInlineEnd:me/1/marginEnd,marginInlineStart:ms/1/marginStart,spaceX:sx,spaceY:sy,outlineWidth:ring-w/ringWidth,outlineColor:ring-c/ringColor,outline:ring/1,outlineOffset:ring-o/ringOffset,focusRing:focus-ring,focusVisibleRing:focus-v-ring,focusRingColor:focus-ring-c,focusRingOffset:focus-ring-o,focusRingWidth:focus-ring-w,focusRingStyle:focus-ring-s,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w/1,inlineSize:w-is,minWidth:min-w/minW,minInlineSize:min-w-is,maxWidth:max-w/maxW,maxInlineSize:max-w-is,height:h/1,blockSize:h-bs,minHeight:min-h/minH,minBlockSize:min-h-bs,maxHeight:max-h/maxH,maxBlockSize:max-b,boxSize:size,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c/textShadowColor,WebkitTextFillColor:wktf-c,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p/bgPosition,backgroundPositionX:bg-p-x/bgPositionX,backgroundPositionY:bg-p-y/bgPositionY,backgroundAttachment:bg-a/bgAttachment,backgroundClip:bg-cp/bgClip,background:bg/1,backgroundColor:bg-c/bgColor,backgroundOrigin:bg-o/bgOrigin,backgroundImage:bg-i/bgImage,backgroundRepeat:bg-r/bgRepeat,backgroundBlendMode:bg-bm/bgBlendMode,backgroundSize:bg-s/bgSize,backgroundGradient:bg-grad/bgGradient,backgroundLinear:bg-linear/bgLinear,backgroundRadial:bg-radial/bgRadial,backgroundConic:bg-conic/bgConic,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr/rounded,borderTopLeftRadius:bdr-tl/roundedTopLeft,borderTopRightRadius:bdr-tr/roundedTopRight,borderBottomRightRadius:bdr-br/roundedBottomRight,borderBottomLeftRadius:bdr-bl/roundedBottomLeft,borderTopRadius:bdr-t/roundedTop,borderRightRadius:bdr-r/roundedRight,borderBottomRadius:bdr-b/roundedBottom,borderLeftRadius:bdr-l/roundedLeft,borderStartStartRadius:bdr-ss/roundedStartStart,borderStartEndRadius:bdr-se/roundedStartEnd,borderStartRadius:bdr-s/roundedStart,borderEndStartRadius:bdr-es/roundedEndStart,borderEndEndRadius:bdr-ee/roundedEndEnd,borderEndRadius:bdr-e/roundedEnd,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderBlockStartWidth:bd-bs-w,borderBlockEndWidth:bd-be-w,borderColor:bd-c,borderInline:bd-x/borderX,borderInlineWidth:bd-x-w/borderXWidth,borderInlineColor:bd-x-c/borderXColor,borderBlock:bd-y/borderY,borderBlockWidth:bd-y-w/borderYWidth,borderBlockColor:bd-y-c/borderYColor,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s/borderStart,borderInlineStartWidth:bd-s-w/borderStartWidth,borderInlineStartColor:bd-s-c/borderStartColor,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e/borderEnd,borderInlineEndWidth:bd-e-w/borderEndWidth,borderInlineEndColor:bd-e-c/borderEndColor,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh/shadow,boxShadowColor:bx-sh-c/shadowColor,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,translateZ:translate-z/z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my/scrollMarginY,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx/scrollMarginX,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py/scrollPaddingY,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px/scrollPaddingX,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,cursor:cursor,textStyle:textStyle"
|
|
5
|
-
|
|
6
|
-
const classNameByProp = new Map()
|
|
7
|
-
const shorthands = new Map()
|
|
8
|
-
utilities.split(',').forEach((utility) => {
|
|
9
|
-
const [prop, meta] = utility.split(':')
|
|
10
|
-
const [className, ...shorthandList] = meta.split('/')
|
|
11
|
-
classNameByProp.set(prop, className)
|
|
12
|
-
if (shorthandList.length) {
|
|
13
|
-
shorthandList.forEach((shorthand) => {
|
|
14
|
-
shorthands.set(shorthand === '1' ? className : shorthand, prop)
|
|
15
|
-
})
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
const resolveShorthand = (prop) => shorthands.get(prop) || prop
|
|
20
|
-
|
|
21
|
-
const context = {
|
|
22
|
-
|
|
23
|
-
conditions: {
|
|
24
|
-
shift: sortConditions,
|
|
25
|
-
finalize: finalizeConditions,
|
|
26
|
-
breakpoints: { keys: ["base","sm","md","lg","xl"] }
|
|
27
|
-
},
|
|
28
|
-
utility: {
|
|
29
|
-
|
|
30
|
-
transform: (prop, value) => {
|
|
31
|
-
const key = resolveShorthand(prop)
|
|
32
|
-
const propKey = classNameByProp.get(key) || hypenateProperty(key)
|
|
33
|
-
return { className: `${propKey}_${withoutSpace(value)}` }
|
|
34
|
-
},
|
|
35
|
-
hasShorthand: true,
|
|
36
|
-
toHash: (path, hashFn) => hashFn(path.join(":")),
|
|
37
|
-
resolveShorthand: resolveShorthand,
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const cssFn = createCss(context)
|
|
42
|
-
export const css = (...styles) => cssFn(mergeCss(...styles))
|
|
43
|
-
css.raw = (...styles) => mergeCss(...styles)
|
|
44
|
-
|
|
45
|
-
export const { mergeCss, assignCss } = createMergeCss(context)
|
package/css/cva.mjs
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { compact, mergeProps, memo, splitProps, uniq } from '../helpers.mjs';
|
|
2
|
-
import { css, mergeCss } from './css.mjs';
|
|
3
|
-
|
|
4
|
-
const defaults = (conf) => ({
|
|
5
|
-
base: {},
|
|
6
|
-
variants: {},
|
|
7
|
-
defaultVariants: {},
|
|
8
|
-
compoundVariants: [],
|
|
9
|
-
...conf,
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
export function cva(config) {
|
|
13
|
-
const { base, variants, defaultVariants, compoundVariants } = defaults(config)
|
|
14
|
-
const getVariantProps = (variants) => ({ ...defaultVariants, ...compact(variants) })
|
|
15
|
-
|
|
16
|
-
function resolve(props = {}) {
|
|
17
|
-
const computedVariants = getVariantProps(props)
|
|
18
|
-
let variantCss = { ...base }
|
|
19
|
-
for (const [key, value] of Object.entries(computedVariants)) {
|
|
20
|
-
if (variants[key]?.[value]) {
|
|
21
|
-
variantCss = mergeCss(variantCss, variants[key][value])
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
const compoundVariantCss = getCompoundVariantCss(compoundVariants, computedVariants)
|
|
25
|
-
return mergeCss(variantCss, compoundVariantCss)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function merge(__cva) {
|
|
29
|
-
const override = defaults(__cva.config)
|
|
30
|
-
const variantKeys = uniq(__cva.variantKeys, Object.keys(variants))
|
|
31
|
-
return cva({
|
|
32
|
-
base: mergeCss(base, override.base),
|
|
33
|
-
variants: Object.fromEntries(
|
|
34
|
-
variantKeys.map((key) => [key, mergeCss(variants[key], override.variants[key])]),
|
|
35
|
-
),
|
|
36
|
-
defaultVariants: mergeProps(defaultVariants, override.defaultVariants),
|
|
37
|
-
compoundVariants: [...compoundVariants, ...override.compoundVariants],
|
|
38
|
-
})
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function cvaFn(props) {
|
|
42
|
-
return css(resolve(props))
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const variantKeys = Object.keys(variants)
|
|
46
|
-
|
|
47
|
-
function splitVariantProps(props) {
|
|
48
|
-
return splitProps(props, variantKeys)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const variantMap = Object.fromEntries(Object.entries(variants).map(([key, value]) => [key, Object.keys(value)]))
|
|
52
|
-
|
|
53
|
-
return Object.assign(memo(cvaFn), {
|
|
54
|
-
__cva__: true,
|
|
55
|
-
variantMap,
|
|
56
|
-
variantKeys,
|
|
57
|
-
raw: resolve,
|
|
58
|
-
config,
|
|
59
|
-
merge,
|
|
60
|
-
splitVariantProps,
|
|
61
|
-
getVariantProps
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function getCompoundVariantCss(compoundVariants, variantMap) {
|
|
66
|
-
let result = {}
|
|
67
|
-
compoundVariants.forEach((compoundVariant) => {
|
|
68
|
-
const isMatching = Object.entries(compoundVariant).every(([key, value]) => {
|
|
69
|
-
if (key === 'css') return true
|
|
70
|
-
|
|
71
|
-
const values = Array.isArray(value) ? value : [value]
|
|
72
|
-
return values.some((value) => variantMap[key] === value)
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
if (isMatching) {
|
|
76
|
-
result = mergeCss(result, compoundVariant.css)
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
return result
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export function assertCompoundVariant(name, compoundVariants, variants, prop) {
|
|
84
|
-
if (compoundVariants.length > 0 && typeof variants?.[prop] === 'object') {
|
|
85
|
-
throw new Error(`[recipe:${name}:${prop}] Conditions are not supported when using compound variants.`)
|
|
86
|
-
}
|
|
87
|
-
}
|
package/css/index.mjs
DELETED
package/css/sva.mjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { compact, getSlotRecipes, memo, splitProps } from '../helpers.mjs';
|
|
2
|
-
import { cva } from './cva.mjs';
|
|
3
|
-
import { cx } from './cx.mjs';
|
|
4
|
-
|
|
5
|
-
export function sva(config) {
|
|
6
|
-
const slots = Object.entries(getSlotRecipes(config)).map(([slot, slotCva]) => [slot, cva(slotCva)])
|
|
7
|
-
const defaultVariants = config.defaultVariants ?? {}
|
|
8
|
-
|
|
9
|
-
const classNameMap = slots.reduce((acc, [slot, cvaFn]) => {
|
|
10
|
-
if (config.className) acc[slot] = cvaFn.config.className
|
|
11
|
-
return acc
|
|
12
|
-
}, {})
|
|
13
|
-
|
|
14
|
-
function svaFn(props) {
|
|
15
|
-
const result = slots.map(([slot, cvaFn]) => [slot, cx(cvaFn(props), classNameMap[slot])])
|
|
16
|
-
return Object.fromEntries(result)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function raw(props) {
|
|
20
|
-
const result = slots.map(([slot, cvaFn]) => [slot, cvaFn.raw(props)])
|
|
21
|
-
return Object.fromEntries(result)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const variants = config.variants ?? {};
|
|
25
|
-
const variantKeys = Object.keys(variants);
|
|
26
|
-
|
|
27
|
-
function splitVariantProps(props) {
|
|
28
|
-
return splitProps(props, variantKeys);
|
|
29
|
-
}
|
|
30
|
-
const getVariantProps = (variants) => ({ ...defaultVariants, ...compact(variants) })
|
|
31
|
-
|
|
32
|
-
const variantMap = Object.fromEntries(
|
|
33
|
-
Object.entries(variants).map(([key, value]) => [key, Object.keys(value)])
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
return Object.assign(memo(svaFn), {
|
|
37
|
-
__cva__: false,
|
|
38
|
-
raw,
|
|
39
|
-
config,
|
|
40
|
-
variantMap,
|
|
41
|
-
variantKeys,
|
|
42
|
-
classNameMap,
|
|
43
|
-
splitVariantProps,
|
|
44
|
-
getVariantProps,
|
|
45
|
-
})
|
|
46
|
-
}
|
package/helpers.mjs
DELETED
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
// src/assert.ts
|
|
2
|
-
function isObject(value) {
|
|
3
|
-
return typeof value === "object" && value != null && !Array.isArray(value);
|
|
4
|
-
}
|
|
5
|
-
var isObjectOrArray = (obj) => typeof obj === "object" && obj !== null;
|
|
6
|
-
|
|
7
|
-
// src/compact.ts
|
|
8
|
-
function compact(value) {
|
|
9
|
-
return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value2]) => value2 !== void 0));
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// src/condition.ts
|
|
13
|
-
var isBaseCondition = (v) => v === "base";
|
|
14
|
-
function filterBaseConditions(c) {
|
|
15
|
-
return c.slice().filter((v) => !isBaseCondition(v));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// src/hash.ts
|
|
19
|
-
function toChar(code) {
|
|
20
|
-
return String.fromCharCode(code + (code > 25 ? 39 : 97));
|
|
21
|
-
}
|
|
22
|
-
function toName(code) {
|
|
23
|
-
let name = "";
|
|
24
|
-
let x;
|
|
25
|
-
for (x = Math.abs(code); x > 52; x = x / 52 | 0) name = toChar(x % 52) + name;
|
|
26
|
-
return toChar(x % 52) + name;
|
|
27
|
-
}
|
|
28
|
-
function toPhash(h, x) {
|
|
29
|
-
let i = x.length;
|
|
30
|
-
while (i) h = h * 33 ^ x.charCodeAt(--i);
|
|
31
|
-
return h;
|
|
32
|
-
}
|
|
33
|
-
function toHash(value) {
|
|
34
|
-
return toName(toPhash(5381, value) >>> 0);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// src/important.ts
|
|
38
|
-
var importantRegex = /\s*!(important)?/i;
|
|
39
|
-
function isImportant(value) {
|
|
40
|
-
return typeof value === "string" ? importantRegex.test(value) : false;
|
|
41
|
-
}
|
|
42
|
-
function withoutImportant(value) {
|
|
43
|
-
return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
|
|
44
|
-
}
|
|
45
|
-
function withoutSpace(str) {
|
|
46
|
-
return typeof str === "string" ? str.replaceAll(" ", "_") : str;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// src/memo.ts
|
|
50
|
-
var memo = (fn) => {
|
|
51
|
-
const cache = /* @__PURE__ */ new Map();
|
|
52
|
-
const get = (...args) => {
|
|
53
|
-
const key = JSON.stringify(args);
|
|
54
|
-
if (cache.has(key)) {
|
|
55
|
-
return cache.get(key);
|
|
56
|
-
}
|
|
57
|
-
const result = fn(...args);
|
|
58
|
-
cache.set(key, result);
|
|
59
|
-
return result;
|
|
60
|
-
};
|
|
61
|
-
return get;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
// src/merge-props.ts
|
|
65
|
-
var MERGE_OMIT = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
66
|
-
function mergeProps(...sources) {
|
|
67
|
-
return sources.reduce((prev, obj) => {
|
|
68
|
-
if (!obj) return prev;
|
|
69
|
-
Object.keys(obj).forEach((key) => {
|
|
70
|
-
if (MERGE_OMIT.has(key)) return;
|
|
71
|
-
const prevValue = prev[key];
|
|
72
|
-
const value = obj[key];
|
|
73
|
-
if (isObject(prevValue) && isObject(value)) {
|
|
74
|
-
prev[key] = mergeProps(prevValue, value);
|
|
75
|
-
} else {
|
|
76
|
-
prev[key] = value;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
return prev;
|
|
80
|
-
}, {});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// src/walk-object.ts
|
|
84
|
-
var isNotNullish = (element) => element != null;
|
|
85
|
-
function walkObject(target, predicate, options = {}) {
|
|
86
|
-
const { stop, getKey } = options;
|
|
87
|
-
function inner(value, path = []) {
|
|
88
|
-
if (isObjectOrArray(value)) {
|
|
89
|
-
const result = {};
|
|
90
|
-
for (const [prop, child] of Object.entries(value)) {
|
|
91
|
-
const key = getKey?.(prop, child) ?? prop;
|
|
92
|
-
const childPath = [...path, key];
|
|
93
|
-
if (stop?.(value, childPath)) {
|
|
94
|
-
return predicate(value, path);
|
|
95
|
-
}
|
|
96
|
-
const next = inner(child, childPath);
|
|
97
|
-
if (isNotNullish(next)) {
|
|
98
|
-
result[key] = next;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return result;
|
|
102
|
-
}
|
|
103
|
-
return predicate(value, path);
|
|
104
|
-
}
|
|
105
|
-
return inner(target);
|
|
106
|
-
}
|
|
107
|
-
function mapObject(obj, fn) {
|
|
108
|
-
if (Array.isArray(obj)) return obj.map((value) => fn(value));
|
|
109
|
-
if (!isObject(obj)) return fn(obj);
|
|
110
|
-
return walkObject(obj, (value) => fn(value));
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// src/normalize-style-object.ts
|
|
114
|
-
function toResponsiveObject(values, breakpoints) {
|
|
115
|
-
return values.reduce(
|
|
116
|
-
(acc, current, index) => {
|
|
117
|
-
const key = breakpoints[index];
|
|
118
|
-
if (current != null) {
|
|
119
|
-
acc[key] = current;
|
|
120
|
-
}
|
|
121
|
-
return acc;
|
|
122
|
-
},
|
|
123
|
-
{}
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
function normalizeStyleObject(styles, context, shorthand = true) {
|
|
127
|
-
const { utility, conditions } = context;
|
|
128
|
-
const { hasShorthand, resolveShorthand } = utility;
|
|
129
|
-
return walkObject(
|
|
130
|
-
styles,
|
|
131
|
-
(value) => {
|
|
132
|
-
return Array.isArray(value) ? toResponsiveObject(value, conditions.breakpoints.keys) : value;
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
stop: (value) => Array.isArray(value),
|
|
136
|
-
getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// src/classname.ts
|
|
142
|
-
var fallbackCondition = {
|
|
143
|
-
shift: (v) => v,
|
|
144
|
-
finalize: (v) => v,
|
|
145
|
-
breakpoints: { keys: [] }
|
|
146
|
-
};
|
|
147
|
-
var sanitize = (value) => typeof value === "string" ? value.replaceAll(/[\n\s]+/g, " ") : value;
|
|
148
|
-
function createCss(context) {
|
|
149
|
-
const { utility, hash, conditions: conds = fallbackCondition } = context;
|
|
150
|
-
const formatClassName = (str) => [utility.prefix, str].filter(Boolean).join("-");
|
|
151
|
-
const hashFn = (conditions, className) => {
|
|
152
|
-
let result;
|
|
153
|
-
if (hash) {
|
|
154
|
-
const baseArray = [...conds.finalize(conditions), className];
|
|
155
|
-
result = formatClassName(utility.toHash(baseArray, toHash));
|
|
156
|
-
} else {
|
|
157
|
-
const baseArray = [...conds.finalize(conditions), formatClassName(className)];
|
|
158
|
-
result = baseArray.join(":");
|
|
159
|
-
}
|
|
160
|
-
return result;
|
|
161
|
-
};
|
|
162
|
-
return memo(({ base, ...styles } = {}) => {
|
|
163
|
-
const styleObject = Object.assign(styles, base);
|
|
164
|
-
const normalizedObject = normalizeStyleObject(styleObject, context);
|
|
165
|
-
const classNames = /* @__PURE__ */ new Set();
|
|
166
|
-
walkObject(normalizedObject, (value, paths) => {
|
|
167
|
-
if (value == null) return;
|
|
168
|
-
const important = isImportant(value);
|
|
169
|
-
const [prop, ...allConditions] = conds.shift(paths);
|
|
170
|
-
const conditions = filterBaseConditions(allConditions);
|
|
171
|
-
const transformed = utility.transform(prop, withoutImportant(sanitize(value)));
|
|
172
|
-
let className = hashFn(conditions, transformed.className);
|
|
173
|
-
if (important) className = `${className}!`;
|
|
174
|
-
classNames.add(className);
|
|
175
|
-
});
|
|
176
|
-
return Array.from(classNames).join(" ");
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
function compactStyles(...styles) {
|
|
180
|
-
return styles.flat().filter((style) => isObject(style) && Object.keys(compact(style)).length > 0);
|
|
181
|
-
}
|
|
182
|
-
function createMergeCss(context) {
|
|
183
|
-
function resolve(styles) {
|
|
184
|
-
const allStyles = compactStyles(...styles);
|
|
185
|
-
if (allStyles.length === 1) return allStyles;
|
|
186
|
-
return allStyles.map((style) => normalizeStyleObject(style, context));
|
|
187
|
-
}
|
|
188
|
-
function mergeCss(...styles) {
|
|
189
|
-
return mergeProps(...resolve(styles));
|
|
190
|
-
}
|
|
191
|
-
function assignCss(...styles) {
|
|
192
|
-
return Object.assign({}, ...resolve(styles));
|
|
193
|
-
}
|
|
194
|
-
return { mergeCss: memo(mergeCss), assignCss };
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// src/hypenate-property.ts
|
|
198
|
-
var wordRegex = /([A-Z])/g;
|
|
199
|
-
var msRegex = /^ms-/;
|
|
200
|
-
var hypenateProperty = memo((property) => {
|
|
201
|
-
if (property.startsWith("--")) return property;
|
|
202
|
-
return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
// src/is-css-function.ts
|
|
206
|
-
var fns = ["min", "max", "clamp", "calc"];
|
|
207
|
-
var fnRegExp = new RegExp(`^(${fns.join("|")})\\(.*\\)`);
|
|
208
|
-
var isCssFunction = (v) => typeof v === "string" && fnRegExp.test(v);
|
|
209
|
-
|
|
210
|
-
// src/is-css-unit.ts
|
|
211
|
-
var lengthUnits = "cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%";
|
|
212
|
-
var lengthUnitsPattern = `(?:${lengthUnits.split(",").join("|")})`;
|
|
213
|
-
var lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);
|
|
214
|
-
var isCssUnit = (v) => typeof v === "string" && lengthRegExp.test(v);
|
|
215
|
-
|
|
216
|
-
// src/is-css-var.ts
|
|
217
|
-
var isCssVar = (v) => typeof v === "string" && /^var\(--.+\)$/.test(v);
|
|
218
|
-
|
|
219
|
-
// src/pattern-fns.ts
|
|
220
|
-
var patternFns = {
|
|
221
|
-
map: mapObject,
|
|
222
|
-
isCssFunction,
|
|
223
|
-
isCssVar,
|
|
224
|
-
isCssUnit
|
|
225
|
-
};
|
|
226
|
-
var getPatternStyles = (pattern, styles) => {
|
|
227
|
-
if (!pattern?.defaultValues) return styles;
|
|
228
|
-
const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;
|
|
229
|
-
return Object.assign({}, defaults, compact(styles));
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
// src/slot.ts
|
|
233
|
-
var getSlotRecipes = (recipe = {}) => {
|
|
234
|
-
const init = (slot) => ({
|
|
235
|
-
className: [recipe.className, slot].filter(Boolean).join("__"),
|
|
236
|
-
base: recipe.base?.[slot] ?? {},
|
|
237
|
-
variants: {},
|
|
238
|
-
defaultVariants: recipe.defaultVariants ?? {},
|
|
239
|
-
compoundVariants: recipe.compoundVariants ? getSlotCompoundVariant(recipe.compoundVariants, slot) : []
|
|
240
|
-
});
|
|
241
|
-
const slots = recipe.slots ?? [];
|
|
242
|
-
const recipeParts = slots.map((slot) => [slot, init(slot)]);
|
|
243
|
-
for (const [variantsKey, variantsSpec] of Object.entries(recipe.variants ?? {})) {
|
|
244
|
-
for (const [variantKey, variantSpec] of Object.entries(variantsSpec)) {
|
|
245
|
-
recipeParts.forEach(([slot, slotRecipe]) => {
|
|
246
|
-
slotRecipe.variants[variantsKey] ??= {};
|
|
247
|
-
slotRecipe.variants[variantsKey][variantKey] = variantSpec[slot] ?? {};
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
return Object.fromEntries(recipeParts);
|
|
252
|
-
};
|
|
253
|
-
var getSlotCompoundVariant = (compoundVariants, slotName) => compoundVariants.filter((compoundVariant) => compoundVariant.css[slotName]).map((compoundVariant) => ({ ...compoundVariant, css: compoundVariant.css[slotName] }));
|
|
254
|
-
|
|
255
|
-
// src/split-props.ts
|
|
256
|
-
function splitProps(props, ...keys) {
|
|
257
|
-
const descriptors = Object.getOwnPropertyDescriptors(props);
|
|
258
|
-
const dKeys = Object.keys(descriptors);
|
|
259
|
-
const split = (k) => {
|
|
260
|
-
const clone = {};
|
|
261
|
-
for (let i = 0; i < k.length; i++) {
|
|
262
|
-
const key = k[i];
|
|
263
|
-
if (descriptors[key]) {
|
|
264
|
-
Object.defineProperty(clone, key, descriptors[key]);
|
|
265
|
-
delete descriptors[key];
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return clone;
|
|
269
|
-
};
|
|
270
|
-
const fn = (key) => split(Array.isArray(key) ? key : dKeys.filter(key));
|
|
271
|
-
return keys.map(fn).concat(split(dKeys));
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// src/uniq.ts
|
|
275
|
-
var uniq = (...items) => {
|
|
276
|
-
const set = items.reduce((acc, currItems) => {
|
|
277
|
-
if (currItems) {
|
|
278
|
-
currItems.forEach((item) => acc.add(item));
|
|
279
|
-
}
|
|
280
|
-
return acc;
|
|
281
|
-
}, /* @__PURE__ */ new Set([]));
|
|
282
|
-
return Array.from(set);
|
|
283
|
-
};
|
|
284
|
-
export {
|
|
285
|
-
compact,
|
|
286
|
-
createCss,
|
|
287
|
-
createMergeCss,
|
|
288
|
-
filterBaseConditions,
|
|
289
|
-
getPatternStyles,
|
|
290
|
-
getSlotCompoundVariant,
|
|
291
|
-
getSlotRecipes,
|
|
292
|
-
hypenateProperty,
|
|
293
|
-
isBaseCondition,
|
|
294
|
-
isObject,
|
|
295
|
-
mapObject,
|
|
296
|
-
memo,
|
|
297
|
-
mergeProps,
|
|
298
|
-
patternFns,
|
|
299
|
-
splitProps,
|
|
300
|
-
toHash,
|
|
301
|
-
uniq,
|
|
302
|
-
walkObject,
|
|
303
|
-
withoutSpace
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
// src/normalize-html.ts
|
|
309
|
-
var htmlProps = ["htmlSize", "htmlTranslate", "htmlWidth", "htmlHeight"];
|
|
310
|
-
function convert(key) {
|
|
311
|
-
return htmlProps.includes(key) ? key.replace("html", "").toLowerCase() : key;
|
|
312
|
-
}
|
|
313
|
-
function normalizeHTMLProps(props) {
|
|
314
|
-
return Object.fromEntries(Object.entries(props).map(([key, value]) => [convert(key), value]));
|
|
315
|
-
}
|
|
316
|
-
normalizeHTMLProps.keys = htmlProps;
|
|
317
|
-
export {
|
|
318
|
-
normalizeHTMLProps
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
export function __spreadValues(a, b) {
|
|
323
|
-
return { ...a, ...b }
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
export function __objRest(source, exclude) {
|
|
327
|
-
return Object.fromEntries(Object.entries(source).filter(([key]) => !exclude.includes(key)))
|
|
328
|
-
}
|
package/jsx/aspect-ratio.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createElement, forwardRef } from 'react'
|
|
2
|
-
|
|
3
|
-
import { splitProps } from '../helpers.mjs';
|
|
4
|
-
import { getAspectRatioStyle } from '../patterns/aspect-ratio.mjs';
|
|
5
|
-
import { styled } from './factory.mjs';
|
|
6
|
-
|
|
7
|
-
export const AspectRatio = /* @__PURE__ */ forwardRef(function AspectRatio(props, ref) {
|
|
8
|
-
const [patternProps, restProps] = splitProps(props, ["ratio"])
|
|
9
|
-
|
|
10
|
-
const styleProps = getAspectRatioStyle(patternProps)
|
|
11
|
-
const mergedProps = { ref, ...styleProps, ...restProps }
|
|
12
|
-
|
|
13
|
-
return createElement(styled.div, mergedProps)
|
|
14
|
-
})
|