@workday/canvas-kit-react 15.0.0-alpha.0177-next.0 → 15.0.0-alpha.0179-next.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/action-bar/lib/ActionBarList.tsx +11 -9
- package/button/lib/BaseButton.tsx +108 -65
- package/button/lib/DeleteButton.tsx +67 -20
- package/button/lib/PrimaryButton.tsx +107 -27
- package/button/lib/SecondaryButton.tsx +107 -30
- package/button/lib/TertiaryButton.tsx +153 -55
- package/button/lib/ToolbarDropdownButton.tsx +65 -18
- package/button/lib/ToolbarIconButton.tsx +88 -24
- package/checkbox/lib/CheckboxInput.tsx +10 -21
- package/collection/lib/ListBox.tsx +5 -3
- package/color-picker/lib/ColorPreview.tsx +3 -2
- package/combobox/lib/ComboboxCard.tsx +12 -1
- package/combobox/lib/ComboboxMenuList.tsx +2 -1
- package/dist/commonjs/action-bar/lib/ActionBarList.d.ts.map +1 -1
- package/dist/commonjs/action-bar/lib/ActionBarList.js +2 -2
- package/dist/commonjs/avatar/lib/Avatar.d.ts +5 -5
- package/dist/commonjs/avatar/lib/BaseAvatar.d.ts +5 -5
- package/dist/commonjs/banner/lib/Banner.js +2 -2
- package/dist/commonjs/button/lib/BaseButton.d.ts +26 -34
- package/dist/commonjs/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/BaseButton.js +27 -27
- package/dist/commonjs/button/lib/DeleteButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/DeleteButton.js +2 -2
- package/dist/commonjs/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/PrimaryButton.js +3 -3
- package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/SecondaryButton.js +3 -3
- package/dist/commonjs/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/TertiaryButton.js +18 -18
- package/dist/commonjs/button/lib/ToolbarDropdownButton.d.ts +26 -34
- package/dist/commonjs/button/lib/ToolbarDropdownButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/ToolbarDropdownButton.js +4 -4
- package/dist/commonjs/button/lib/ToolbarIconButton.d.ts +52 -68
- package/dist/commonjs/button/lib/ToolbarIconButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/ToolbarIconButton.js +2 -2
- package/dist/commonjs/card/lib/CardBody.d.ts +86 -86
- package/dist/commonjs/card/lib/CardHeading.d.ts +86 -86
- package/dist/commonjs/checkbox/lib/CheckboxInput.d.ts.map +1 -1
- package/dist/commonjs/checkbox/lib/CheckboxInput.js +4 -4
- package/dist/commonjs/collection/lib/ListBox.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/ListBox.js +8 -6
- package/dist/commonjs/color-picker/lib/ColorPreview.d.ts.map +1 -1
- package/dist/commonjs/color-picker/lib/ColorPreview.js +2 -2
- package/dist/commonjs/combobox/lib/ComboboxCard.d.ts +1 -0
- package/dist/commonjs/combobox/lib/ComboboxCard.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/ComboboxCard.js +7 -2
- package/dist/commonjs/combobox/lib/ComboboxMenuList.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/ComboboxMenuList.js +3 -1
- package/dist/commonjs/expandable/lib/ExpandableAvatar.d.ts +10 -10
- package/dist/commonjs/form-field/lib/FormFieldGroupLabel.d.ts +43 -43
- package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +43 -43
- package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +43 -43
- package/dist/commonjs/menu/lib/MenuCard.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuCard.js +2 -2
- package/dist/commonjs/menu/lib/MenuDivider.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuDivider.js +2 -2
- package/dist/commonjs/menu/lib/MenuGroup.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuGroup.js +2 -2
- package/dist/commonjs/menu/lib/MenuItem.d.ts +0 -20
- package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuItem.js +2 -2
- package/dist/commonjs/menu/lib/MenuList.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuList.js +4 -4
- package/dist/commonjs/modal/lib/ModalBody.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalBody.js +2 -2
- package/dist/commonjs/modal/lib/ModalCard.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalCard.js +2 -2
- package/dist/commonjs/modal/lib/ModalHeading.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalHeading.js +2 -2
- package/dist/commonjs/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalOverlay.js +3 -3
- package/dist/commonjs/pagination/lib/Pagination/PageButton.d.ts +26 -34
- package/dist/commonjs/pagination/lib/Pagination/PageButton.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/PageButton.js +2 -2
- package/dist/commonjs/pill/lib/Pill.d.ts +26 -34
- package/dist/commonjs/pill/lib/Pill.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/Pill.js +3 -3
- package/dist/commonjs/pill/lib/PillAvatar.d.ts +10 -10
- package/dist/commonjs/pill/lib/PillIconButton.d.ts +52 -68
- package/dist/commonjs/pill/lib/PillIconButton.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/PillIconButton.js +1 -1
- package/dist/commonjs/popup/lib/PopupBody.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupBody.js +2 -2
- package/dist/commonjs/popup/lib/PopupCard.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupCard.js +9 -7
- package/dist/commonjs/popup/lib/PopupCloseIcon.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupCloseIcon.js +2 -2
- package/dist/commonjs/popup/lib/PopupHeading.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/PopupHeading.js +2 -2
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts +37 -42
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.js +17 -17
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts +0 -5
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.js +4 -8
- package/dist/commonjs/select/lib/SelectCard.js +1 -1
- package/dist/commonjs/skeleton/lib/parts/SkeletonShape.js +1 -1
- package/dist/commonjs/switch/lib/Switch.d.ts.map +1 -1
- package/dist/commonjs/switch/lib/Switch.js +7 -7
- package/dist/commonjs/tabs/lib/Tabs.d.ts +36 -4
- package/dist/commonjs/tabs/lib/Tabs.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsItem.js +2 -2
- package/dist/commonjs/tabs/lib/TabsList.d.ts +1 -1
- package/dist/commonjs/tabs/lib/TabsList.js +7 -7
- package/dist/commonjs/text/lib/Text.d.ts +43 -43
- package/dist/commonjs/text/lib/Text.d.ts.map +1 -1
- package/dist/commonjs/text/lib/Text.js +20 -17
- package/dist/commonjs/text-input/lib/TextInput.js +6 -6
- package/dist/commonjs/toast/lib/Toast.d.ts.map +1 -1
- package/dist/commonjs/toast/lib/Toast.js +2 -2
- package/dist/commonjs/toast/lib/ToastBody.d.ts.map +1 -1
- package/dist/commonjs/toast/lib/ToastBody.js +2 -2
- package/dist/commonjs/toast/lib/ToastIcon.d.ts.map +1 -1
- package/dist/commonjs/toast/lib/ToastIcon.js +2 -2
- package/dist/commonjs/toast/lib/ToastMessage.d.ts.map +1 -1
- package/dist/commonjs/toast/lib/ToastMessage.js +2 -3
- package/dist/commonjs/tooltip/lib/TooltipContainer.d.ts +1 -1
- package/dist/commonjs/tooltip/lib/TooltipContainer.d.ts.map +1 -1
- package/dist/commonjs/tooltip/lib/TooltipContainer.js +5 -5
- package/dist/es6/action-bar/lib/ActionBarList.d.ts.map +1 -1
- package/dist/es6/action-bar/lib/ActionBarList.js +4 -4
- package/dist/es6/avatar/lib/Avatar.d.ts +5 -5
- package/dist/es6/avatar/lib/BaseAvatar.d.ts +5 -5
- package/dist/es6/banner/lib/Banner.js +2 -2
- package/dist/es6/button/lib/BaseButton.d.ts +26 -34
- package/dist/es6/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/es6/button/lib/BaseButton.js +30 -30
- package/dist/es6/button/lib/DeleteButton.d.ts.map +1 -1
- package/dist/es6/button/lib/DeleteButton.js +4 -4
- package/dist/es6/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/PrimaryButton.js +5 -5
- package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/SecondaryButton.js +4 -4
- package/dist/es6/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/TertiaryButton.js +20 -20
- package/dist/es6/button/lib/ToolbarDropdownButton.d.ts +26 -34
- package/dist/es6/button/lib/ToolbarDropdownButton.d.ts.map +1 -1
- package/dist/es6/button/lib/ToolbarDropdownButton.js +6 -6
- package/dist/es6/button/lib/ToolbarIconButton.d.ts +52 -68
- package/dist/es6/button/lib/ToolbarIconButton.d.ts.map +1 -1
- package/dist/es6/button/lib/ToolbarIconButton.js +3 -3
- package/dist/es6/card/lib/CardBody.d.ts +86 -86
- package/dist/es6/card/lib/CardHeading.d.ts +86 -86
- package/dist/es6/checkbox/lib/CheckboxInput.d.ts.map +1 -1
- package/dist/es6/checkbox/lib/CheckboxInput.js +4 -4
- package/dist/es6/collection/lib/ListBox.d.ts.map +1 -1
- package/dist/es6/collection/lib/ListBox.js +8 -6
- package/dist/es6/color-picker/lib/ColorPreview.d.ts.map +1 -1
- package/dist/es6/color-picker/lib/ColorPreview.js +3 -3
- package/dist/es6/combobox/lib/ComboboxCard.d.ts +1 -0
- package/dist/es6/combobox/lib/ComboboxCard.d.ts.map +1 -1
- package/dist/es6/combobox/lib/ComboboxCard.js +6 -1
- package/dist/es6/combobox/lib/ComboboxMenuList.d.ts.map +1 -1
- package/dist/es6/combobox/lib/ComboboxMenuList.js +3 -1
- package/dist/es6/expandable/lib/ExpandableAvatar.d.ts +10 -10
- package/dist/es6/form-field/lib/FormFieldGroupLabel.d.ts +43 -43
- package/dist/es6/form-field/lib/FormFieldHint.d.ts +43 -43
- package/dist/es6/form-field/lib/FormFieldLabel.d.ts +43 -43
- package/dist/es6/menu/lib/MenuCard.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuCard.js +3 -3
- package/dist/es6/menu/lib/MenuDivider.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuDivider.js +3 -3
- package/dist/es6/menu/lib/MenuGroup.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuGroup.js +4 -4
- package/dist/es6/menu/lib/MenuItem.d.ts +0 -20
- package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuItem.js +4 -4
- package/dist/es6/menu/lib/MenuList.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuList.js +4 -4
- package/dist/es6/modal/lib/ModalBody.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalBody.js +3 -3
- package/dist/es6/modal/lib/ModalCard.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalCard.js +4 -4
- package/dist/es6/modal/lib/ModalHeading.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalHeading.js +3 -3
- package/dist/es6/modal/lib/ModalOverlay.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalOverlay.js +3 -3
- package/dist/es6/pagination/lib/Pagination/PageButton.d.ts +26 -34
- package/dist/es6/pagination/lib/Pagination/PageButton.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/PageButton.js +2 -2
- package/dist/es6/pill/lib/Pill.d.ts +26 -34
- package/dist/es6/pill/lib/Pill.d.ts.map +1 -1
- package/dist/es6/pill/lib/Pill.js +3 -3
- package/dist/es6/pill/lib/PillAvatar.d.ts +10 -10
- package/dist/es6/pill/lib/PillIconButton.d.ts +52 -68
- package/dist/es6/pill/lib/PillIconButton.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillIconButton.js +1 -1
- package/dist/es6/popup/lib/PopupBody.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupBody.js +3 -3
- package/dist/es6/popup/lib/PopupCard.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupCard.js +11 -9
- package/dist/es6/popup/lib/PopupCloseIcon.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupCloseIcon.js +3 -3
- package/dist/es6/popup/lib/PopupHeading.d.ts.map +1 -1
- package/dist/es6/popup/lib/PopupHeading.js +3 -3
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts +37 -42
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlItem.js +19 -19
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts +0 -5
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlList.js +6 -10
- package/dist/es6/select/lib/SelectCard.js +1 -1
- package/dist/es6/skeleton/lib/parts/SkeletonShape.js +1 -1
- package/dist/es6/switch/lib/Switch.d.ts.map +1 -1
- package/dist/es6/switch/lib/Switch.js +7 -7
- package/dist/es6/tabs/lib/Tabs.d.ts +36 -4
- package/dist/es6/tabs/lib/Tabs.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsItem.js +3 -3
- package/dist/es6/tabs/lib/TabsList.d.ts +1 -1
- package/dist/es6/tabs/lib/TabsList.js +7 -7
- package/dist/es6/text/lib/Text.d.ts +43 -43
- package/dist/es6/text/lib/Text.d.ts.map +1 -1
- package/dist/es6/text/lib/Text.js +22 -19
- package/dist/es6/text-input/lib/TextInput.js +7 -7
- package/dist/es6/toast/lib/Toast.d.ts.map +1 -1
- package/dist/es6/toast/lib/Toast.js +3 -3
- package/dist/es6/toast/lib/ToastBody.d.ts.map +1 -1
- package/dist/es6/toast/lib/ToastBody.js +3 -3
- package/dist/es6/toast/lib/ToastIcon.d.ts.map +1 -1
- package/dist/es6/toast/lib/ToastIcon.js +4 -4
- package/dist/es6/toast/lib/ToastMessage.d.ts.map +1 -1
- package/dist/es6/toast/lib/ToastMessage.js +2 -3
- package/dist/es6/tooltip/lib/TooltipContainer.d.ts +1 -1
- package/dist/es6/tooltip/lib/TooltipContainer.d.ts.map +1 -1
- package/dist/es6/tooltip/lib/TooltipContainer.js +6 -6
- package/menu/lib/MenuCard.tsx +7 -3
- package/menu/lib/MenuDivider.tsx +6 -4
- package/menu/lib/MenuGroup.tsx +14 -7
- package/menu/lib/MenuItem.tsx +36 -16
- package/menu/lib/MenuList.tsx +8 -5
- package/modal/lib/ModalBody.tsx +3 -2
- package/modal/lib/ModalCard.tsx +14 -10
- package/modal/lib/ModalHeading.tsx +3 -2
- package/modal/lib/ModalOverlay.tsx +7 -6
- package/package.json +5 -5
- package/popup/lib/PopupBody.tsx +3 -2
- package/popup/lib/PopupCard.tsx +25 -11
- package/popup/lib/PopupCloseIcon.tsx +5 -3
- package/popup/lib/PopupHeading.tsx +3 -2
- package/segmented-control/lib/SegmentedControlItem.tsx +96 -33
- package/segmented-control/lib/SegmentedControlList.tsx +13 -13
- package/skeleton/lib/parts/SkeletonShape.tsx +1 -1
- package/switch/lib/Switch.tsx +3 -4
- package/tabs/lib/TabsItem.tsx +7 -5
- package/tabs/lib/TabsList.tsx +1 -1
- package/text/lib/Text.tsx +113 -29
- package/text-input/lib/TextInput.tsx +6 -6
- package/toast/lib/Toast.tsx +8 -4
- package/toast/lib/ToastBody.tsx +5 -4
- package/toast/lib/ToastIcon.tsx +4 -3
- package/toast/lib/ToastMessage.tsx +1 -3
- package/tooltip/lib/TooltipContainer.tsx +28 -13
|
@@ -3,8 +3,8 @@ import * as React from 'react';
|
|
|
3
3
|
import {useListRenderItems, useOverflowListMeasure} from '@workday/canvas-kit-react/collection';
|
|
4
4
|
import {ExtractProps, createSubcomponent} from '@workday/canvas-kit-react/common';
|
|
5
5
|
import {Flex, mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
6
|
-
import {createStencil, cssVar} from '@workday/canvas-kit-styling';
|
|
7
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
6
|
+
import {createStencil, cssVar, px2rem} from '@workday/canvas-kit-styling';
|
|
7
|
+
import {base, system} from '@workday/canvas-tokens-web';
|
|
8
8
|
|
|
9
9
|
import {useActionBarModel} from './useActionBarModel';
|
|
10
10
|
|
|
@@ -34,19 +34,21 @@ export interface ActionBarListProps<T = any>
|
|
|
34
34
|
export const actionBarListStencil = createStencil({
|
|
35
35
|
base: {
|
|
36
36
|
display: 'flex',
|
|
37
|
-
boxShadow: system.depth[
|
|
37
|
+
boxShadow: system.depth[2],
|
|
38
38
|
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
39
39
|
gap: cssVar(system.gap.md, system.space.x4),
|
|
40
|
-
background: system.color.bg.default,
|
|
41
40
|
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
background: cssVar(system.color.surface.default, system.color.bg.default),
|
|
42
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
43
|
+
borderBlockStart: `solid ${px2rem(1)} ${cssVar(system.color.border.default, system.color.border.divider)}`,
|
|
44
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
45
|
+
padding: `${cssVar(system.padding.md, system.space.x4)} ${cssVar(base.size500, system.space.x10)} `,
|
|
44
46
|
position: 'fixed',
|
|
45
47
|
insetBlockEnd: 0,
|
|
46
|
-
|
|
47
|
-
insetInlineEnd: 0,
|
|
48
|
+
insetInline: 0,
|
|
48
49
|
'@media (max-width: 767.5px)': {
|
|
49
|
-
|
|
50
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
51
|
+
padding: cssVar(system.size.xxxs, system.space.x4),
|
|
50
52
|
'> *': {
|
|
51
53
|
flex: 1,
|
|
52
54
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import {GrowthBehavior, createComponent
|
|
3
|
+
import {GrowthBehavior, createComponent} from '@workday/canvas-kit-react/common';
|
|
4
4
|
import {SystemIconProps, systemIconStencil} from '@workday/canvas-kit-react/icon';
|
|
5
5
|
import {mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
6
|
-
import {
|
|
7
|
-
import {brand, system} from '@workday/canvas-tokens-web';
|
|
6
|
+
import {createStencil, createVars, cssVar, px2rem} from '@workday/canvas-kit-styling';
|
|
7
|
+
import {base, brand, system} from '@workday/canvas-tokens-web';
|
|
8
8
|
import {CanvasSystemIcon} from '@workday/design-assets-types';
|
|
9
9
|
|
|
10
10
|
import {ButtonLabel} from '../lib/parts/ButtonLabel';
|
|
@@ -122,9 +122,12 @@ export const buttonStencil = createStencil({
|
|
|
122
122
|
base: ({background, border, boxShadowInner, boxShadowOuter, label, opacity, borderRadius}) => ({
|
|
123
123
|
// Default Styles
|
|
124
124
|
fontFamily: system.fontFamily.default,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
126
|
+
fontSize: cssVar(system.fontSize.subtext.lg, system.fontSize.subtext.large),
|
|
127
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
128
|
+
lineHeight: cssVar(system.lineHeight.subtext.lg, system.lineHeight.subtext.large),
|
|
129
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
130
|
+
letterSpacing: cssVar(system.letterSpacing.subtext.lg, base.letterSpacing150),
|
|
128
131
|
fontWeight: system.fontWeight.bold,
|
|
129
132
|
backgroundColor: cssVar(
|
|
130
133
|
buttonColorPropVars.default.background,
|
|
@@ -141,7 +144,6 @@ export const buttonStencil = createStencil({
|
|
|
141
144
|
boxShadow: 'none',
|
|
142
145
|
alignItems: 'center',
|
|
143
146
|
justifyContent: 'center',
|
|
144
|
-
boxSizing: 'border-box',
|
|
145
147
|
outline: `${px2rem(2)} transparent`,
|
|
146
148
|
whiteSpace: 'nowrap',
|
|
147
149
|
WebkitFontSmoothing: 'antialiased',
|
|
@@ -178,18 +180,13 @@ export const buttonStencil = createStencil({
|
|
|
178
180
|
),
|
|
179
181
|
outline: `${px2rem(2)} solid transparent`,
|
|
180
182
|
outlineOffset: px2rem(2),
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
outerColor: cssVar(
|
|
189
|
-
buttonColorPropVars.focus.boxShadowOuter,
|
|
190
|
-
cssVar(boxShadowOuter, brand.common.focusOutline)
|
|
191
|
-
),
|
|
192
|
-
}),
|
|
183
|
+
boxShadow: `0 0 0 ${px2rem(2)} ${cssVar(
|
|
184
|
+
buttonColorPropVars.focus.boxShadowInner,
|
|
185
|
+
cssVar(boxShadowInner, cssVar(system.color.border.inverse.default, base.neutral0))
|
|
186
|
+
)},0 0 0 ${px2rem(4)} ${cssVar(
|
|
187
|
+
buttonColorPropVars.focus.boxShadowOuter,
|
|
188
|
+
cssVar(boxShadowOuter, cssVar(system.color.brand.focus.primary, brand.common.focusOutline))
|
|
189
|
+
)}`,
|
|
193
190
|
},
|
|
194
191
|
// Hover Styles
|
|
195
192
|
'&:hover, &.hover': {
|
|
@@ -226,10 +223,7 @@ export const buttonStencil = createStencil({
|
|
|
226
223
|
),
|
|
227
224
|
borderColor: cssVar(buttonColorPropVars.disabled.border, cssVar(border, 'transparent')),
|
|
228
225
|
color: cssVar(buttonColorPropVars.disabled.label, cssVar(label, system.color.fg.strong)),
|
|
229
|
-
[systemIconStencil.vars.color]: cssVar(
|
|
230
|
-
buttonColorPropVars.disabled.icon,
|
|
231
|
-
system.color.fg.strong
|
|
232
|
-
),
|
|
226
|
+
[systemIconStencil.vars.color]: cssVar(buttonColorPropVars.disabled.icon, 'currentColor'),
|
|
233
227
|
},
|
|
234
228
|
// for Windows high contrast desktop themes
|
|
235
229
|
'@media (prefers-contrast: more)': {
|
|
@@ -259,34 +253,63 @@ export const buttonStencil = createStencil({
|
|
|
259
253
|
*/
|
|
260
254
|
size: {
|
|
261
255
|
large: {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
256
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
257
|
+
fontSize: cssVar(system.fontSize.body.sm, system.fontSize.body.small),
|
|
258
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
259
|
+
lineHeight: cssVar(system.lineHeight.body.sm, system.lineHeight.body.small),
|
|
260
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
261
|
+
letterSpacing: cssVar(system.letterSpacing.body.sm, base.letterSpacing200),
|
|
262
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
263
|
+
height: cssVar(system.size.lg, px2rem(48)),
|
|
264
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
265
|
+
paddingInline: cssVar(system.padding.xxl, system.space.x8),
|
|
266
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
267
|
+
minWidth: cssVar(base.size1400, px2rem(112)),
|
|
267
268
|
},
|
|
268
269
|
medium: {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
270
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
271
|
+
fontSize: cssVar(system.fontSize.subtext.lg, system.fontSize.subtext.large),
|
|
272
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
273
|
+
lineHeight: cssVar(system.lineHeight.subtext.lg, system.lineHeight.subtext.large),
|
|
274
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
275
|
+
letterSpacing: cssVar(system.letterSpacing.subtext.lg, base.letterSpacing150),
|
|
276
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
277
|
+
minWidth: cssVar(base.size1200, px2rem(96)),
|
|
278
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
279
|
+
paddingInline: cssVar(system.padding.xl, system.space.x6),
|
|
280
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
281
|
+
height: cssVar(system.size.md, system.space.x10),
|
|
274
282
|
},
|
|
275
283
|
small: {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
284
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
285
|
+
fontSize: cssVar(system.fontSize.subtext.lg, system.fontSize.subtext.large),
|
|
286
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
287
|
+
lineHeight: cssVar(system.lineHeight.subtext.lg, system.lineHeight.subtext.large),
|
|
288
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
289
|
+
letterSpacing: cssVar(system.letterSpacing.subtext.lg, base.letterSpacing150),
|
|
290
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
291
|
+
height: cssVar(system.size.sm, system.space.x8),
|
|
292
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
293
|
+
minWidth: cssVar(base.size1000, system.space.x20),
|
|
294
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
295
|
+
paddingInline: cssVar(system.padding.md, system.space.x4),
|
|
296
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
297
|
+
gap: cssVar(system.gap.xs, system.space.x1),
|
|
282
298
|
},
|
|
283
299
|
extraSmall: {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
300
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
301
|
+
fontSize: cssVar(system.fontSize.subtext.md, system.fontSize.subtext.medium),
|
|
302
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
303
|
+
lineHeight: cssVar(system.lineHeight.subtext.md, system.lineHeight.subtext.medium),
|
|
304
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
305
|
+
letterSpacing: cssVar(system.letterSpacing.subtext.md, base.letterSpacing100),
|
|
306
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
307
|
+
height: cssVar(system.size.xs, system.space.x6),
|
|
287
308
|
minWidth: 'auto',
|
|
288
|
-
|
|
289
|
-
|
|
309
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
310
|
+
paddingInline: cssVar(system.padding.sm, system.space.x3),
|
|
311
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
312
|
+
gap: cssVar(system.gap.xs, system.space.x1),
|
|
290
313
|
},
|
|
291
314
|
},
|
|
292
315
|
grow: {
|
|
@@ -297,7 +320,7 @@ export const buttonStencil = createStencil({
|
|
|
297
320
|
},
|
|
298
321
|
// IconPosition Styles
|
|
299
322
|
iconPosition: {
|
|
300
|
-
only: {padding:
|
|
323
|
+
only: {padding: 0},
|
|
301
324
|
start: {},
|
|
302
325
|
end: {},
|
|
303
326
|
},
|
|
@@ -307,81 +330,101 @@ export const buttonStencil = createStencil({
|
|
|
307
330
|
{
|
|
308
331
|
modifiers: {size: 'large', iconPosition: 'only'},
|
|
309
332
|
styles: {
|
|
310
|
-
|
|
333
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
334
|
+
minWidth: cssVar(system.size.lg, px2rem(48)),
|
|
311
335
|
},
|
|
312
336
|
},
|
|
313
337
|
{
|
|
314
338
|
modifiers: {size: 'large', iconPosition: 'start'},
|
|
315
339
|
styles: {
|
|
316
|
-
|
|
317
|
-
|
|
340
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
341
|
+
paddingInlineStart: cssVar(system.padding.xl, system.space.x6),
|
|
342
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
343
|
+
paddingInlineEnd: cssVar(system.padding.xxl, system.space.x8),
|
|
318
344
|
},
|
|
319
345
|
},
|
|
320
346
|
{
|
|
321
347
|
modifiers: {size: 'large', iconPosition: 'end'},
|
|
322
348
|
styles: {
|
|
323
|
-
|
|
324
|
-
|
|
349
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
350
|
+
paddingInlineStart: cssVar(system.padding.xxl, system.space.x8),
|
|
351
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
352
|
+
paddingInlineEnd: cssVar(system.padding.xl, system.space.x6),
|
|
325
353
|
},
|
|
326
354
|
},
|
|
327
355
|
{
|
|
328
356
|
modifiers: {size: 'medium', iconPosition: 'only'},
|
|
329
357
|
styles: {
|
|
330
|
-
|
|
358
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
359
|
+
minWidth: cssVar(system.size.md, system.space.x10),
|
|
331
360
|
},
|
|
332
361
|
},
|
|
333
362
|
{
|
|
334
363
|
modifiers: {size: 'medium', iconPosition: 'start'},
|
|
335
364
|
styles: {
|
|
336
|
-
|
|
337
|
-
|
|
365
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
366
|
+
paddingInlineStart: cssVar(system.padding.lg, px2rem(20)),
|
|
367
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
368
|
+
paddingInlineEnd: cssVar(system.padding.xl, system.space.x6),
|
|
338
369
|
},
|
|
339
370
|
},
|
|
340
371
|
{
|
|
341
372
|
modifiers: {size: 'medium', iconPosition: 'end'},
|
|
342
373
|
styles: {
|
|
343
|
-
|
|
344
|
-
|
|
374
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
375
|
+
paddingInlineStart: cssVar(system.padding.xl, system.space.x6),
|
|
376
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
377
|
+
paddingInlineEnd: cssVar(system.padding.lg, px2rem(20)),
|
|
345
378
|
},
|
|
346
379
|
},
|
|
347
380
|
{
|
|
348
381
|
modifiers: {size: 'small', iconPosition: 'only'},
|
|
349
382
|
styles: {
|
|
350
|
-
|
|
383
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
384
|
+
minWidth: cssVar(system.size.sm, system.space.x8),
|
|
351
385
|
},
|
|
352
386
|
},
|
|
353
387
|
{
|
|
354
388
|
modifiers: {size: 'small', iconPosition: 'start'},
|
|
355
389
|
styles: {
|
|
356
|
-
|
|
357
|
-
|
|
390
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
391
|
+
paddingInlineStart: cssVar(system.padding.sm, system.space.x3),
|
|
392
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
393
|
+
paddingInlineEnd: cssVar(system.padding.md, system.space.x4),
|
|
358
394
|
},
|
|
359
395
|
},
|
|
360
396
|
{
|
|
361
397
|
modifiers: {size: 'small', iconPosition: 'end'},
|
|
362
398
|
styles: {
|
|
363
|
-
|
|
364
|
-
|
|
399
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
400
|
+
paddingInlineStart: cssVar(system.padding.md, system.space.x4),
|
|
401
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
402
|
+
paddingInlineEnd: cssVar(system.padding.sm, system.space.x3),
|
|
365
403
|
},
|
|
366
404
|
},
|
|
367
405
|
{
|
|
368
406
|
modifiers: {size: 'extraSmall', iconPosition: 'only'},
|
|
369
407
|
styles: {
|
|
370
|
-
|
|
408
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
409
|
+
minWidth: cssVar(system.size.xs, system.space.x6),
|
|
371
410
|
},
|
|
372
411
|
},
|
|
373
412
|
{
|
|
374
413
|
modifiers: {size: 'extraSmall', iconPosition: 'start'},
|
|
375
414
|
styles: {
|
|
376
|
-
|
|
377
|
-
|
|
415
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
416
|
+
paddingInlineStart: cssVar(system.padding.xs, system.space.x2),
|
|
417
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
418
|
+
paddingInlineEnd: cssVar(system.padding.sm, system.space.x3),
|
|
378
419
|
},
|
|
379
420
|
},
|
|
380
421
|
{
|
|
381
422
|
modifiers: {size: 'extraSmall', iconPosition: 'end'},
|
|
382
423
|
styles: {
|
|
383
|
-
|
|
384
|
-
|
|
424
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
425
|
+
paddingInlineStart: cssVar(system.padding.sm, system.space.x3),
|
|
426
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
427
|
+
paddingInlineEnd: cssVar(system.padding.xs, system.space.x2),
|
|
385
428
|
},
|
|
386
429
|
},
|
|
387
430
|
],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
2
2
|
import {systemIconStencil} from '@workday/canvas-kit-react/icon';
|
|
3
|
-
import {createStencil, cssVar} from '@workday/canvas-kit-styling';
|
|
4
|
-
import {brand, system} from '@workday/canvas-tokens-web';
|
|
3
|
+
import {colorSpace, createStencil, cssVar} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {base, brand, system} from '@workday/canvas-tokens-web';
|
|
5
5
|
|
|
6
6
|
import {buttonColorPropVars, buttonStencil} from './BaseButton';
|
|
7
7
|
import {Button, ButtonProps} from './Button';
|
|
@@ -17,36 +17,83 @@ const deleteButtonStencil = createStencil({
|
|
|
17
17
|
extends: buttonStencil,
|
|
18
18
|
base: {
|
|
19
19
|
// Base Styles
|
|
20
|
-
|
|
21
|
-
[buttonStencil.vars.
|
|
22
|
-
|
|
23
|
-
[
|
|
20
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
21
|
+
[buttonStencil.vars.background]: cssVar(system.color.brand.accent.critical, brand.error.base),
|
|
22
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
23
|
+
[buttonStencil.vars.borderRadius]: cssVar(system.shape.full, system.shape.round),
|
|
24
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
25
|
+
[buttonStencil.vars.label]: cssVar(system.color.fg.inverse, brand.error.accent),
|
|
26
|
+
[systemIconStencil.vars.color]: cssVar(
|
|
27
|
+
buttonColorPropVars.default.icon,
|
|
28
|
+
cssVar(system.color.fg.inverse, brand.error.accent)
|
|
29
|
+
),
|
|
24
30
|
// Focus Styles
|
|
25
31
|
'&:focus-visible, &.focus': {
|
|
26
|
-
|
|
27
|
-
[buttonStencil.vars.
|
|
28
|
-
|
|
29
|
-
[buttonStencil.vars.
|
|
30
|
-
|
|
32
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
33
|
+
[buttonStencil.vars.background]: cssVar(system.color.brand.accent.critical, brand.error.base),
|
|
34
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
35
|
+
[buttonStencil.vars.label]: cssVar(system.color.fg.inverse, brand.error.accent),
|
|
36
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
37
|
+
[systemIconStencil.vars.color]: cssVar(
|
|
38
|
+
buttonColorPropVars.focus.icon,
|
|
39
|
+
cssVar(system.color.fg.inverse, brand.error.accent)
|
|
40
|
+
),
|
|
41
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
42
|
+
[buttonStencil.vars.boxShadowInner]: cssVar(
|
|
43
|
+
system.color.focus.inverse,
|
|
44
|
+
cssVar(system.color.border.inverse.default, base.neutral0)
|
|
45
|
+
),
|
|
46
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
47
|
+
[buttonStencil.vars.boxShadowOuter]: cssVar(
|
|
48
|
+
system.color.brand.focus.primary,
|
|
49
|
+
brand.common.focusOutline
|
|
50
|
+
),
|
|
31
51
|
},
|
|
32
52
|
// Hover Styles
|
|
33
53
|
'&:hover, &.hover': {
|
|
34
|
-
|
|
35
|
-
[buttonStencil.vars.
|
|
36
|
-
|
|
54
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
55
|
+
[buttonStencil.vars.background]: colorSpace.darken(
|
|
56
|
+
system.color.brand.accent.critical,
|
|
57
|
+
brand.error.dark,
|
|
58
|
+
system.color.accent.overlay.mixin,
|
|
59
|
+
system.opacity.accent.hover
|
|
60
|
+
),
|
|
61
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
62
|
+
[buttonStencil.vars.label]: cssVar(system.color.fg.inverse, brand.error.accent),
|
|
63
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
64
|
+
[systemIconStencil.vars.color]: cssVar(
|
|
65
|
+
buttonColorPropVars.hover.icon,
|
|
66
|
+
cssVar(system.color.fg.inverse, brand.error.accent)
|
|
67
|
+
),
|
|
37
68
|
},
|
|
38
69
|
// Active Styles
|
|
39
70
|
'&:active, &.active': {
|
|
40
|
-
|
|
41
|
-
[buttonStencil.vars.
|
|
42
|
-
|
|
71
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
72
|
+
[buttonStencil.vars.background]: colorSpace.darken(
|
|
73
|
+
system.color.brand.accent.critical,
|
|
74
|
+
brand.error.darkest,
|
|
75
|
+
system.color.accent.overlay.mixin,
|
|
76
|
+
system.opacity.accent.pressed
|
|
77
|
+
),
|
|
78
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
79
|
+
[buttonStencil.vars.label]: cssVar(system.color.fg.inverse, brand.error.accent),
|
|
80
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
81
|
+
[systemIconStencil.vars.color]: cssVar(
|
|
82
|
+
buttonColorPropVars.active.icon,
|
|
83
|
+
cssVar(system.color.fg.inverse, brand.error.accent)
|
|
84
|
+
),
|
|
43
85
|
},
|
|
44
86
|
// Disabled Styles
|
|
45
87
|
'&:disabled, &.disabled': {
|
|
46
|
-
[buttonStencil.vars.background]: brand.error.base,
|
|
47
|
-
[buttonStencil.vars.label]: brand.error.accent,
|
|
48
|
-
[systemIconStencil.vars.color]: cssVar(buttonColorPropVars.disabled.icon, brand.error.accent),
|
|
49
88
|
[buttonStencil.vars.opacity]: system.opacity.disabled,
|
|
89
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
90
|
+
[buttonStencil.vars.background]: cssVar(system.color.brand.accent.critical, brand.error.base),
|
|
91
|
+
[systemIconStencil.vars.color]: cssVar(
|
|
92
|
+
buttonColorPropVars.disabled.icon,
|
|
93
|
+
cssVar(system.color.fg.inverse, brand.error.accent)
|
|
94
|
+
),
|
|
95
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
96
|
+
[buttonStencil.vars.label]: cssVar(system.color.fg.inverse, brand.error.accent),
|
|
50
97
|
},
|
|
51
98
|
},
|
|
52
99
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
2
2
|
import {systemIconStencil} from '@workday/canvas-kit-react/icon';
|
|
3
|
-
import {createStencil, cssVar} from '@workday/canvas-kit-styling';
|
|
4
|
-
import {brand, system} from '@workday/canvas-tokens-web';
|
|
3
|
+
import {colorSpace, createStencil, cssVar} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {base, brand, system} from '@workday/canvas-tokens-web';
|
|
5
5
|
|
|
6
6
|
import {buttonColorPropVars, buttonStencil} from './BaseButton';
|
|
7
7
|
import {Button, type ButtonProps} from './Button';
|
|
@@ -22,69 +22,149 @@ const primaryButtonStencil = createStencil({
|
|
|
22
22
|
extends: buttonStencil,
|
|
23
23
|
base: {
|
|
24
24
|
// Base Styles
|
|
25
|
-
|
|
25
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
26
|
+
[buttonStencil.vars.background]: cssVar(
|
|
27
|
+
brand.action.base,
|
|
28
|
+
cssVar(system.color.brand.accent.primary, brand.primary.base)
|
|
29
|
+
),
|
|
30
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
26
31
|
[buttonStencil.vars.borderRadius]: cssVar(system.shape.full, system.shape.round),
|
|
27
|
-
|
|
32
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
33
|
+
[buttonStencil.vars.label]: cssVar(
|
|
34
|
+
brand.action.accent,
|
|
35
|
+
cssVar(system.color.fg.inverse, brand.primary.accent)
|
|
36
|
+
),
|
|
28
37
|
[systemIconStencil.vars.color]: cssVar(buttonColorPropVars.default.icon, 'currentColor'),
|
|
29
38
|
// Focus Styles
|
|
30
39
|
'&:focus-visible, &.focus': {
|
|
31
|
-
|
|
32
|
-
[buttonStencil.vars.
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
41
|
+
[buttonStencil.vars.background]: cssVar(
|
|
42
|
+
brand.action.base,
|
|
43
|
+
cssVar(system.color.brand.accent.primary, brand.primary.base)
|
|
44
|
+
),
|
|
45
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
46
|
+
[buttonStencil.vars.label]: cssVar(
|
|
47
|
+
brand.action.accent,
|
|
48
|
+
cssVar(system.color.fg.inverse, brand.primary.accent)
|
|
49
|
+
),
|
|
50
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
51
|
+
[buttonStencil.vars.boxShadowInner]: cssVar(
|
|
52
|
+
system.color.focus.inverse,
|
|
53
|
+
cssVar(system.color.border.inverse.default, base.neutral0)
|
|
54
|
+
),
|
|
55
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
56
|
+
[buttonStencil.vars.boxShadowOuter]: cssVar(
|
|
57
|
+
system.color.brand.focus.primary,
|
|
58
|
+
brand.common.focusOutline
|
|
59
|
+
),
|
|
35
60
|
[systemIconStencil.vars.color]: cssVar(buttonColorPropVars.focus.icon, 'currentColor'),
|
|
36
61
|
},
|
|
37
62
|
// Hover Styles
|
|
38
63
|
'&:hover, &.hover': {
|
|
39
|
-
|
|
40
|
-
[buttonStencil.vars.
|
|
64
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
65
|
+
[buttonStencil.vars.background]: colorSpace.darken(
|
|
66
|
+
brand.action.dark,
|
|
67
|
+
cssVar(system.color.brand.accent.primary, brand.primary.dark),
|
|
68
|
+
system.color.accent.overlay.mixin,
|
|
69
|
+
system.opacity.accent.hover
|
|
70
|
+
),
|
|
71
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
72
|
+
[buttonStencil.vars.label]: cssVar(
|
|
73
|
+
brand.action.accent,
|
|
74
|
+
cssVar(system.color.fg.inverse, brand.primary.accent)
|
|
75
|
+
),
|
|
41
76
|
[systemIconStencil.vars.color]: cssVar(buttonColorPropVars.hover.icon, 'currentColor'),
|
|
42
77
|
},
|
|
43
78
|
// Active Styles
|
|
44
79
|
'&:active, &.active': {
|
|
45
|
-
|
|
46
|
-
[buttonStencil.vars.
|
|
80
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
81
|
+
[buttonStencil.vars.background]: colorSpace.darken(
|
|
82
|
+
brand.action.darkest,
|
|
83
|
+
cssVar(system.color.brand.accent.primary, brand.primary.darkest),
|
|
84
|
+
system.color.accent.overlay.mixin,
|
|
85
|
+
system.opacity.accent.pressed
|
|
86
|
+
),
|
|
87
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
88
|
+
[buttonStencil.vars.label]: cssVar(
|
|
89
|
+
brand.action.accent,
|
|
90
|
+
cssVar(system.color.fg.inverse, brand.primary.accent)
|
|
91
|
+
),
|
|
47
92
|
[systemIconStencil.vars.color]: cssVar(buttonColorPropVars.active.icon, 'currentColor'),
|
|
48
93
|
},
|
|
49
94
|
// Disabled Styles
|
|
50
95
|
'&:disabled, &.disabled': {
|
|
51
|
-
[buttonStencil.vars.background]: cssVar(brand.action.base, brand.primary.base),
|
|
52
|
-
[buttonStencil.vars.label]: cssVar(brand.action.accent, brand.primary.accent),
|
|
53
96
|
[buttonStencil.vars.opacity]: system.opacity.disabled,
|
|
54
|
-
[
|
|
97
|
+
[buttonStencil.vars.background]: cssVar(
|
|
98
|
+
brand.action.base,
|
|
99
|
+
cssVar(system.color.brand.accent.primary, brand.primary.base)
|
|
100
|
+
),
|
|
101
|
+
[buttonStencil.vars.label]: cssVar(
|
|
102
|
+
brand.action.accent,
|
|
103
|
+
cssVar(system.color.fg.inverse, brand.primary.accent)
|
|
104
|
+
),
|
|
105
|
+
[systemIconStencil.vars.color]: cssVar(buttonColorPropVars.default.icon, 'currentColor'),
|
|
55
106
|
},
|
|
56
107
|
},
|
|
57
108
|
modifiers: {
|
|
58
109
|
variant: {
|
|
59
110
|
// Inverse Styles
|
|
60
111
|
inverse: {
|
|
61
|
-
|
|
62
|
-
[buttonStencil.vars.
|
|
112
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
113
|
+
[buttonStencil.vars.background]: cssVar(
|
|
114
|
+
brand.action.lightest,
|
|
115
|
+
cssVar(system.color.surface.inverse, brand.primary.lightest)
|
|
116
|
+
),
|
|
117
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
118
|
+
[buttonStencil.vars.borderRadius]: cssVar(system.shape.full, system.shape.round),
|
|
63
119
|
[buttonStencil.vars.label]: system.color.fg.strong,
|
|
64
120
|
[systemIconStencil.vars.color]: cssVar(buttonColorPropVars.default.icon, 'currentColor'),
|
|
121
|
+
// Hover Styles
|
|
122
|
+
'&:hover, &.hover': {
|
|
123
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
124
|
+
[buttonStencil.vars.background]: colorSpace.darken(
|
|
125
|
+
brand.action.lighter,
|
|
126
|
+
cssVar(system.color.surface.inverse, brand.primary.lighter),
|
|
127
|
+
system.color.accent.overlay.mixin,
|
|
128
|
+
system.opacity.accent.hover
|
|
129
|
+
),
|
|
130
|
+
[buttonStencil.vars.label]: system.color.fg.stronger,
|
|
131
|
+
[systemIconStencil.vars.color]: cssVar(buttonColorPropVars.hover.icon, 'currentColor'),
|
|
132
|
+
},
|
|
65
133
|
// Focus Styles
|
|
66
134
|
'&:focus-visible, &.focus': {
|
|
67
|
-
|
|
135
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
136
|
+
[buttonStencil.vars.background]: cssVar(
|
|
137
|
+
brand.action.lightest,
|
|
138
|
+
cssVar(system.color.surface.inverse, brand.primary.lightest)
|
|
139
|
+
),
|
|
68
140
|
[buttonStencil.vars.label]: system.color.fg.strong,
|
|
69
141
|
[buttonStencil.vars.boxShadowInner]: system.color.border.contrast.default,
|
|
70
|
-
|
|
142
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
143
|
+
[buttonStencil.vars.boxShadowOuter]: cssVar(
|
|
144
|
+
system.color.focus.inverse,
|
|
145
|
+
cssVar(system.color.border.inverse.default, base.neutral0)
|
|
146
|
+
),
|
|
71
147
|
[systemIconStencil.vars.color]: cssVar(buttonColorPropVars.focus.icon, 'currentColor'),
|
|
72
148
|
},
|
|
73
|
-
// Hover Styles
|
|
74
|
-
'&:hover, &.hover': {
|
|
75
|
-
[buttonStencil.vars.background]: cssVar(brand.action.lighter, brand.primary.lightest),
|
|
76
|
-
[buttonStencil.vars.label]: system.color.fg.stronger,
|
|
77
|
-
[systemIconStencil.vars.color]: cssVar(buttonColorPropVars.hover.icon, 'currentColor'),
|
|
78
|
-
},
|
|
79
149
|
// Active Styles
|
|
80
150
|
'&:active, &.active': {
|
|
81
|
-
|
|
151
|
+
// TODO (forwardfit token): Revisit token, using v4 token and fallback to v3 token
|
|
152
|
+
[buttonStencil.vars.background]: colorSpace.darken(
|
|
153
|
+
brand.action.light,
|
|
154
|
+
cssVar(system.color.surface.inverse, brand.primary.light),
|
|
155
|
+
system.color.accent.overlay.mixin,
|
|
156
|
+
system.opacity.accent.pressed
|
|
157
|
+
),
|
|
82
158
|
[buttonStencil.vars.label]: system.color.fg.stronger,
|
|
83
159
|
[systemIconStencil.vars.color]: cssVar(buttonColorPropVars.active.icon, 'currentColor'),
|
|
84
160
|
},
|
|
85
161
|
// Disabled Styles
|
|
86
162
|
'&:disabled, &.disabled': {
|
|
87
|
-
[buttonStencil.vars.
|
|
163
|
+
[buttonStencil.vars.opacity]: system.opacity.disabled,
|
|
164
|
+
[buttonStencil.vars.background]: cssVar(
|
|
165
|
+
brand.action.lightest,
|
|
166
|
+
cssVar(system.color.surface.inverse, brand.primary.lightest)
|
|
167
|
+
),
|
|
88
168
|
[buttonStencil.vars.label]: system.color.fg.strong,
|
|
89
169
|
[systemIconStencil.vars.color]: cssVar(buttonColorPropVars.disabled.icon, 'currentColor'),
|
|
90
170
|
},
|