@yahoo/uds 3.59.0-beta.1 β 3.59.0-beta.2
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/cli/bin/uds-darwin-arm64-baseline +0 -0
- package/cli/bin/uds-darwin-x64 +0 -0
- package/cli/bin/uds-linux-arm64 +0 -0
- package/cli/bin/uds-linux-x64-baseline +0 -0
- package/dist/components/Box.d.ts +2 -2
- package/dist/components/Box.d.ts.map +1 -1
- package/dist/components/Divider/Divider.d.cts +2 -2
- package/dist/components/Divider/Divider.d.ts +2 -2
- package/dist/components/Divider/DividerCore.d.cts +2 -2
- package/dist/components/Divider/DividerCore.d.ts +2 -2
- package/dist/components/Divider/DividerInternal.d.cts +2 -2
- package/dist/components/Divider/DividerInternal.d.ts +2 -2
- package/dist/components/FormLabel.d.ts +2 -2
- package/dist/components/HStack.d.ts +2 -2
- package/dist/components/Icon.d.ts +2 -2
- package/dist/components/Link.d.ts +2 -2
- package/dist/components/Text.d.cts +5 -5
- package/dist/components/Text.d.cts.map +1 -1
- package/dist/components/Text.d.ts +8 -8
- package/dist/components/Text.d.ts.map +1 -1
- package/dist/components/VStack.d.ts +2 -2
- package/dist/components/VStack.d.ts.map +1 -1
- package/dist/components/client/AnimateHeightChange.d.cts +2 -2
- package/dist/components/client/AnimateHeightChange.d.ts +2 -2
- package/dist/components/client/Avatar/Avatar.d.cts +2 -2
- package/dist/components/client/Avatar/Avatar.d.cts.map +1 -1
- package/dist/components/client/Avatar/Avatar.d.ts +2 -2
- package/dist/components/client/Avatar/AvatarIcon.d.cts +2 -2
- package/dist/components/client/Avatar/AvatarIcon.d.cts.map +1 -1
- package/dist/components/client/Avatar/AvatarIcon.d.ts +2 -2
- package/dist/components/client/Avatar/AvatarImage.d.cts +2 -2
- package/dist/components/client/Avatar/AvatarImage.d.ts +2 -2
- package/dist/components/client/Avatar/AvatarText.d.cts +2 -2
- package/dist/components/client/Avatar/AvatarText.d.ts +2 -2
- package/dist/components/client/IconButton.d.cts +2 -2
- package/dist/components/client/IconButton.d.ts +2 -2
- package/dist/components/client/IconButton.d.ts.map +1 -1
- package/dist/components/client/Input/Input.d.cts +2 -2
- package/dist/components/client/Input/Input.d.ts +2 -2
- package/dist/components/client/Input/InputHelpText.d.cts +2 -2
- package/dist/components/client/Input/InputHelpText.d.cts.map +1 -1
- package/dist/components/client/Input/InputHelpText.d.ts +2 -2
- package/dist/components/client/Input/InputHelpTextInternal.d.cts +4 -4
- package/dist/components/client/Input/InputHelpTextInternal.d.cts.map +1 -1
- package/dist/components/client/Input/InputHelpTextInternal.d.ts +4 -4
- package/dist/components/client/Menu/Menu.Content.d.cts +2 -2
- package/dist/components/client/Menu/Menu.Content.d.ts +2 -2
- package/dist/components/client/Menu/Menu.Divider.d.cts +2 -2
- package/dist/components/client/Menu/Menu.Divider.d.ts +2 -2
- package/dist/components/client/Menu/Menu.Item.d.cts +2 -2
- package/dist/components/client/Menu/Menu.ItemBase.d.cts +2 -2
- package/dist/components/client/Menu/Menu.ItemBase.d.ts +2 -2
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +2 -2
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +2 -2
- package/dist/components/client/Menu/Menu.Provider.d.cts +2 -2
- package/dist/components/client/Menu/Menu.Provider.d.ts +2 -2
- package/dist/components/client/Menu/Menu.Trigger.d.cts +2 -2
- package/dist/components/client/Menu/Menu.Trigger.d.ts +2 -2
- package/dist/components/client/Pressable.d.cts +2 -2
- package/dist/components/client/Pressable.d.ts +2 -2
- package/dist/components/client/Pressable.d.ts.map +1 -1
- package/dist/components/client/Radio/RadioGroupStore.d.ts +2 -2
- package/dist/components/client/SpringMotionConfig.d.cts +3 -3
- package/dist/components/client/SpringMotionConfig.d.ts +3 -3
- package/dist/components/client/SpringMotionConfig.d.ts.map +1 -1
- package/dist/components/experimental/Spinner.d.cts +2 -2
- package/dist/components/experimental/Spinner.d.cts.map +1 -1
- package/dist/components/experimental/Spinner.d.ts +2 -2
- package/dist/components/experimental/Table.d.cts +2 -2
- package/dist/components/experimental/Table.d.ts +2 -2
- package/dist/components/experimental/client/Accordion.d.cts +2 -2
- package/dist/components/experimental/client/Accordion.d.cts.map +1 -1
- package/dist/components/experimental/client/Accordion.d.ts +2 -2
- package/dist/components/experimental/client/AvoidMotionLibraryProvider.d.cts +2 -2
- package/dist/components/experimental/client/AvoidMotionLibraryProvider.d.ts +2 -2
- package/dist/components/experimental/client/Modal.d.cts +3 -3
- package/dist/components/experimental/client/Modal.d.cts.map +1 -1
- package/dist/components/experimental/client/Modal.d.ts +3 -3
- package/dist/components/experimental/client/Popover.d.cts +3 -3
- package/dist/components/experimental/client/Popover.d.cts.map +1 -1
- package/dist/components/experimental/client/Popover.d.ts +3 -3
- package/dist/components/experimental/client/Tabs.d.cts +3 -3
- package/dist/components/experimental/client/Tabs.d.ts +6 -6
- package/dist/components/experimental/client/Toast.d.cts +2 -2
- package/dist/components/experimental/client/Toast.d.ts +2 -2
- package/dist/providers/ColorModeProvider.d.cts +4 -4
- package/dist/providers/ColorModeProvider.d.cts.map +1 -1
- package/dist/providers/ColorModeProvider.d.ts +4 -4
- package/dist/providers/ColorModeProvider.d.ts.map +1 -1
- package/dist/providers/ScaleModeProvider.d.cts +4 -4
- package/dist/providers/ScaleModeProvider.d.cts.map +1 -1
- package/dist/providers/ScaleModeProvider.d.ts +4 -4
- package/dist/providers/ScaleModeProvider.d.ts.map +1 -1
- package/dist/providers/ThemeProvider.d.cts +2 -2
- package/dist/providers/ThemeProvider.d.cts.map +1 -1
- package/dist/providers/ThemeProvider.d.ts +2 -2
- package/dist/styles/styler.d.cts +33 -33
- package/dist/styles/styler.d.ts +33 -33
- package/dist/styles/stylerTypes.d.ts.map +1 -1
- package/dist/tailwind/tailwind.config.d.ts +3 -3
- package/dist/tailwind/tailwindPlugin.d.ts +3 -3
- package/dist/tailwind/utils/getMotionStyles.d.cts +1 -1
- package/dist/tailwind/utils/getMotionStyles.d.ts +1 -1
- package/dist/tokens/automation/utils/getConfigVariantProperties.d.cts +2 -2
- package/dist/tokens/automation/utils/getConfigVariantProperties.d.cts.map +1 -1
- package/dist/tokens/automation/utils/getConfigVariantProperties.d.ts +2 -2
- package/dist/tokens/automation/utils/getConfigVariantProperties.d.ts.map +1 -1
- package/dist/tokens/types.d.cts.map +1 -1
- package/dist/tokens/types.d.ts.map +1 -1
- package/dist/utils/intersperse.d.cts +2 -2
- package/dist/utils/intersperse.d.ts +2 -2
- package/package.json +1 -3
- package/cli/FlattenButtonVariant.mock.tsx +0 -17
- package/src/components/Box.tsx +0 -181
- package/src/components/Divider/Divider.tsx +0 -44
- package/src/components/Divider/DividerCore.tsx +0 -101
- package/src/components/Divider/DividerInternal.tsx +0 -56
- package/src/components/Divider/index.ts +0 -1
- package/src/components/FormLabel.tsx +0 -66
- package/src/components/HStack.tsx +0 -53
- package/src/components/Icon.tsx +0 -82
- package/src/components/IconSlot.tsx +0 -82
- package/src/components/Image.tsx +0 -162
- package/src/components/Link.tsx +0 -134
- package/src/components/Text.tsx +0 -272
- package/src/components/VStack.tsx +0 -53
- package/src/components/client/AnimateHeightChange.tsx +0 -50
- package/src/components/client/Avatar/Avatar.tsx +0 -31
- package/src/components/client/Avatar/AvatarIcon.tsx +0 -103
- package/src/components/client/Avatar/AvatarImage.tsx +0 -147
- package/src/components/client/Avatar/AvatarText.tsx +0 -88
- package/src/components/client/Avatar/index.ts +0 -4
- package/src/components/client/Avatar/utils.ts +0 -105
- package/src/components/client/Badge.tsx +0 -133
- package/src/components/client/Button.tsx +0 -312
- package/src/components/client/Checkbox.tsx +0 -377
- package/src/components/client/Chip/Chip.tsx +0 -81
- package/src/components/client/Chip/ChipBase.tsx +0 -151
- package/src/components/client/Chip/ChipButton.tsx +0 -54
- package/src/components/client/Chip/ChipDismissible.tsx +0 -90
- package/src/components/client/Chip/ChipLink.tsx +0 -60
- package/src/components/client/Chip/ChipToggle.tsx +0 -79
- package/src/components/client/Chip/index.ts +0 -5
- package/src/components/client/IconButton.tsx +0 -198
- package/src/components/client/Input/Input.tsx +0 -323
- package/src/components/client/Input/InputHelpText.tsx +0 -52
- package/src/components/client/Input/InputHelpTextInternal.tsx +0 -81
- package/src/components/client/Input/index.ts +0 -2
- package/src/components/client/Menu/Menu.Content.tsx +0 -391
- package/src/components/client/Menu/Menu.Divider.tsx +0 -102
- package/src/components/client/Menu/Menu.Item.tsx +0 -114
- package/src/components/client/Menu/Menu.ItemBase.tsx +0 -265
- package/src/components/client/Menu/Menu.ItemCheckbox.tsx +0 -197
- package/src/components/client/Menu/Menu.Provider.tsx +0 -154
- package/src/components/client/Menu/Menu.Trigger.tsx +0 -119
- package/src/components/client/Menu/Menu.index.tsx +0 -9
- package/src/components/client/Menu/Menu.tsx +0 -2
- package/src/components/client/Menu/index.ts +0 -7
- package/src/components/client/Menu/utils/transformAriakitPlacement.ts +0 -66
- package/src/components/client/Pressable.tsx +0 -194
- package/src/components/client/Radio/Radio.tsx +0 -351
- package/src/components/client/Radio/RadioGroupProvider.tsx +0 -122
- package/src/components/client/Radio/RadioGroupStore.tsx +0 -56
- package/src/components/client/Radio/index.ts +0 -2
- package/src/components/client/Radio/useRadioGroup.ts +0 -149
- package/src/components/client/SpringMotionConfig.tsx +0 -151
- package/src/components/client/Switch.tsx +0 -377
- package/src/components/client/index.ts +0 -30
- package/src/components/client/motionFeatures/domAnimation.ts +0 -2
- package/src/components/client/motionFeatures/domMax.ts +0 -2
- package/src/components/experimental/Spinner.tsx +0 -30
- package/src/components/experimental/Table.mocks.tsx +0 -38
- package/src/components/experimental/Table.tsx +0 -239
- package/src/components/experimental/client/Accordion.tsx +0 -77
- package/src/components/experimental/client/AvoidMotionLibraryProvider.tsx +0 -10
- package/src/components/experimental/client/Modal.tsx +0 -68
- package/src/components/experimental/client/Popover.tsx +0 -63
- package/src/components/experimental/client/SwitchV2.tsx +0 -343
- package/src/components/experimental/client/Tabs.tsx +0 -106
- package/src/components/experimental/client/Toast.tsx +0 -186
- package/src/components/experimental/client/index.ts +0 -15
- package/src/components/experimental/index.ts +0 -48
- package/src/components/index.ts +0 -41
- package/src/defaultTokensConfig.ts +0 -31
- package/src/fixtures/index.ts +0 -638
- package/src/fixtures/macros/typesToConstants.ts +0 -42
- package/src/fixtures/utils/getScaleModeRamp.ts +0 -48
- package/src/fixtures/utils/getTailwindAsUdsColors.ts +0 -115
- package/src/flags.ts +0 -45
- package/src/hooks/useForkRef.ts +0 -34
- package/src/hooks/useNestedBorderRadius.ts +0 -138
- package/src/hooks/useRtl.ts +0 -64
- package/src/index.ts +0 -4
- package/src/providers/ColorModeProvider.tsx +0 -21
- package/src/providers/ScaleModeProvider.tsx +0 -29
- package/src/providers/ThemeProvider.tsx +0 -26
- package/src/styles/styler.ts +0 -194
- package/src/styles/stylerTypes.ts +0 -81
- package/src/styles/toast.css +0 -0
- package/src/styles/variants.ts +0 -1351
- package/src/tailwind/base/addColorModeVars.ts +0 -23
- package/src/tailwind/base/addColorModeVarsV2.ts +0 -57
- package/src/tailwind/base/addFontFaceDeclarations.ts +0 -13
- package/src/tailwind/base/addFontVars.ts +0 -9
- package/src/tailwind/base/addMotionVars.ts +0 -9
- package/src/tailwind/base/addScaleModeVars.ts +0 -33
- package/src/tailwind/base/types.ts +0 -8
- package/src/tailwind/components/getButtonStyles.ts +0 -240
- package/src/tailwind/components/getFocusRingStyles.ts +0 -32
- package/src/tailwind/components/getGroupedTextStyles.ts +0 -29
- package/src/tailwind/components/getHitTargetStyles.ts +0 -23
- package/src/tailwind/components/getIconButtonStyles.ts +0 -49
- package/src/tailwind/components/getIconStyles.ts +0 -13
- package/src/tailwind/components/getInputStyles.ts +0 -20
- package/src/tailwind/components/getResponsiveTextStyles.ts +0 -161
- package/src/tailwind/components/types.ts +0 -14
- package/src/tailwind/components/utils.ts +0 -73
- package/src/tailwind/defaultTailwindThemeAsUdsConfig.ts +0 -78
- package/src/tailwind/postcss.config.ts +0 -6
- package/src/tailwind/purger/index.ts +0 -1
- package/src/tailwind/tailwind.config.ts +0 -50
- package/src/tailwind/tailwind.d.ts +0 -5
- package/src/tailwind/tailwindPlugin.ts +0 -724
- package/src/tailwind/theme/getFontFamilyTheme.ts +0 -28
- package/src/tailwind/tsMorph.ts +0 -1
- package/src/tailwind/uds.css +0 -3
- package/src/tailwind/utils/addFontsPlugin.ts +0 -17
- package/src/tailwind/utils/getColorModeStyles.ts +0 -21
- package/src/tailwind/utils/getFontFaceDeclarations.ts +0 -12
- package/src/tailwind/utils/getFontStyles.ts +0 -38
- package/src/tailwind/utils/getMotionStyles.ts +0 -35
- package/src/tailwind/utils/getScaleModeStyles.ts +0 -23
- package/src/tailwind/utils/getShadowPresetValues.ts +0 -133
- package/src/tailwind/utils/getShadowStyles.ts +0 -26
- package/src/tailwind/utils/getShadowVars.ts +0 -40
- package/src/tailwind/utils/index.ts +0 -9
- package/src/tokens/automation/configs/avatar.ts +0 -297
- package/src/tokens/automation/configs/badge.ts +0 -306
- package/src/tokens/automation/configs/checkbox.ts +0 -226
- package/src/tokens/automation/configs/chip.ts +0 -521
- package/src/tokens/automation/configs/divider.ts +0 -112
- package/src/tokens/automation/configs/index.ts +0 -10
- package/src/tokens/automation/configs/input.ts +0 -496
- package/src/tokens/automation/configs/link.ts +0 -183
- package/src/tokens/automation/configs/menu.ts +0 -344
- package/src/tokens/automation/configs/radio.ts +0 -225
- package/src/tokens/automation/configs/switch.ts +0 -323
- package/src/tokens/automation/index.ts +0 -5
- package/src/tokens/automation/mapTextVariantFixtureToValue.ts +0 -8
- package/src/tokens/automation/properties.ts +0 -433
- package/src/tokens/automation/types/ComponentConfig.ts +0 -116
- package/src/tokens/automation/types/ComponentDB.ts +0 -1
- package/src/tokens/automation/types/ComponentStyles.ts +0 -47
- package/src/tokens/automation/types/index.ts +0 -2
- package/src/tokens/automation/utils/cartesianProduct.ts +0 -13
- package/src/tokens/automation/utils/coalesceConfigVariant.ts +0 -49
- package/src/tokens/automation/utils/defaults.ts +0 -29
- package/src/tokens/automation/utils/generateKeyFromFlatConfigPath.ts +0 -15
- package/src/tokens/automation/utils/generateSchemaKey.ts +0 -29
- package/src/tokens/automation/utils/getConfigComponentVariant.ts +0 -28
- package/src/tokens/automation/utils/getConfigVariantComponentStatesMatrix.ts +0 -40
- package/src/tokens/automation/utils/getConfigVariantProperties.ts +0 -32
- package/src/tokens/automation/utils/getConfigVariantPseudoStates.ts +0 -70
- package/src/tokens/automation/utils/getConfigVariants.ts +0 -73
- package/src/tokens/automation/utils/index.ts +0 -939
- package/src/tokens/automation/utils/mapColorFixtureToValue.ts +0 -34
- package/src/tokens/automation/utils/subcomponents.ts +0 -13
- package/src/tokens/automation/utils/variableData.ts +0 -79
- package/src/tokens/automation/utils/variantConfigGuards.ts +0 -17
- package/src/tokens/configs/borderRadius.ts +0 -23
- package/src/tokens/configs/borderWidth.ts +0 -17
- package/src/tokens/configs/button.ts +0 -888
- package/src/tokens/configs/colorMode.ts +0 -14
- package/src/tokens/configs/font.ts +0 -9
- package/src/tokens/configs/iconButton.ts +0 -28
- package/src/tokens/configs/motion.ts +0 -135
- package/src/tokens/configs/palette.ts +0 -124
- package/src/tokens/configs/scaleMode.ts +0 -28
- package/src/tokens/configs/shadow.ts +0 -286
- package/src/tokens/configs/sizes.ts +0 -23
- package/src/tokens/configs/spectrum.ts +0 -729
- package/src/tokens/configs/typography.ts +0 -417
- package/src/tokens/configs/yosConfig.ts +0 -7651
- package/src/tokens/consts/buttonMotionTokens.ts +0 -99
- package/src/tokens/consts/cssTokens.ts +0 -110
- package/src/tokens/consts/defaultModes.ts +0 -15
- package/src/tokens/consts/fontDeclarationsMap.ts +0 -509
- package/src/tokens/index.ts +0 -15
- package/src/tokens/parseButtonVariants.ts +0 -59
- package/src/tokens/parseTokens.ts +0 -122
- package/src/tokens/types.ts +0 -1882
- package/src/tokens/utils/entries.ts +0 -14
- package/src/tokens/utils/fromEntries.ts +0 -11
- package/src/tokens/utils/mapValues.ts +0 -15
- package/src/types.ts +0 -2
- package/src/utils/assertUnreachable.ts +0 -6
- package/src/utils/composeRefs.ts +0 -23
- package/src/utils/createSlot.tsx +0 -131
- package/src/utils/entries.ts +0 -6
- package/src/utils/falsyToString.ts +0 -3
- package/src/utils/getMotionVar.ts +0 -18
- package/src/utils/intersperse.ts +0 -45
- package/src/utils/mapValues.ts +0 -15
- package/src/utils/mergeSlotProps.ts +0 -70
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { BUTTON_CSS_VAR_MAP } from '@yahoo/uds/tokens';
|
|
2
|
-
|
|
3
|
-
import type { ButtonProps } from '../../components/client/Button';
|
|
4
|
-
|
|
5
|
-
/* -------------------------------------------------------------------------- */
|
|
6
|
-
/* Static motion states for the Button component */
|
|
7
|
-
/* -------------------------------------------------------------------------- */
|
|
8
|
-
|
|
9
|
-
const SCALE_DOWN = 0.7;
|
|
10
|
-
const hiddenState = { scale: SCALE_DOWN, opacity: 0 };
|
|
11
|
-
const visibleState = {
|
|
12
|
-
scale: [SCALE_DOWN, SCALE_DOWN, 1],
|
|
13
|
-
opacity: [0, 0, 1],
|
|
14
|
-
transition: { times: [0, 0.5, 1] },
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const iconMotionVariants = { icon: visibleState, hide: hiddenState, loading: hiddenState };
|
|
18
|
-
const loadingMotionVariants = {
|
|
19
|
-
loading: visibleState,
|
|
20
|
-
hide: hiddenState,
|
|
21
|
-
icon: hiddenState,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/* -------------------------------------------------------------------------- */
|
|
25
|
-
/* Static motion variants */
|
|
26
|
-
/* -------------------------------------------------------------------------- */
|
|
27
|
-
|
|
28
|
-
// const from css vars
|
|
29
|
-
const columnGap = `var(${BUTTON_CSS_VAR_MAP.columnGap})`;
|
|
30
|
-
const iconSize = `var(${BUTTON_CSS_VAR_MAP.iconSize})`;
|
|
31
|
-
const scaleRest = `var(${BUTTON_CSS_VAR_MAP.effects.scale.rest})`;
|
|
32
|
-
const scaleHover = `var(${BUTTON_CSS_VAR_MAP.effects.scale.hover})`;
|
|
33
|
-
const scalePressed = `var(${BUTTON_CSS_VAR_MAP.effects.scale.pressed})`;
|
|
34
|
-
|
|
35
|
-
const buttonMotionVariants = {
|
|
36
|
-
rest: { scale: scaleRest },
|
|
37
|
-
hover: { scale: scaleHover },
|
|
38
|
-
pressed: { scale: scalePressed },
|
|
39
|
-
withoutIcon: {
|
|
40
|
-
columnGap: '0px',
|
|
41
|
-
},
|
|
42
|
-
withIcon: { columnGap },
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/* -------------------------------- Variants -------------------------------- */
|
|
46
|
-
const iconContainerMotionVariants = {
|
|
47
|
-
hide: { width: '0px', opacity: 0, display: 'none' },
|
|
48
|
-
loading: {
|
|
49
|
-
width: iconSize,
|
|
50
|
-
display: 'flex',
|
|
51
|
-
opacity: 1,
|
|
52
|
-
},
|
|
53
|
-
icon: {
|
|
54
|
-
width: iconSize,
|
|
55
|
-
display: 'flex',
|
|
56
|
-
opacity: 1,
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/* -------------------------------------------------------------------------- */
|
|
61
|
-
/* Variant getters */
|
|
62
|
-
/* -------------------------------------------------------------------------- */
|
|
63
|
-
|
|
64
|
-
// Helper function to determine startVariant
|
|
65
|
-
type GetStartVariantParams = Pick<ButtonProps, 'loading' | 'startIcon'>;
|
|
66
|
-
const getStartVariant = ({
|
|
67
|
-
loading,
|
|
68
|
-
startIcon,
|
|
69
|
-
}: GetStartVariantParams): 'loading' | 'icon' | 'hide' => {
|
|
70
|
-
if (loading) {
|
|
71
|
-
return 'loading';
|
|
72
|
-
}
|
|
73
|
-
if (startIcon) {
|
|
74
|
-
return 'icon';
|
|
75
|
-
}
|
|
76
|
-
return 'hide';
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// If we're showing icons or loading, we need to return 'withGap', otherwise 'withoutGap'
|
|
80
|
-
type GetGapVariantParams = Pick<ButtonProps, 'startIcon' | 'endIcon' | 'loading'>;
|
|
81
|
-
const getGapVariant = ({
|
|
82
|
-
startIcon,
|
|
83
|
-
endIcon,
|
|
84
|
-
loading,
|
|
85
|
-
}: GetGapVariantParams): 'withIcon' | 'withoutIcon' => {
|
|
86
|
-
if (startIcon || endIcon || loading) {
|
|
87
|
-
return 'withIcon';
|
|
88
|
-
}
|
|
89
|
-
return 'withoutIcon';
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export {
|
|
93
|
-
buttonMotionVariants,
|
|
94
|
-
getGapVariant,
|
|
95
|
-
getStartVariant,
|
|
96
|
-
iconContainerMotionVariants,
|
|
97
|
-
iconMotionVariants,
|
|
98
|
-
loadingMotionVariants,
|
|
99
|
-
};
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import type { BreakpointWithBase } from '../types';
|
|
2
|
-
|
|
3
|
-
export const UDS_PREFIX = 'uds';
|
|
4
|
-
|
|
5
|
-
/* -------------------------------------------------------------------------- */
|
|
6
|
-
/* CSS VAR PREFIXES */
|
|
7
|
-
/* -------------------------------------------------------------------------- */
|
|
8
|
-
export const AVATAR_SIZE_PREFIX = `${UDS_PREFIX}-avatar-size`;
|
|
9
|
-
export const BORDER_RADIUS_PREFIX = `${UDS_PREFIX}-border-radius`;
|
|
10
|
-
export const BORDER_WIDTH_PREFIX = `${UDS_PREFIX}-border-width`;
|
|
11
|
-
export const FONT_FAMILY_PREFIX = `${UDS_PREFIX}-font`;
|
|
12
|
-
export const FONT_SIZE_PREFIX = `${UDS_PREFIX}-font-size`;
|
|
13
|
-
export const FONT_WEIGHT_PREFIX = `${UDS_PREFIX}-font-weight`;
|
|
14
|
-
export const FONT_SLANT_PREFIX = `${UDS_PREFIX}-font-slant`;
|
|
15
|
-
export const FONT_WIDTH_PREFIX = `${UDS_PREFIX}-font-width`;
|
|
16
|
-
export const ICON_SIZE_PREFIX = `${UDS_PREFIX}-icon-size`;
|
|
17
|
-
export const LINE_HEIGHT_PREFIX = `${UDS_PREFIX}-line-height`;
|
|
18
|
-
export const MOTION_PREFIX = `${UDS_PREFIX}-motion`;
|
|
19
|
-
export const SPECTRUM_COLOR_PREFIX = `${UDS_PREFIX}-spectrum-color`;
|
|
20
|
-
export const TEXT_TRANSFORM_PREFIX = `${UDS_PREFIX}-text-transform`;
|
|
21
|
-
|
|
22
|
-
/* -------------------------------------------------------------------------- */
|
|
23
|
-
/* MODE CLASSNAMES */
|
|
24
|
-
/* -------------------------------------------------------------------------- */
|
|
25
|
-
export const DARK_COLOR_MODE_CLASSNAME = `${UDS_PREFIX}-color-mode-dark`;
|
|
26
|
-
export const LIGHT_COLOR_MODE_CLASSNAME = `${UDS_PREFIX}-color-mode-light`;
|
|
27
|
-
export const SYSTEM_COLOR_MODE_CLASSNAME = `${UDS_PREFIX}-color-mode-system`;
|
|
28
|
-
export const INVERT_COLOR_MODE_CLASSNAME = `${UDS_PREFIX}-color-mode-invert`;
|
|
29
|
-
export const XSMALL_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-xsmall`;
|
|
30
|
-
export const SMALL_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-small`;
|
|
31
|
-
export const MEDIUM_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-medium`;
|
|
32
|
-
export const LARGE_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-large`;
|
|
33
|
-
export const XLARGE_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-xlarge`;
|
|
34
|
-
export const XXLARGE_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-xxlarge`;
|
|
35
|
-
export const XXXLARGE_SCALE_MODE_CLASSNAME = `${UDS_PREFIX}-scale-mode-xxxlarge`;
|
|
36
|
-
|
|
37
|
-
/* -------------------------------------------------------------------------- */
|
|
38
|
-
/* DEFAULT MODE CLASSNAMES */
|
|
39
|
-
/* -------------------------------------------------------------------------- */
|
|
40
|
-
export const DEFAULT_COLOR_MODE_CLASSNAME = LIGHT_COLOR_MODE_CLASSNAME;
|
|
41
|
-
export const DEFAULT_SCALE_MODE_CLASSNAME = LARGE_SCALE_MODE_CLASSNAME;
|
|
42
|
-
|
|
43
|
-
/* -------------------------------------------------------------------------- */
|
|
44
|
-
/* RESPONSIVE TEXT CLASSNAMES */
|
|
45
|
-
/* -------------------------------------------------------------------------- */
|
|
46
|
-
|
|
47
|
-
export const TEXT_RESPONSIVE_CLASSNAME = 'uds-text-responsive';
|
|
48
|
-
|
|
49
|
-
export const TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES: Record<
|
|
50
|
-
BreakpointWithBase | 'defaultBreakpoint',
|
|
51
|
-
string
|
|
52
|
-
> = {
|
|
53
|
-
defaultBreakpoint: 'uds-text-default',
|
|
54
|
-
base: 'uds-text-base',
|
|
55
|
-
sm: 'uds-text-sm',
|
|
56
|
-
md: 'uds-text-md',
|
|
57
|
-
lg: 'uds-text-lg',
|
|
58
|
-
xl: 'uds-text-xl',
|
|
59
|
-
'2xl': 'uds-text-2xl',
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/* -------------------------------------------------------------------------- */
|
|
63
|
-
/* BUTTON VARIABLES */
|
|
64
|
-
/* -------------------------------------------------------------------------- */
|
|
65
|
-
|
|
66
|
-
export const BUTTON_CSS_VAR_MAP = {
|
|
67
|
-
borderRadius: `--${UDS_PREFIX}-button-border-radius`,
|
|
68
|
-
borderWidth: `--${UDS_PREFIX}-button-border-width`,
|
|
69
|
-
color: `--${UDS_PREFIX}-button-color`,
|
|
70
|
-
backgroundColor: `--${UDS_PREFIX}-button-background-color`,
|
|
71
|
-
borderColor: `--${UDS_PREFIX}-button-border-color`,
|
|
72
|
-
padding: `--${UDS_PREFIX}-button-padding`,
|
|
73
|
-
columnGap: `--${UDS_PREFIX}-button-gap`,
|
|
74
|
-
fontFamily: `--${UDS_PREFIX}-button-font`,
|
|
75
|
-
fontWeight: `--${UDS_PREFIX}-button-font-weight`,
|
|
76
|
-
fontWidth: `--${UDS_PREFIX}-button-font-width`,
|
|
77
|
-
fontSlant: `--${UDS_PREFIX}-button-font-slant`,
|
|
78
|
-
fontSize: `--${UDS_PREFIX}-button-font-size`,
|
|
79
|
-
lineHeight: `--${UDS_PREFIX}-button-line-height`,
|
|
80
|
-
textTransform: `--${UDS_PREFIX}-button-text-transform`,
|
|
81
|
-
iconSize: `--${UDS_PREFIX}-button-icon-size`,
|
|
82
|
-
dropShadow: `--${UDS_PREFIX}-button-shadow`,
|
|
83
|
-
insetShadow: `--${UDS_PREFIX}-button-inset-shadow`,
|
|
84
|
-
effects: {
|
|
85
|
-
scale: {
|
|
86
|
-
rest: `--${UDS_PREFIX}-button-effects-scale--rest`,
|
|
87
|
-
hover: `--${UDS_PREFIX}-button-effects-scale--hover`,
|
|
88
|
-
pressed: `--${UDS_PREFIX}-button-effects-scale--pressed`,
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
} as const;
|
|
92
|
-
|
|
93
|
-
export const ICON_BUTTON_CSS_VAR_MAP = {
|
|
94
|
-
padding: `--${UDS_PREFIX}-icon-button-padding`,
|
|
95
|
-
iconSize: `--${UDS_PREFIX}-icon-button-icon-size`,
|
|
96
|
-
} as const;
|
|
97
|
-
|
|
98
|
-
export const PSEUDO_STYLE_SELECTOR_MAP = {
|
|
99
|
-
hover: ':hover:not([disabled])',
|
|
100
|
-
pressed: ':active:not([disabled])',
|
|
101
|
-
disabled: ':disabled',
|
|
102
|
-
focused: ':focus-visible',
|
|
103
|
-
// Using this instead of `:focus-within` because `:focus-within`
|
|
104
|
-
// works only on `:focus`, but we want this to work like
|
|
105
|
-
// `:focus-visible`.
|
|
106
|
-
//
|
|
107
|
-
// see: https://larsmagnus.co/blog/focus-visible-within-the-missing-pseudo-class
|
|
108
|
-
focusedWithin: ':has(:focus-visible)',
|
|
109
|
-
notDisabled: ':not(:has(:disabled))',
|
|
110
|
-
} as const;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ColorMode,
|
|
3
|
-
ColorModeForApp,
|
|
4
|
-
HighContrastMode,
|
|
5
|
-
RegionMode,
|
|
6
|
-
ScaleMode,
|
|
7
|
-
ScaleModeForApp,
|
|
8
|
-
} from '../types';
|
|
9
|
-
|
|
10
|
-
export const DEFAULT_COLOR_MODE_FOR_APP: ColorModeForApp = 'system';
|
|
11
|
-
export const DEFAULT_SCALE_MODE_FOR_APP: ScaleModeForApp = 'system';
|
|
12
|
-
export const DEFAULT_COLOR_MODE: ColorMode = 'light';
|
|
13
|
-
export const DEFAULT_SCALE_MODE: ScaleMode = 'large';
|
|
14
|
-
export const DEFAULT_HIGH_CONTRAST_MODE: HighContrastMode = false;
|
|
15
|
-
export const DEFAULT_REGION_MODE: RegionMode = 'πΊπΈ US';
|