@workday/canvas-kit-labs-react 6.8.10 → 6.9.0-next.3
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/combobox/README.md +1 -1
- package/combobox/lib/Combobox.tsx +12 -14
- package/common/README.md +10 -4
- package/common/index.ts +0 -8
- package/dist/commonjs/combobox/index.js +12 -4
- package/dist/commonjs/combobox/lib/AutocompleteList.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/AutocompleteList.js +19 -7
- package/dist/commonjs/combobox/lib/Combobox.d.ts +3 -4
- package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/Combobox.js +31 -19
- package/dist/commonjs/combobox/lib/Status.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/Status.js +14 -2
- package/dist/commonjs/common/index.d.ts +0 -8
- package/dist/commonjs/common/index.d.ts.map +1 -1
- package/dist/commonjs/common/index.js +14 -7
- package/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.d.ts.map +1 -1
- package/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.js +3 -1
- package/dist/commonjs/common/lib/storybook-utils/permutateProps.d.ts.map +1 -1
- package/dist/commonjs/common/lib/storybook-utils/permutateProps.js +3 -1
- package/dist/commonjs/common/lib/theming/index.js +12 -5
- package/dist/commonjs/common/lib/theming/useThemeRTL.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/useThemeRTL.js +1 -0
- package/dist/commonjs/common/lib/theming/useThemedRing.d.ts +1 -1
- package/dist/commonjs/common/lib/theming/useThemedRing.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/useThemedRing.js +3 -1
- package/dist/commonjs/drawer/index.js +12 -4
- package/dist/commonjs/drawer/lib/Drawer.js +21 -8
- package/dist/commonjs/drawer/lib/DrawerHeader.js +22 -10
- package/dist/commonjs/index.d.ts +0 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +14 -9
- package/dist/commonjs/search-form/index.js +12 -5
- package/dist/commonjs/search-form/lib/SearchForm.d.ts +3 -2
- package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -1
- package/dist/commonjs/search-form/lib/SearchForm.js +35 -28
- package/dist/commonjs/search-form/lib/themes.d.ts.map +1 -1
- package/dist/commonjs/search-form/lib/themes.js +1 -0
- package/dist/es6/combobox/lib/AutocompleteList.d.ts.map +1 -1
- package/dist/es6/combobox/lib/Combobox.d.ts +3 -4
- package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/es6/combobox/lib/Combobox.js +6 -9
- package/dist/es6/combobox/lib/Status.d.ts.map +1 -1
- package/dist/es6/common/index.d.ts +0 -8
- package/dist/es6/common/index.d.ts.map +1 -1
- package/dist/es6/common/index.js +0 -1
- package/dist/es6/common/lib/storybook-utils/ComponentStatesTable.d.ts.map +1 -1
- package/dist/es6/common/lib/storybook-utils/permutateProps.d.ts.map +1 -1
- package/dist/es6/common/lib/storybook-utils/propTypes.js +1 -0
- package/dist/es6/common/lib/theming/useThemeRTL.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/useThemedRing.d.ts +1 -1
- package/dist/es6/common/lib/theming/useThemedRing.d.ts.map +1 -1
- package/dist/es6/drawer/lib/Drawer.js +1 -1
- package/dist/es6/drawer/lib/DrawerHeader.js +4 -4
- package/dist/es6/index.d.ts +0 -2
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +0 -2
- package/dist/es6/search-form/lib/SearchForm.d.ts +3 -2
- package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -1
- package/dist/es6/search-form/lib/SearchForm.js +16 -22
- package/dist/es6/search-form/lib/themes.d.ts.map +1 -1
- package/drawer/lib/DrawerHeader.tsx +3 -3
- package/index.ts +0 -2
- package/package.json +12 -22
- package/search-form/lib/SearchForm.tsx +21 -39
- package/search-form/lib/themes.ts +2 -1
- package/common/lib/Box.tsx +0 -87
- package/common/lib/utils/border.ts +0 -263
- package/common/lib/utils/color.ts +0 -62
- package/common/lib/utils/depth.ts +0 -37
- package/common/lib/utils/flexItem.ts +0 -56
- package/common/lib/utils/layout.ts +0 -77
- package/common/lib/utils/position.ts +0 -96
- package/common/lib/utils/space.ts +0 -207
- package/common/lib/utils/types.ts +0 -105
- package/dist/commonjs/common/lib/Box.d.ts +0 -30
- package/dist/commonjs/common/lib/Box.d.ts.map +0 -1
- package/dist/commonjs/common/lib/Box.js +0 -85
- package/dist/commonjs/common/lib/utils/border.d.ts +0 -103
- package/dist/commonjs/common/lib/utils/border.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/border.js +0 -152
- package/dist/commonjs/common/lib/utils/color.d.ts +0 -26
- package/dist/commonjs/common/lib/utils/color.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/color.js +0 -56
- package/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
- package/dist/commonjs/common/lib/utils/depth.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/depth.js +0 -28
- package/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
- package/dist/commonjs/common/lib/utils/flexItem.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/flexItem.js +0 -38
- package/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
- package/dist/commonjs/common/lib/utils/layout.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/layout.js +0 -42
- package/dist/commonjs/common/lib/utils/position.d.ts +0 -41
- package/dist/commonjs/common/lib/utils/position.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/position.js +0 -77
- package/dist/commonjs/common/lib/utils/space.d.ts +0 -64
- package/dist/commonjs/common/lib/utils/space.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/space.js +0 -160
- package/dist/commonjs/common/lib/utils/types.d.ts +0 -14
- package/dist/commonjs/common/lib/utils/types.d.ts.map +0 -1
- package/dist/commonjs/common/lib/utils/types.js +0 -2
- package/dist/commonjs/header/index.d.ts +0 -9
- package/dist/commonjs/header/index.d.ts.map +0 -1
- package/dist/commonjs/header/index.js +0 -16
- package/dist/commonjs/header/lib/GlobalHeader.d.ts +0 -38
- package/dist/commonjs/header/lib/GlobalHeader.d.ts.map +0 -1
- package/dist/commonjs/header/lib/GlobalHeader.js +0 -74
- package/dist/commonjs/header/lib/Header.d.ts +0 -76
- package/dist/commonjs/header/lib/Header.d.ts.map +0 -1
- package/dist/commonjs/header/lib/Header.js +0 -321
- package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +0 -30
- package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts.map +0 -1
- package/dist/commonjs/header/lib/parts/DubLogoTitle.js +0 -105
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts.map +0 -1
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.js +0 -124
- package/dist/commonjs/header/lib/parts/index.d.ts +0 -3
- package/dist/commonjs/header/lib/parts/index.d.ts.map +0 -1
- package/dist/commonjs/header/lib/parts/index.js +0 -6
- package/dist/commonjs/header/lib/shared/themes.d.ts +0 -43
- package/dist/commonjs/header/lib/shared/themes.d.ts.map +0 -1
- package/dist/commonjs/header/lib/shared/themes.js +0 -62
- package/dist/commonjs/header/lib/shared/types.d.ts +0 -15
- package/dist/commonjs/header/lib/shared/types.d.ts.map +0 -1
- package/dist/commonjs/header/lib/shared/types.js +0 -19
- package/dist/commonjs/layout/index.d.ts +0 -5
- package/dist/commonjs/layout/index.d.ts.map +0 -1
- package/dist/commonjs/layout/index.js +0 -7
- package/dist/commonjs/layout/lib/Flex.d.ts +0 -26
- package/dist/commonjs/layout/lib/Flex.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/Flex.js +0 -70
- package/dist/commonjs/layout/lib/Stack.d.ts +0 -27
- package/dist/commonjs/layout/lib/Stack.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/Stack.js +0 -86
- package/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
- package/dist/commonjs/layout/lib/utils/flex.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/flex.js +0 -37
- package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
- package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/getValidChildren.js +0 -16
- package/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
- package/dist/commonjs/layout/lib/utils/stack.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/stack.js +0 -54
- package/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
- package/dist/commonjs/layout/lib/utils/types.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/types.js +0 -2
- package/dist/es6/common/lib/Box.d.ts +0 -30
- package/dist/es6/common/lib/Box.d.ts.map +0 -1
- package/dist/es6/common/lib/Box.js +0 -73
- package/dist/es6/common/lib/utils/border.d.ts +0 -103
- package/dist/es6/common/lib/utils/border.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/border.js +0 -149
- package/dist/es6/common/lib/utils/color.d.ts +0 -26
- package/dist/es6/common/lib/utils/color.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/color.js +0 -53
- package/dist/es6/common/lib/utils/depth.d.ts +0 -22
- package/dist/es6/common/lib/utils/depth.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/depth.js +0 -25
- package/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
- package/dist/es6/common/lib/utils/flexItem.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/flexItem.js +0 -35
- package/dist/es6/common/lib/utils/layout.d.ts +0 -43
- package/dist/es6/common/lib/utils/layout.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/layout.js +0 -39
- package/dist/es6/common/lib/utils/position.d.ts +0 -41
- package/dist/es6/common/lib/utils/position.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/position.js +0 -74
- package/dist/es6/common/lib/utils/space.d.ts +0 -64
- package/dist/es6/common/lib/utils/space.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/space.js +0 -157
- package/dist/es6/common/lib/utils/types.d.ts +0 -14
- package/dist/es6/common/lib/utils/types.d.ts.map +0 -1
- package/dist/es6/common/lib/utils/types.js +0 -0
- package/dist/es6/header/index.d.ts +0 -9
- package/dist/es6/header/index.d.ts.map +0 -1
- package/dist/es6/header/index.js +0 -8
- package/dist/es6/header/lib/GlobalHeader.d.ts +0 -38
- package/dist/es6/header/lib/GlobalHeader.d.ts.map +0 -1
- package/dist/es6/header/lib/GlobalHeader.js +0 -62
- package/dist/es6/header/lib/Header.d.ts +0 -76
- package/dist/es6/header/lib/Header.d.ts.map +0 -1
- package/dist/es6/header/lib/Header.js +0 -309
- package/dist/es6/header/lib/parts/DubLogoTitle.d.ts +0 -30
- package/dist/es6/header/lib/parts/DubLogoTitle.d.ts.map +0 -1
- package/dist/es6/header/lib/parts/DubLogoTitle.js +0 -93
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts.map +0 -1
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.js +0 -112
- package/dist/es6/header/lib/parts/index.d.ts +0 -3
- package/dist/es6/header/lib/parts/index.d.ts.map +0 -1
- package/dist/es6/header/lib/parts/index.js +0 -2
- package/dist/es6/header/lib/shared/themes.d.ts +0 -43
- package/dist/es6/header/lib/shared/themes.d.ts.map +0 -1
- package/dist/es6/header/lib/shared/themes.js +0 -57
- package/dist/es6/header/lib/shared/types.d.ts +0 -15
- package/dist/es6/header/lib/shared/types.d.ts.map +0 -1
- package/dist/es6/header/lib/shared/types.js +0 -17
- package/dist/es6/layout/index.d.ts +0 -5
- package/dist/es6/layout/index.d.ts.map +0 -1
- package/dist/es6/layout/index.js +0 -2
- package/dist/es6/layout/lib/Flex.d.ts +0 -26
- package/dist/es6/layout/lib/Flex.d.ts.map +0 -1
- package/dist/es6/layout/lib/Flex.js +0 -58
- package/dist/es6/layout/lib/Stack.d.ts +0 -27
- package/dist/es6/layout/lib/Stack.d.ts.map +0 -1
- package/dist/es6/layout/lib/Stack.js +0 -74
- package/dist/es6/layout/lib/utils/flex.d.ts +0 -36
- package/dist/es6/layout/lib/utils/flex.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/flex.js +0 -34
- package/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
- package/dist/es6/layout/lib/utils/getValidChildren.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/getValidChildren.js +0 -6
- package/dist/es6/layout/lib/utils/stack.d.ts +0 -26
- package/dist/es6/layout/lib/utils/stack.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/stack.js +0 -51
- package/dist/es6/layout/lib/utils/types.d.ts +0 -8
- package/dist/es6/layout/lib/utils/types.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/types.js +0 -0
- package/header/LICENSE +0 -51
- package/header/README.md +0 -359
- package/header/index.ts +0 -9
- package/header/lib/GlobalHeader.tsx +0 -73
- package/header/lib/Header.tsx +0 -429
- package/header/lib/parts/DubLogoTitle.tsx +0 -99
- package/header/lib/parts/WorkdayLogoTitle.tsx +0 -120
- package/header/lib/parts/index.ts +0 -2
- package/header/lib/shared/themes.tsx +0 -97
- package/header/lib/shared/types.tsx +0 -16
- package/header/package.json +0 -6
- package/layout/LICENSE +0 -52
- package/layout/README.md +0 -16
- package/layout/index.ts +0 -4
- package/layout/lib/Flex.tsx +0 -47
- package/layout/lib/Stack.tsx +0 -113
- package/layout/lib/utils/flex.ts +0 -65
- package/layout/lib/utils/getValidChildren.ts +0 -7
- package/layout/lib/utils/stack.ts +0 -78
- package/layout/lib/utils/types.ts +0 -45
- package/layout/package.json +0 -6
- package/ts3.5/dist/commonjs/combobox/index.d.ts +0 -5
- package/ts3.5/dist/commonjs/combobox/lib/AutocompleteList.d.ts +0 -32
- package/ts3.5/dist/commonjs/combobox/lib/Combobox.d.ts +0 -64
- package/ts3.5/dist/commonjs/combobox/lib/Status.d.ts +0 -11
- package/ts3.5/dist/commonjs/common/index.d.ts +0 -12
- package/ts3.5/dist/commonjs/common/lib/Box.d.ts +0 -30
- package/ts3.5/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.d.ts +0 -26
- package/ts3.5/dist/commonjs/common/lib/storybook-utils/permutateProps.d.ts +0 -5
- package/ts3.5/dist/commonjs/common/lib/storybook-utils/propTypes.d.ts +0 -15
- package/ts3.5/dist/commonjs/common/lib/theming/index.d.ts +0 -3
- package/ts3.5/dist/commonjs/common/lib/theming/useThemeRTL.d.ts +0 -36
- package/ts3.5/dist/commonjs/common/lib/theming/useThemedRing.d.ts +0 -11
- package/ts3.5/dist/commonjs/common/lib/utils/border.d.ts +0 -103
- package/ts3.5/dist/commonjs/common/lib/utils/color.d.ts +0 -26
- package/ts3.5/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
- package/ts3.5/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
- package/ts3.5/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
- package/ts3.5/dist/commonjs/common/lib/utils/position.d.ts +0 -41
- package/ts3.5/dist/commonjs/common/lib/utils/space.d.ts +0 -64
- package/ts3.5/dist/commonjs/common/lib/utils/types.d.ts +0 -14
- package/ts3.5/dist/commonjs/drawer/index.d.ts +0 -6
- package/ts3.5/dist/commonjs/drawer/lib/Drawer.d.ts +0 -49
- package/ts3.5/dist/commonjs/drawer/lib/DrawerHeader.d.ts +0 -38
- package/ts3.5/dist/commonjs/header/index.d.ts +0 -9
- package/ts3.5/dist/commonjs/header/lib/GlobalHeader.d.ts +0 -38
- package/ts3.5/dist/commonjs/header/lib/Header.d.ts +0 -76
- package/ts3.5/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +0 -30
- package/ts3.5/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
- package/ts3.5/dist/commonjs/header/lib/parts/index.d.ts +0 -3
- package/ts3.5/dist/commonjs/header/lib/shared/themes.d.ts +0 -43
- package/ts3.5/dist/commonjs/header/lib/shared/types.d.ts +0 -15
- package/ts3.5/dist/commonjs/index.d.ts +0 -7
- package/ts3.5/dist/commonjs/layout/index.d.ts +0 -5
- package/ts3.5/dist/commonjs/layout/lib/Flex.d.ts +0 -26
- package/ts3.5/dist/commonjs/layout/lib/Stack.d.ts +0 -27
- package/ts3.5/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
- package/ts3.5/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
- package/ts3.5/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
- package/ts3.5/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
- package/ts3.5/dist/commonjs/search-form/index.d.ts +0 -3
- package/ts3.5/dist/commonjs/search-form/lib/SearchForm.d.ts +0 -107
- package/ts3.5/dist/commonjs/search-form/lib/themes.d.ts +0 -21
- package/ts3.5/dist/es6/combobox/index.d.ts +0 -5
- package/ts3.5/dist/es6/combobox/lib/AutocompleteList.d.ts +0 -32
- package/ts3.5/dist/es6/combobox/lib/Combobox.d.ts +0 -64
- package/ts3.5/dist/es6/combobox/lib/Status.d.ts +0 -11
- package/ts3.5/dist/es6/common/index.d.ts +0 -12
- package/ts3.5/dist/es6/common/lib/Box.d.ts +0 -30
- package/ts3.5/dist/es6/common/lib/storybook-utils/ComponentStatesTable.d.ts +0 -26
- package/ts3.5/dist/es6/common/lib/storybook-utils/permutateProps.d.ts +0 -5
- package/ts3.5/dist/es6/common/lib/storybook-utils/propTypes.d.ts +0 -15
- package/ts3.5/dist/es6/common/lib/theming/index.d.ts +0 -3
- package/ts3.5/dist/es6/common/lib/theming/useThemeRTL.d.ts +0 -36
- package/ts3.5/dist/es6/common/lib/theming/useThemedRing.d.ts +0 -11
- package/ts3.5/dist/es6/common/lib/utils/border.d.ts +0 -103
- package/ts3.5/dist/es6/common/lib/utils/color.d.ts +0 -26
- package/ts3.5/dist/es6/common/lib/utils/depth.d.ts +0 -22
- package/ts3.5/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
- package/ts3.5/dist/es6/common/lib/utils/layout.d.ts +0 -43
- package/ts3.5/dist/es6/common/lib/utils/position.d.ts +0 -41
- package/ts3.5/dist/es6/common/lib/utils/space.d.ts +0 -64
- package/ts3.5/dist/es6/common/lib/utils/types.d.ts +0 -14
- package/ts3.5/dist/es6/drawer/index.d.ts +0 -6
- package/ts3.5/dist/es6/drawer/lib/Drawer.d.ts +0 -49
- package/ts3.5/dist/es6/drawer/lib/DrawerHeader.d.ts +0 -38
- package/ts3.5/dist/es6/header/index.d.ts +0 -9
- package/ts3.5/dist/es6/header/lib/GlobalHeader.d.ts +0 -38
- package/ts3.5/dist/es6/header/lib/Header.d.ts +0 -76
- package/ts3.5/dist/es6/header/lib/parts/DubLogoTitle.d.ts +0 -30
- package/ts3.5/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
- package/ts3.5/dist/es6/header/lib/parts/index.d.ts +0 -3
- package/ts3.5/dist/es6/header/lib/shared/themes.d.ts +0 -43
- package/ts3.5/dist/es6/header/lib/shared/types.d.ts +0 -15
- package/ts3.5/dist/es6/index.d.ts +0 -7
- package/ts3.5/dist/es6/layout/index.d.ts +0 -5
- package/ts3.5/dist/es6/layout/lib/Flex.d.ts +0 -26
- package/ts3.5/dist/es6/layout/lib/Stack.d.ts +0 -27
- package/ts3.5/dist/es6/layout/lib/utils/flex.d.ts +0 -36
- package/ts3.5/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
- package/ts3.5/dist/es6/layout/lib/utils/stack.d.ts +0 -26
- package/ts3.5/dist/es6/layout/lib/utils/types.d.ts +0 -8
- package/ts3.5/dist/es6/search-form/index.d.ts +0 -3
- package/ts3.5/dist/es6/search-form/lib/SearchForm.d.ts +0 -107
- package/ts3.5/dist/es6/search-form/lib/themes.d.ts +0 -21
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
28
|
-
result["default"] = mod;
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
var React = __importStar(require("react"));
|
|
36
|
-
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
37
|
-
var is_prop_valid_1 = __importDefault(require("@emotion/is-prop-valid"));
|
|
38
|
-
var common_1 = require("@workday/canvas-kit-react/common");
|
|
39
|
-
// style props
|
|
40
|
-
var border_1 = require("./utils/border");
|
|
41
|
-
var color_1 = require("./utils/color");
|
|
42
|
-
var depth_1 = require("./utils/depth");
|
|
43
|
-
var flexItem_1 = require("./utils/flexItem");
|
|
44
|
-
var layout_1 = require("./utils/layout");
|
|
45
|
-
var position_1 = require("./utils/position");
|
|
46
|
-
var space_1 = require("./utils/space");
|
|
47
|
-
var omittedProps = ['display', 'color', 'height', 'overflow', 'width', 'border', 'background'];
|
|
48
|
-
var shouldForwardProp = function (prop) {
|
|
49
|
-
return is_prop_valid_1.default(prop) && !omittedProps.includes(prop);
|
|
50
|
-
};
|
|
51
|
-
// Meant to be used with elements. The `shouldForwardProps` will remove all style props
|
|
52
|
-
var StyledBoxElement = styled_1.default('div', { shouldForwardProp: shouldForwardProp })({
|
|
53
|
-
boxSizing: 'border-box',
|
|
54
|
-
}, border_1.border, color_1.color, depth_1.depth, flexItem_1.flexItem, layout_1.layout, position_1.position, space_1.space);
|
|
55
|
-
// Meant to be used with components. There is no `shouldForwardProps` - all props will be forwarded to the component
|
|
56
|
-
var StyledBoxComponent = styled_1.default('div')({
|
|
57
|
-
boxSizing: 'border-box',
|
|
58
|
-
}, border_1.border, color_1.color, depth_1.depth, flexItem_1.flexItem, layout_1.layout, position_1.position, space_1.space);
|
|
59
|
-
/**
|
|
60
|
-
* `Box` is a primitive component that provides a common, ergonomic API around Canvas design tokens.
|
|
61
|
-
* It is highly flexible, and its primary purpose is to build other components.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* import { Box, BoxProps } from '@workday/canvas-kit-labs-react/common';
|
|
65
|
-
*
|
|
66
|
-
* interface CardProps extends BoxProps {
|
|
67
|
-
* // card-specific props
|
|
68
|
-
* }
|
|
69
|
-
*
|
|
70
|
-
* // `Card`'s default values are set using `BoxProps`
|
|
71
|
-
* const Card = (props: CardProps) => (
|
|
72
|
-
* <Box depth={2} padding="m" borderRadius="l" {...props}>Hello, Card!</Box>
|
|
73
|
-
* );
|
|
74
|
-
*
|
|
75
|
-
*/
|
|
76
|
-
exports.Box = common_1.createComponent('div')({
|
|
77
|
-
displayName: 'Box',
|
|
78
|
-
Component: function (_a, ref, Element) {
|
|
79
|
-
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
80
|
-
var BoxComponent = common_1.useConstant(function () {
|
|
81
|
-
return typeof Element === 'string' ? StyledBoxElement : StyledBoxComponent;
|
|
82
|
-
});
|
|
83
|
-
return (React.createElement(BoxComponent, __assign({ as: Element, ref: ref }, elemProps), children));
|
|
84
|
-
},
|
|
85
|
-
});
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { CanvasBorderRadiusKeys, CanvasColor } from '@workday/canvas-kit-react/tokens';
|
|
2
|
-
import { PartialEmotionCanvasTheme } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { PropertyBorder } from './types';
|
|
4
|
-
/** style props to set the border properties */
|
|
5
|
-
export declare type BorderShorthandStyleProps = {
|
|
6
|
-
/** sets `border` property */
|
|
7
|
-
border?: string;
|
|
8
|
-
/** sets `border-top` property */
|
|
9
|
-
borderTop?: string;
|
|
10
|
-
/** sets `border-right` property (no bidirectional support) */
|
|
11
|
-
borderRight?: string;
|
|
12
|
-
/** sets `border-bottom` property */
|
|
13
|
-
borderBottom?: string;
|
|
14
|
-
/** sets `border-left` property (no bidirectional support) */
|
|
15
|
-
borderLeft?: string;
|
|
16
|
-
};
|
|
17
|
-
/** style props to set the border color properties */
|
|
18
|
-
export declare type BorderColorStyleProps = {
|
|
19
|
-
/** sets `border-color` property */
|
|
20
|
-
borderColor?: CanvasColor | (string & {});
|
|
21
|
-
/** sets `border-top-color` property */
|
|
22
|
-
borderTopColor?: CanvasColor | (string & {});
|
|
23
|
-
/** sets `border-right-color` property (no bidirectional support) */
|
|
24
|
-
borderRightColor?: CanvasColor | (string & {});
|
|
25
|
-
/** sets `border-bottom-color` property */
|
|
26
|
-
borderBottomColor?: CanvasColor | (string & {});
|
|
27
|
-
/** sets `border-left-color` property (no bidirectional support) */
|
|
28
|
-
borderLeftColor?: CanvasColor | (string & {});
|
|
29
|
-
};
|
|
30
|
-
/** style props to set the border radius properties */
|
|
31
|
-
export declare type BorderRadiusStyleProps = {
|
|
32
|
-
/** sets `border-radius` property */
|
|
33
|
-
borderRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
34
|
-
/** sets `border-top-left-radius` property */
|
|
35
|
-
borderTopLeftRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
36
|
-
/** sets `border-top-right-radius` property */
|
|
37
|
-
borderTopRightRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
38
|
-
/** sets `border-bottom-left-radius` property */
|
|
39
|
-
borderBottomLeftRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
40
|
-
/** sets `border-bottom-right-radius` property */
|
|
41
|
-
borderBottomRightRadius?: CanvasBorderRadiusKeys | number | (string & {});
|
|
42
|
-
};
|
|
43
|
-
/** style props to set the border style properties */
|
|
44
|
-
export declare type BorderLineStyleProps = {
|
|
45
|
-
/** sets `border-style` property */
|
|
46
|
-
borderStyle?: PropertyBorder;
|
|
47
|
-
/** sets `border-top-style` property */
|
|
48
|
-
borderTopStyle?: PropertyBorder;
|
|
49
|
-
/** sets `border-right-style` property (no bidirectional support) */
|
|
50
|
-
borderRightStyle?: PropertyBorder;
|
|
51
|
-
/** sets `border-bottom-style` property */
|
|
52
|
-
borderBottomStyle?: PropertyBorder;
|
|
53
|
-
/** sets `border-left-style` property (no bidirectional support) */
|
|
54
|
-
borderLeftStyle?: PropertyBorder;
|
|
55
|
-
};
|
|
56
|
-
/** style props to set the border width properties */
|
|
57
|
-
export declare type BorderWidthStyleProps = {
|
|
58
|
-
/** sets `border-width` property */
|
|
59
|
-
borderWidth?: string | number;
|
|
60
|
-
/** sets `border-top-width` property */
|
|
61
|
-
borderTopWidth?: string | number;
|
|
62
|
-
/** sets `border-right-width` property (no bidirectional support) */
|
|
63
|
-
borderRightWidth?: string | number;
|
|
64
|
-
/** sets `border-bottom-width` property */
|
|
65
|
-
borderBottomWidth?: string | number;
|
|
66
|
-
/** sets `border-left-width` property (no bidirectional support) */
|
|
67
|
-
borderLeftWidth?: string | number;
|
|
68
|
-
};
|
|
69
|
-
export declare type BorderLogicalStyleProps = {
|
|
70
|
-
/** sets `border-left` property (bidirectional support) */
|
|
71
|
-
borderInlineStart?: string;
|
|
72
|
-
/** sets `border-left-color` property (bidirectional support) */
|
|
73
|
-
borderInlineStartColor?: CanvasColor | (string & {});
|
|
74
|
-
/** sets `border-left-style` property (bidirectional support) */
|
|
75
|
-
borderInlineStartStyle?: PropertyBorder;
|
|
76
|
-
/** sets `border-left-width` property (bidirectional support) */
|
|
77
|
-
borderInlineStartWidth?: string | number;
|
|
78
|
-
/** sets `border-right` property (bidirectional support) */
|
|
79
|
-
borderInlineEnd?: string;
|
|
80
|
-
/** sets `border-right-color` property (bidirectional support) */
|
|
81
|
-
borderInlineEndColor?: CanvasColor | (string & {});
|
|
82
|
-
/** sets `border-right-style` property (bidirectional support) */
|
|
83
|
-
borderInlineEndStyle?: PropertyBorder;
|
|
84
|
-
/** sets `border-right-width` property (bidirectional support) */
|
|
85
|
-
borderInlineEndWidth?: string | number;
|
|
86
|
-
};
|
|
87
|
-
/** a collection style props for border properties */
|
|
88
|
-
export declare type BorderStyleProps = BorderShorthandStyleProps & BorderColorStyleProps & BorderRadiusStyleProps & BorderLineStyleProps & BorderWidthStyleProps & BorderLogicalStyleProps;
|
|
89
|
-
/**
|
|
90
|
-
* A style prop function that takes components props and returns border styles. Some props, such as borderRadius and borderColor, are connected to our design tokens.
|
|
91
|
-
* If no `BorderStyleProps` are found, it returns an empty object.
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* // You'll most likely use `border` with low-level, styled components
|
|
95
|
-
* const BoxExample = () => (
|
|
96
|
-
* <Box border={`solid 1px #333333 ${colors.blackPepper400}`}>Hello, border styles!</Box>
|
|
97
|
-
* );
|
|
98
|
-
*
|
|
99
|
-
*/
|
|
100
|
-
export declare function border<P extends BorderStyleProps & {
|
|
101
|
-
theme?: PartialEmotionCanvasTheme;
|
|
102
|
-
}>(props: P): {};
|
|
103
|
-
//# sourceMappingURL=border.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"border.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/border.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
4
|
-
var common_1 = require("@workday/canvas-kit-react/common");
|
|
5
|
-
// border logical prop handlers
|
|
6
|
-
var borderInlineStart = function (isRTL) { return (isRTL ? 'borderRight' : 'borderLeft'); };
|
|
7
|
-
var borderInlineEnd = function (isRTL) { return (isRTL ? 'borderLeft' : 'borderRight'); };
|
|
8
|
-
var borderInlineStartColor = function (isRTL) { return (isRTL ? 'borderRightColor' : 'borderLeftColor'); };
|
|
9
|
-
var borderInlineEndColor = function (isRTL) { return (isRTL ? 'borderLeftColor' : 'borderRightColor'); };
|
|
10
|
-
var borderInlineStartStyle = function (isRTL) { return (isRTL ? 'borderRightStyle' : 'borderLeftStyle'); };
|
|
11
|
-
var borderInlineEndStyle = function (isRTL) { return (isRTL ? 'borderLeftStyle' : 'borderRightStyle'); };
|
|
12
|
-
var borderInlineStartWidth = function (isRTL) { return (isRTL ? 'borderRightWidth' : 'borderLeftWidth'); };
|
|
13
|
-
var borderInlineEndWidth = function (isRTL) { return (isRTL ? 'borderLeftWidth' : 'borderRightWidth'); };
|
|
14
|
-
var borderShorthandProps = {
|
|
15
|
-
border: 'border',
|
|
16
|
-
borderTop: 'borderTop',
|
|
17
|
-
borderRight: 'borderRight',
|
|
18
|
-
borderBottom: 'borderBottom',
|
|
19
|
-
borderLeft: 'borderLeft',
|
|
20
|
-
borderInlineStart: borderInlineStart,
|
|
21
|
-
borderInlineEnd: borderInlineEnd,
|
|
22
|
-
};
|
|
23
|
-
var borderColors = {
|
|
24
|
-
borderColor: 'borderColor',
|
|
25
|
-
borderTopColor: 'borderTopColor',
|
|
26
|
-
borderRightColor: 'borderRightColor',
|
|
27
|
-
borderBottomColor: 'borderBottomColor',
|
|
28
|
-
borderLeftColor: 'borderLeftColor',
|
|
29
|
-
borderInlineStartColor: borderInlineStartColor,
|
|
30
|
-
borderInlineEndColor: borderInlineEndColor,
|
|
31
|
-
};
|
|
32
|
-
var borderRadii = {
|
|
33
|
-
borderRadius: 'borderRadius',
|
|
34
|
-
borderTopLeftRadius: 'borderTopLeftRadius',
|
|
35
|
-
borderTopRightRadius: 'borderTopRightRadius',
|
|
36
|
-
borderBottomLeftRadius: 'borderBottomLeftRadius',
|
|
37
|
-
borderBottomRightRadius: 'borderBottomRightRadius',
|
|
38
|
-
};
|
|
39
|
-
var borderStyles = {
|
|
40
|
-
borderStyle: 'borderStyle',
|
|
41
|
-
borderTopStyle: 'borderTopStyle',
|
|
42
|
-
borderRightStyle: 'borderRightStyle',
|
|
43
|
-
borderBottomStyle: 'borderBottomStyle',
|
|
44
|
-
borderLeftStyle: 'borderLeftStyle',
|
|
45
|
-
borderInlineStartStyle: borderInlineStartStyle,
|
|
46
|
-
borderInlineEndStyle: borderInlineEndStyle,
|
|
47
|
-
};
|
|
48
|
-
var borderWidths = {
|
|
49
|
-
borderWidth: 'borderWidth',
|
|
50
|
-
borderTopWidth: 'borderTopWidth',
|
|
51
|
-
borderRightWidth: 'borderRightWidth',
|
|
52
|
-
borderBottomWidth: 'borderBottomWidth',
|
|
53
|
-
borderLeftWidth: 'borderLeftWidth',
|
|
54
|
-
borderInlineStartWidth: borderInlineStartWidth,
|
|
55
|
-
borderInlineEndWidth: borderInlineEndWidth,
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* A style prop function that takes components props and returns border styles. Some props, such as borderRadius and borderColor, are connected to our design tokens.
|
|
59
|
-
* If no `BorderStyleProps` are found, it returns an empty object.
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* // You'll most likely use `border` with low-level, styled components
|
|
63
|
-
* const BoxExample = () => (
|
|
64
|
-
* <Box border={`solid 1px #333333 ${colors.blackPepper400}`}>Hello, border styles!</Box>
|
|
65
|
-
* );
|
|
66
|
-
*
|
|
67
|
-
*/
|
|
68
|
-
function border(props) {
|
|
69
|
-
// border will always be used within the context of a component, but eslint doesn't know that
|
|
70
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
71
|
-
var canvas = common_1.useTheme(props.theme).canvas;
|
|
72
|
-
var isRTL = canvas.direction === common_1.ContentDirection.RTL;
|
|
73
|
-
var styles = {};
|
|
74
|
-
for (var key in props) {
|
|
75
|
-
if (props.hasOwnProperty(key)) {
|
|
76
|
-
if (key in borderShorthandProps) {
|
|
77
|
-
var value = props[key];
|
|
78
|
-
var attr = void 0;
|
|
79
|
-
if (key === 'borderInlineStart') {
|
|
80
|
-
attr = borderInlineStart(isRTL);
|
|
81
|
-
}
|
|
82
|
-
else if (key === 'borderInlineEnd') {
|
|
83
|
-
attr = borderInlineEnd(isRTL);
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
attr = borderShorthandProps[key];
|
|
87
|
-
}
|
|
88
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
89
|
-
styles[attr] = value;
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
if (key in borderColors) {
|
|
93
|
-
var propValue = props[key];
|
|
94
|
-
var value = tokens_1.colors[propValue] || propValue;
|
|
95
|
-
var attr = void 0;
|
|
96
|
-
if (key === 'borderInlineStartColor') {
|
|
97
|
-
attr = borderInlineStartColor(isRTL);
|
|
98
|
-
}
|
|
99
|
-
else if (key === 'borderInlineEndColor') {
|
|
100
|
-
attr = borderInlineEndColor(isRTL);
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
attr = borderColors[key];
|
|
104
|
-
}
|
|
105
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
106
|
-
styles[attr] = value;
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
if (key in borderRadii) {
|
|
110
|
-
var propValue = props[key];
|
|
111
|
-
var value = tokens_1.borderRadius[propValue] || propValue;
|
|
112
|
-
var attr = borderRadii[key];
|
|
113
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
114
|
-
styles[attr] = value;
|
|
115
|
-
continue;
|
|
116
|
-
}
|
|
117
|
-
if (key in borderStyles) {
|
|
118
|
-
var value = props[key];
|
|
119
|
-
var attr = void 0;
|
|
120
|
-
if (key === 'borderInlineStartStyle') {
|
|
121
|
-
attr = borderInlineStartStyle(isRTL);
|
|
122
|
-
}
|
|
123
|
-
else if (key === 'borderInlineEndStyle') {
|
|
124
|
-
attr = borderInlineEndStyle(isRTL);
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
attr = borderStyles[key];
|
|
128
|
-
}
|
|
129
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
130
|
-
styles[attr] = value;
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
if (key in borderWidths) {
|
|
134
|
-
var value = props[key];
|
|
135
|
-
var attr = void 0;
|
|
136
|
-
if (key === 'borderInlineStartWidth') {
|
|
137
|
-
attr = borderInlineStartWidth(isRTL);
|
|
138
|
-
}
|
|
139
|
-
else if (key === 'borderInlineEndWidth') {
|
|
140
|
-
attr = borderInlineEndWidth(isRTL);
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
attr = borderWidths[key];
|
|
144
|
-
}
|
|
145
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
146
|
-
styles[attr] = value;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return styles;
|
|
151
|
-
}
|
|
152
|
-
exports.border = border;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { colors as colorTokens, CanvasColor } from '@workday/canvas-kit-react/tokens';
|
|
2
|
-
export declare type ColorTokens = typeof colorTokens;
|
|
3
|
-
/** style props to for color properties */
|
|
4
|
-
export declare type ColorStyleProps = {
|
|
5
|
-
/** sets `background` property */
|
|
6
|
-
background?: CanvasColor | (string & {});
|
|
7
|
-
/** sets `background-color` property */
|
|
8
|
-
backgroundColor?: CanvasColor | (string & {});
|
|
9
|
-
/** sets `background-image` property */
|
|
10
|
-
backgroundImage?: string;
|
|
11
|
-
/** sets `color` property */
|
|
12
|
-
color?: CanvasColor | (string & {});
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* A style prop function that takes components props and returns color styles from canvas token values.
|
|
16
|
-
* If no `ColorStyleProps` are found, it returns an empty object.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // You'll most likely use `color` with low-level, styled components
|
|
20
|
-
* const BoxExample = () => (
|
|
21
|
-
* <Box backgroundColor="blueberry500" color="frenchVanilla100">Hello, colors!</Box>
|
|
22
|
-
* );
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
export declare function color<P extends ColorStyleProps>(props: P): {};
|
|
26
|
-
//# sourceMappingURL=color.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,IAAI,WAAW,EAAE,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAEpF,oBAAY,WAAW,GAAG,OAAO,WAAW,CAAC;AAE7C,0CAA0C;AAC1C,oBAAY,eAAe,GAAG;IAC5B,iCAAiC;IACjC,UAAU,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACzC,uCAAuC;IACvC,eAAe,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC9C,uCAAuC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;CACrC,CAAC;AAyBF;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,eAAe,EAAE,KAAK,EAAE,CAAC,MAWxD"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
15
|
-
var getBackground = function (value) { return ({
|
|
16
|
-
background: tokens_1.colors[value] || value,
|
|
17
|
-
}); };
|
|
18
|
-
var getBackgroundColor = function (value) { return ({
|
|
19
|
-
backgroundColor: tokens_1.colors[value] || value,
|
|
20
|
-
}); };
|
|
21
|
-
var getBackgroundImage = function (value) { return ({
|
|
22
|
-
backgroundImage: value,
|
|
23
|
-
}); };
|
|
24
|
-
var getColor = function (value) { return ({
|
|
25
|
-
color: tokens_1.colors[value] || value,
|
|
26
|
-
}); };
|
|
27
|
-
var colorProps = {
|
|
28
|
-
background: getBackground,
|
|
29
|
-
backgroundColor: getBackgroundColor,
|
|
30
|
-
backgroundImage: getBackgroundImage,
|
|
31
|
-
color: getColor,
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* A style prop function that takes components props and returns color styles from canvas token values.
|
|
35
|
-
* If no `ColorStyleProps` are found, it returns an empty object.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* // You'll most likely use `color` with low-level, styled components
|
|
39
|
-
* const BoxExample = () => (
|
|
40
|
-
* <Box backgroundColor="blueberry500" color="frenchVanilla100">Hello, colors!</Box>
|
|
41
|
-
* );
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
function color(props) {
|
|
45
|
-
var styles = {};
|
|
46
|
-
for (var key in props) {
|
|
47
|
-
if (key in colorProps) {
|
|
48
|
-
var value = props[key];
|
|
49
|
-
var colorFn = colorProps[key];
|
|
50
|
-
var style = colorFn(value);
|
|
51
|
-
styles = __assign(__assign({}, styles), style);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return styles;
|
|
55
|
-
}
|
|
56
|
-
exports.color = color;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { depth as depthTokens } from '@workday/canvas-kit-react/tokens';
|
|
2
|
-
export declare type DepthTokens = typeof depthTokens;
|
|
3
|
-
export declare type DepthTokenKeys = keyof DepthTokens;
|
|
4
|
-
export declare type DepthTokenValues = DepthTokens[keyof DepthTokens];
|
|
5
|
-
/** style props to for depth styles */
|
|
6
|
-
export declare type DepthStyleProps = {
|
|
7
|
-
/** sets depth styles (box-shadow & border) */
|
|
8
|
-
depth?: DepthTokenKeys;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* A style prop function that takes components props and returns depth styles from canvas token values.
|
|
12
|
-
* If no `DepthStyleProps` are found, it returns an empty object.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* // You'll mostly likely use `depth` with low-level, styled components
|
|
16
|
-
* const BoxExample = () => (
|
|
17
|
-
* <Box depth={3}>Hello, box shadows!</Box>
|
|
18
|
-
* );
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
export declare function depth<P extends DepthStyleProps>(props: P): DepthTokenValues;
|
|
22
|
-
//# sourceMappingURL=depth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"depth.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/depth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,IAAI,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAEtE,oBAAY,WAAW,GAAG,OAAO,WAAW,CAAC;AAC7C,oBAAY,cAAc,GAAG,MAAM,WAAW,CAAC;AAC/C,oBAAY,gBAAgB,GAAG,WAAW,CAAC,MAAM,WAAW,CAAC,CAAC;AAE9D,sCAAsC;AACtC,oBAAY,eAAe,GAAG;IAC5B,8CAA8C;IAC9C,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB,CAAC;AAMF;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,eAAe,EAAE,KAAK,EAAE,CAAC,GAAG,gBAAgB,CAS3E"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
4
|
-
var depthProps = {
|
|
5
|
-
depth: function (token) { return tokens_1.depth[token]; },
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* A style prop function that takes components props and returns depth styles from canvas token values.
|
|
9
|
-
* If no `DepthStyleProps` are found, it returns an empty object.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* // You'll mostly likely use `depth` with low-level, styled components
|
|
13
|
-
* const BoxExample = () => (
|
|
14
|
-
* <Box depth={3}>Hello, box shadows!</Box>
|
|
15
|
-
* );
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
function depth(props) {
|
|
19
|
-
for (var key in props) {
|
|
20
|
-
if (key in depthProps) {
|
|
21
|
-
var token = props[key];
|
|
22
|
-
var depthFn = depthProps[key];
|
|
23
|
-
return depthFn(token);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return {};
|
|
27
|
-
}
|
|
28
|
-
exports.depth = depth;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { PropertyJustifySelf, PropertyAlignSelf, PropertyOrder } from './types';
|
|
2
|
-
/** style props to for flexbox item properties */
|
|
3
|
-
export declare type FlexItemStyleProps = {
|
|
4
|
-
/** sets `flex` property */
|
|
5
|
-
flex?: number | string;
|
|
6
|
-
/** sets `flex-grow` property */
|
|
7
|
-
flexGrow?: number | string;
|
|
8
|
-
/** sets `flex-shrink` property */
|
|
9
|
-
flexShrink?: number | string;
|
|
10
|
-
/** sets `flex-basis` property */
|
|
11
|
-
flexBasis?: number | string;
|
|
12
|
-
/** sets `justify-self` property */
|
|
13
|
-
justifySelf?: PropertyJustifySelf;
|
|
14
|
-
/** sets `align-self` property */
|
|
15
|
-
alignSelf?: PropertyAlignSelf;
|
|
16
|
-
/** sets `order` property */
|
|
17
|
-
order?: PropertyOrder;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* A style prop function that takes component props and returns flexbox item styles.
|
|
21
|
-
* If no `FlexItemStyleProps` are found, it returns an empty object.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* // You'll most likely use `flexItem` with low-level, styled components
|
|
25
|
-
* const FlexItemExample = () => (
|
|
26
|
-
* <Box flex={1} flexBasis="auto" alignSelf={center}>
|
|
27
|
-
* Hello, flex item!
|
|
28
|
-
* </Box>
|
|
29
|
-
* );
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
export declare function flexItem<P extends FlexItemStyleProps>(props: P): {};
|
|
33
|
-
//# sourceMappingURL=flexItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flexItem.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/flexItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAE9E,iDAAiD;AACjD,oBAAY,kBAAkB,GAAG;IAC/B,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,mCAAmC;IACnC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,iCAAiC;IACjC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,4BAA4B;IAC5B,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAaF;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,kBAAkB,EAAE,KAAK,EAAE,CAAC,MAW9D"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/** style props to for flexbox item properties */
|
|
4
|
-
var flexItemProps = {
|
|
5
|
-
flex: 'flex',
|
|
6
|
-
flexGrow: 'flexGrow',
|
|
7
|
-
flexShrink: 'flexShrink',
|
|
8
|
-
flexBasis: 'flexBasis',
|
|
9
|
-
justifySelf: 'justifySelf',
|
|
10
|
-
alignSelf: 'alignSelf',
|
|
11
|
-
order: 'order',
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* A style prop function that takes component props and returns flexbox item styles.
|
|
15
|
-
* If no `FlexItemStyleProps` are found, it returns an empty object.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* // You'll most likely use `flexItem` with low-level, styled components
|
|
19
|
-
* const FlexItemExample = () => (
|
|
20
|
-
* <Box flex={1} flexBasis="auto" alignSelf={center}>
|
|
21
|
-
* Hello, flex item!
|
|
22
|
-
* </Box>
|
|
23
|
-
* );
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
function flexItem(props) {
|
|
27
|
-
var styles = {};
|
|
28
|
-
for (var key in props) {
|
|
29
|
-
if (key in flexItemProps) {
|
|
30
|
-
var attr = flexItemProps[key];
|
|
31
|
-
var value = props[key];
|
|
32
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
33
|
-
styles[attr] = value;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return styles;
|
|
37
|
-
}
|
|
38
|
-
exports.flexItem = flexItem;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { PropertyDisplay, PropertyListStyle, PropertyOverflow, PropertyOverflowX, PropertyOverflowY, PropertyVerticalAlign } from './types';
|
|
2
|
-
/** style props to for layout properties */
|
|
3
|
-
export declare type LayoutStyleProps = {
|
|
4
|
-
/** sets `display` property */
|
|
5
|
-
display?: PropertyDisplay;
|
|
6
|
-
/** sets `height` property */
|
|
7
|
-
height?: number | string;
|
|
8
|
-
/** sets `list-style property */
|
|
9
|
-
listStyle?: PropertyListStyle;
|
|
10
|
-
/** sets `max-height` property */
|
|
11
|
-
maxHeight?: number | string;
|
|
12
|
-
/** sets `max-width` property */
|
|
13
|
-
maxWidth?: number | string;
|
|
14
|
-
/** sets `min-height` property */
|
|
15
|
-
minHeight?: number | string;
|
|
16
|
-
/** sets `min-width` property */
|
|
17
|
-
minWidth?: number | string;
|
|
18
|
-
/** sets `overflow` property */
|
|
19
|
-
overflow?: PropertyOverflow;
|
|
20
|
-
/** sets `overflow-x` property */
|
|
21
|
-
overflowX?: PropertyOverflowX;
|
|
22
|
-
/** sets `overflow-y` property */
|
|
23
|
-
overflowY?: PropertyOverflowY;
|
|
24
|
-
/** sets `vertical-align` property */
|
|
25
|
-
verticalAlign?: PropertyVerticalAlign;
|
|
26
|
-
/** sets `width` property */
|
|
27
|
-
width?: number | string;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* A style prop function that takes components props and returns layout styles.
|
|
31
|
-
* If no `LayoutStyleProps` are found, it returns an empty object.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* // You'll most likely use `layout` with low-level, styled components
|
|
35
|
-
* const BoxExample = () => (
|
|
36
|
-
* <Box display="inline-block" height="50%">
|
|
37
|
-
* Hello, positions!
|
|
38
|
-
* </Box>
|
|
39
|
-
* );
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
export declare function layout<P extends LayoutStyleProps>(props: P): {};
|
|
43
|
-
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB,2CAA2C;AAC3C,oBAAY,gBAAgB,GAAG;IAC7B,8BAA8B;IAC9B,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,gCAAgC;IAChC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,iCAAiC;IACjC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,iCAAiC;IACjC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,qCAAqC;IACrC,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAiBF;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,gBAAgB,EAAE,KAAK,EAAE,CAAC,MAW1D"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var layoutProps = {
|
|
4
|
-
display: 'display',
|
|
5
|
-
height: 'height',
|
|
6
|
-
listStyle: 'listStyle',
|
|
7
|
-
maxHeight: 'maxHeight',
|
|
8
|
-
maxWidth: 'maxWidth',
|
|
9
|
-
minHeight: 'minHeight',
|
|
10
|
-
minWidth: 'minWidth',
|
|
11
|
-
overflow: 'overflow',
|
|
12
|
-
overflowX: 'overflowX',
|
|
13
|
-
overflowY: 'overflowY',
|
|
14
|
-
verticalAlign: 'verticalAlign',
|
|
15
|
-
width: 'width',
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* A style prop function that takes components props and returns layout styles.
|
|
19
|
-
* If no `LayoutStyleProps` are found, it returns an empty object.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* // You'll most likely use `layout` with low-level, styled components
|
|
23
|
-
* const BoxExample = () => (
|
|
24
|
-
* <Box display="inline-block" height="50%">
|
|
25
|
-
* Hello, positions!
|
|
26
|
-
* </Box>
|
|
27
|
-
* );
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
function layout(props) {
|
|
31
|
-
var styles = {};
|
|
32
|
-
for (var key in props) {
|
|
33
|
-
if (key in layoutProps) {
|
|
34
|
-
var attr = layoutProps[key];
|
|
35
|
-
var value = props[key];
|
|
36
|
-
// @ts-ignore TS doesn't like adding a potentially unknown key to an object, but because we own this object, it's fine.
|
|
37
|
-
styles[attr] = value;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return styles;
|
|
41
|
-
}
|
|
42
|
-
exports.layout = layout;
|