@workday/canvas-kit-react 8.0.0-alpha.208-next.1 → 8.0.0-alpha.222-next.6
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/common/lib/theming/index.ts +1 -1
- package/common/lib/theming/styled.ts +6 -3
- package/common/lib/utils/elements.ts +4 -4
- package/common/lib/utils/index.ts +0 -1
- package/dist/commonjs/card/lib/Card.d.ts +1 -1
- package/dist/commonjs/card/lib/CardBody.d.ts +1 -1
- package/dist/commonjs/card/lib/CardBody.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/index.d.ts +1 -1
- package/dist/commonjs/common/lib/theming/index.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/styled.d.ts +2 -0
- package/dist/commonjs/common/lib/theming/styled.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/styled.js +1 -2
- package/dist/commonjs/common/lib/utils/elements.d.ts +1 -1
- package/dist/commonjs/common/lib/utils/elements.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/elements.js +3 -3
- package/dist/commonjs/common/lib/utils/index.d.ts +0 -1
- package/dist/commonjs/common/lib/utils/index.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/index.js +0 -1
- package/dist/commonjs/dialog/lib/Dialog.d.ts +1 -1
- package/dist/commonjs/icon/lib/SystemIcon.d.ts +1 -1
- package/dist/commonjs/icon/lib/SystemIcon.d.ts.map +1 -1
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -0
- package/dist/commonjs/layout/index.d.ts +8 -4
- package/dist/commonjs/layout/index.d.ts.map +1 -1
- package/dist/commonjs/layout/index.js +10 -2
- package/dist/commonjs/layout/lib/Box.d.ts +6 -4
- package/dist/commonjs/layout/lib/Box.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Box.js +8 -9
- package/dist/commonjs/layout/lib/Flex.d.ts +5 -2
- package/dist/commonjs/layout/lib/Flex.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Flex.js +5 -1
- package/dist/commonjs/layout/lib/Grid.d.ts +5 -6
- package/dist/commonjs/layout/lib/Grid.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Grid.js +2 -2
- package/dist/commonjs/layout/lib/Stack.d.ts +4 -4
- package/dist/commonjs/layout/lib/utils/background.d.ts +44 -0
- package/dist/commonjs/layout/lib/utils/background.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/background.js +57 -0
- package/dist/commonjs/layout/lib/utils/border/color.d.ts +47 -0
- package/dist/commonjs/layout/lib/utils/border/color.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/color.js +42 -0
- package/dist/commonjs/layout/lib/utils/border/index.d.ts +26 -0
- package/dist/commonjs/layout/lib/utils/border/index.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/index.js +46 -0
- package/dist/commonjs/layout/lib/utils/border/lineStyle.d.ts +38 -0
- package/dist/commonjs/layout/lib/utils/border/lineStyle.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/lineStyle.js +52 -0
- package/dist/commonjs/layout/lib/utils/border/radius.d.ts +33 -0
- package/dist/commonjs/layout/lib/utils/border/radius.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/radius.js +32 -0
- package/dist/commonjs/layout/lib/utils/border/shorthand.d.ts +34 -0
- package/dist/commonjs/layout/lib/utils/border/shorthand.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/shorthand.js +42 -0
- package/dist/commonjs/layout/lib/utils/border/width.d.ts +34 -0
- package/dist/commonjs/layout/lib/utils/border/width.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/border/width.js +42 -0
- package/dist/commonjs/layout/lib/utils/buildStyleFns.d.ts +12 -0
- package/dist/commonjs/layout/lib/utils/buildStyleFns.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/buildStyleFns.js +90 -0
- package/dist/commonjs/layout/lib/utils/color.d.ts +23 -16
- package/dist/commonjs/layout/lib/utils/color.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/color.js +25 -49
- package/dist/commonjs/layout/lib/utils/depth.d.ts +17 -11
- package/dist/commonjs/layout/lib/utils/depth.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/depth.js +20 -20
- package/dist/commonjs/layout/lib/utils/flex.d.ts +31 -12
- package/dist/commonjs/layout/lib/utils/flex.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/flex.js +58 -25
- package/dist/commonjs/layout/lib/utils/flexItem.d.ts +18 -15
- package/dist/commonjs/layout/lib/utils/flexItem.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/flexItem.js +43 -26
- package/dist/commonjs/layout/lib/utils/grid.d.ts +40 -35
- package/dist/commonjs/layout/lib/utils/grid.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/grid.js +99 -72
- package/dist/commonjs/layout/lib/utils/gridItem.d.ts +17 -14
- package/dist/commonjs/layout/lib/utils/gridItem.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/gridItem.js +58 -30
- package/dist/commonjs/layout/lib/utils/layout.d.ts +47 -25
- package/dist/commonjs/layout/lib/utils/layout.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/layout.js +71 -33
- package/dist/commonjs/layout/lib/utils/other.d.ts +44 -2
- package/dist/commonjs/layout/lib/utils/other.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/other.js +101 -17
- package/dist/commonjs/layout/lib/utils/position.d.ts +37 -20
- package/dist/commonjs/layout/lib/utils/position.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/position.js +49 -66
- package/dist/commonjs/layout/lib/utils/space.d.ts +107 -51
- package/dist/commonjs/layout/lib/utils/space.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/space.js +98 -148
- package/dist/commonjs/layout/lib/utils/stack.d.ts +3 -6
- package/dist/commonjs/layout/lib/utils/stack.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/stack.js +13 -39
- package/dist/commonjs/layout/lib/utils/systemProps.d.ts +31 -0
- package/dist/commonjs/layout/lib/utils/systemProps.d.ts.map +1 -0
- package/dist/commonjs/layout/lib/utils/systemProps.js +2 -0
- package/dist/commonjs/layout/lib/utils/text.d.ts +33 -15
- package/dist/commonjs/layout/lib/utils/text.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/utils/text.js +74 -38
- package/dist/commonjs/modal/lib/Modal.d.ts +1 -1
- package/dist/commonjs/popup/lib/Popup.d.ts +1 -1
- package/dist/commonjs/popup/lib/PopupBody.d.ts +1 -1
- package/dist/commonjs/popup/lib/hooks/useReturnFocus.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/useReturnFocus.js +72 -7
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/commonjs/testing/index.d.ts +5 -0
- package/dist/commonjs/testing/index.d.ts.map +1 -0
- package/dist/commonjs/testing/index.js +16 -0
- package/dist/commonjs/testing/lib/ComponentStatesTable.d.ts +26 -0
- package/dist/commonjs/testing/lib/ComponentStatesTable.d.ts.map +1 -0
- package/dist/commonjs/testing/lib/ComponentStatesTable.js +48 -0
- package/dist/commonjs/testing/lib/StaticStates.d.ts +7 -0
- package/dist/commonjs/testing/lib/StaticStates.d.ts.map +1 -0
- package/dist/commonjs/{common/lib/utils → testing/lib}/StaticStates.js +1 -1
- package/dist/commonjs/testing/lib/permutateProps.d.ts +5 -0
- package/dist/commonjs/testing/lib/permutateProps.d.ts.map +1 -0
- package/dist/commonjs/testing/lib/permutateProps.js +47 -0
- package/dist/commonjs/testing/lib/propTypes.d.ts +15 -0
- package/dist/commonjs/testing/lib/propTypes.d.ts.map +1 -0
- package/dist/commonjs/testing/lib/propTypes.js +2 -0
- package/dist/commonjs/tokens/lib/colors.types.d.ts +4 -6
- package/dist/commonjs/tokens/lib/colors.types.d.ts.map +1 -1
- package/dist/es6/card/lib/Card.d.ts +1 -1
- package/dist/es6/card/lib/CardBody.d.ts +1 -1
- package/dist/es6/card/lib/CardBody.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/index.d.ts +1 -1
- package/dist/es6/common/lib/theming/index.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/styled.d.ts +2 -0
- package/dist/es6/common/lib/theming/styled.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/styled.js +1 -2
- package/dist/es6/common/lib/utils/elements.d.ts +1 -1
- package/dist/es6/common/lib/utils/elements.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/elements.js +3 -3
- package/dist/es6/common/lib/utils/index.d.ts +0 -1
- package/dist/es6/common/lib/utils/index.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/index.js +0 -1
- package/dist/es6/dialog/lib/Dialog.d.ts +1 -1
- package/dist/es6/icon/lib/SystemIcon.d.ts +1 -1
- package/dist/es6/icon/lib/SystemIcon.d.ts.map +1 -1
- package/dist/es6/index.d.ts +1 -0
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +1 -0
- package/dist/es6/layout/index.d.ts +8 -4
- package/dist/es6/layout/index.d.ts.map +1 -1
- package/dist/es6/layout/index.js +7 -1
- package/dist/es6/layout/lib/Box.d.ts +6 -4
- package/dist/es6/layout/lib/Box.d.ts.map +1 -1
- package/dist/es6/layout/lib/Box.js +8 -9
- package/dist/es6/layout/lib/Flex.d.ts +5 -2
- package/dist/es6/layout/lib/Flex.d.ts.map +1 -1
- package/dist/es6/layout/lib/Flex.js +5 -1
- package/dist/es6/layout/lib/Grid.d.ts +5 -6
- package/dist/es6/layout/lib/Grid.d.ts.map +1 -1
- package/dist/es6/layout/lib/Grid.js +2 -2
- package/dist/es6/layout/lib/Stack.d.ts +4 -4
- package/dist/es6/layout/lib/utils/background.d.ts +44 -0
- package/dist/es6/layout/lib/utils/background.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/background.js +54 -0
- package/dist/es6/layout/lib/utils/border/color.d.ts +47 -0
- package/dist/es6/layout/lib/utils/border/color.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/color.js +39 -0
- package/dist/es6/layout/lib/utils/border/index.d.ts +26 -0
- package/dist/es6/layout/lib/utils/border/index.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/index.js +43 -0
- package/dist/es6/layout/lib/utils/border/lineStyle.d.ts +38 -0
- package/dist/es6/layout/lib/utils/border/lineStyle.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/lineStyle.js +49 -0
- package/dist/es6/layout/lib/utils/border/radius.d.ts +33 -0
- package/dist/es6/layout/lib/utils/border/radius.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/radius.js +29 -0
- package/dist/es6/layout/lib/utils/border/shorthand.d.ts +34 -0
- package/dist/es6/layout/lib/utils/border/shorthand.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/shorthand.js +39 -0
- package/dist/es6/layout/lib/utils/border/width.d.ts +34 -0
- package/dist/es6/layout/lib/utils/border/width.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/border/width.js +39 -0
- package/dist/es6/layout/lib/utils/buildStyleFns.d.ts +12 -0
- package/dist/es6/layout/lib/utils/buildStyleFns.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/buildStyleFns.js +85 -0
- package/dist/es6/layout/lib/utils/color.d.ts +23 -16
- package/dist/es6/layout/lib/utils/color.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/color.js +24 -47
- package/dist/es6/layout/lib/utils/depth.d.ts +17 -11
- package/dist/es6/layout/lib/utils/depth.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/depth.js +19 -18
- package/dist/es6/layout/lib/utils/flex.d.ts +31 -12
- package/dist/es6/layout/lib/utils/flex.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/flex.js +57 -23
- package/dist/es6/layout/lib/utils/flexItem.d.ts +18 -15
- package/dist/es6/layout/lib/utils/flexItem.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/flexItem.js +42 -24
- package/dist/es6/layout/lib/utils/grid.d.ts +40 -35
- package/dist/es6/layout/lib/utils/grid.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/grid.js +98 -70
- package/dist/es6/layout/lib/utils/gridItem.d.ts +17 -14
- package/dist/es6/layout/lib/utils/gridItem.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/gridItem.js +57 -28
- package/dist/es6/layout/lib/utils/layout.d.ts +47 -25
- package/dist/es6/layout/lib/utils/layout.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/layout.js +70 -31
- package/dist/es6/layout/lib/utils/other.d.ts +44 -2
- package/dist/es6/layout/lib/utils/other.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/other.js +100 -15
- package/dist/es6/layout/lib/utils/position.d.ts +37 -20
- package/dist/es6/layout/lib/utils/position.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/position.js +48 -64
- package/dist/es6/layout/lib/utils/space.d.ts +107 -51
- package/dist/es6/layout/lib/utils/space.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/space.js +97 -146
- package/dist/es6/layout/lib/utils/stack.d.ts +3 -6
- package/dist/es6/layout/lib/utils/stack.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/stack.js +13 -39
- package/dist/es6/layout/lib/utils/systemProps.d.ts +31 -0
- package/dist/es6/layout/lib/utils/systemProps.d.ts.map +1 -0
- package/dist/es6/layout/lib/utils/systemProps.js +1 -0
- package/dist/es6/layout/lib/utils/text.d.ts +33 -15
- package/dist/es6/layout/lib/utils/text.d.ts.map +1 -1
- package/dist/es6/layout/lib/utils/text.js +73 -36
- package/dist/es6/modal/lib/Modal.d.ts +1 -1
- package/dist/es6/popup/lib/Popup.d.ts +1 -1
- package/dist/es6/popup/lib/PopupBody.d.ts +1 -1
- package/dist/es6/popup/lib/hooks/useReturnFocus.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/useReturnFocus.js +73 -8
- package/dist/es6/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/es6/testing/index.d.ts +5 -0
- package/dist/es6/testing/index.d.ts.map +1 -0
- package/dist/es6/testing/index.js +4 -0
- package/dist/es6/testing/lib/ComponentStatesTable.d.ts +26 -0
- package/dist/es6/testing/lib/ComponentStatesTable.d.ts.map +1 -0
- package/dist/es6/testing/lib/ComponentStatesTable.js +41 -0
- package/dist/es6/testing/lib/StaticStates.d.ts +7 -0
- package/dist/es6/testing/lib/StaticStates.d.ts.map +1 -0
- package/dist/es6/{common/lib/utils → testing/lib}/StaticStates.js +1 -1
- package/dist/es6/testing/lib/permutateProps.d.ts +5 -0
- package/dist/es6/testing/lib/permutateProps.d.ts.map +1 -0
- package/dist/es6/testing/lib/permutateProps.js +43 -0
- package/dist/es6/testing/lib/propTypes.d.ts +15 -0
- package/dist/es6/testing/lib/propTypes.d.ts.map +1 -0
- package/dist/es6/testing/lib/propTypes.js +1 -0
- package/dist/es6/tokens/lib/colors.types.d.ts +4 -6
- package/dist/es6/tokens/lib/colors.types.d.ts.map +1 -1
- package/icon/lib/SystemIcon.tsx +1 -1
- package/index.ts +1 -0
- package/layout/index.ts +8 -4
- package/layout/lib/Box.tsx +10 -36
- package/layout/lib/Flex.tsx +5 -1
- package/layout/lib/Grid.tsx +3 -4
- package/layout/lib/utils/background.ts +83 -0
- package/layout/lib/utils/border/color.ts +85 -0
- package/layout/lib/utils/border/index.ts +49 -0
- package/layout/lib/utils/border/lineStyle.ts +87 -0
- package/layout/lib/utils/border/radius.ts +61 -0
- package/layout/lib/utils/border/shorthand.ts +73 -0
- package/layout/lib/utils/border/width.ts +73 -0
- package/layout/lib/utils/buildStyleFns.ts +117 -0
- package/layout/lib/utils/color.ts +40 -55
- package/layout/lib/utils/depth.ts +28 -24
- package/layout/lib/utils/flex.ts +83 -32
- package/layout/lib/utils/flexItem.ts +54 -36
- package/layout/lib/utils/grid.ts +131 -94
- package/layout/lib/utils/gridItem.ts +69 -41
- package/layout/lib/utils/layout.ts +109 -50
- package/layout/lib/utils/other.ts +142 -15
- package/layout/lib/utils/position.ts +79 -73
- package/layout/lib/utils/space.ts +202 -196
- package/layout/lib/utils/stack.ts +19 -45
- package/layout/lib/utils/systemProps.ts +46 -0
- package/layout/lib/utils/text.ts +99 -34
- package/package.json +3 -3
- package/popup/lib/hooks/useReturnFocus.tsx +83 -9
- package/testing/LICENSE +52 -0
- package/testing/README.md +6 -0
- package/testing/index.ts +4 -0
- package/testing/lib/ComponentStatesTable.tsx +80 -0
- package/{common/lib/utils → testing/lib}/StaticStates.tsx +5 -4
- package/testing/lib/permutateProps.ts +47 -0
- package/testing/lib/propTypes.ts +15 -0
- package/testing/package.json +6 -0
- package/tokens/lib/colors.types.ts +4 -7
- package/dist/commonjs/common/lib/utils/StaticStates.d.ts +0 -8
- package/dist/commonjs/common/lib/utils/StaticStates.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/border.d.ts +0 -103
- package/dist/commonjs/layout/lib/utils/border.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/border.js +0 -153
- package/dist/commonjs/layout/lib/utils/font.d.ts +0 -29
- package/dist/commonjs/layout/lib/utils/font.d.ts.map +0 -1
- package/dist/commonjs/layout/lib/utils/font.js +0 -57
- package/dist/es6/common/lib/utils/StaticStates.d.ts +0 -8
- package/dist/es6/common/lib/utils/StaticStates.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/border.d.ts +0 -103
- package/dist/es6/layout/lib/utils/border.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/border.js +0 -149
- package/dist/es6/layout/lib/utils/font.d.ts +0 -29
- package/dist/es6/layout/lib/utils/font.d.ts.map +0 -1
- package/dist/es6/layout/lib/utils/font.js +0 -53
- package/layout/lib/utils/border.ts +0 -263
- package/layout/lib/utils/font.ts +0 -67
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAkC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE/C,sDAAsD;AACtD,oBAAY,cAAc,GAAG;IAC3B;;iCAE6B;IAC7B,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC5D;;qCAEiC;IACjC,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC5D,kGAAkG;IAClG,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC/B;;uCAEmC;IACnC,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAClE,oGAAoG;IACpG,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,0GAA0G;IAC1G,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IACvC,kGAAkG;IAClG,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC/B,4GAA4G;IAC5G,cAAc,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC;IACzC,wGAAwG;IACxG,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrC,0GAA0G;IAC1G,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IACvC,oGAAoG;IACpG,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,oGAAoG;IACpG,UAAU,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IACjC,kGAAkG;IAClG,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,aAAa,EAkE7C,CAAC;AAEF,eAAO,MAAM,YAAY,oCAAoC,CAAC;AAC9D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,+BAAiD,CAAC"}
|
|
@@ -1,44 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { buildStyleFns, buildStylePropFn } from './buildStyleFns';
|
|
2
|
+
export var textStyleFnConfigs = [
|
|
3
|
+
{
|
|
4
|
+
name: 'fontFamily',
|
|
5
|
+
properties: ['fontFamily'],
|
|
6
|
+
system: 'font',
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: 'fontSize',
|
|
10
|
+
properties: ['fontSize'],
|
|
11
|
+
system: 'fontSize',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'fontStyle',
|
|
15
|
+
properties: ['fontStyle'],
|
|
16
|
+
system: 'none',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'fontWeight',
|
|
20
|
+
properties: ['fontWeight'],
|
|
21
|
+
system: 'fontWeight',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'lineHeight',
|
|
25
|
+
properties: ['lineHeight'],
|
|
26
|
+
system: 'none',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'letterSpacing',
|
|
30
|
+
properties: ['letterSpacing'],
|
|
31
|
+
system: 'none',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'textAlign',
|
|
35
|
+
properties: ['textAlign'],
|
|
36
|
+
system: 'none',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'textDecoration',
|
|
40
|
+
properties: ['textDecoration'],
|
|
41
|
+
system: 'none',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'textOverflow',
|
|
45
|
+
properties: ['textOverflow'],
|
|
46
|
+
system: 'none',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'textTransform',
|
|
50
|
+
properties: ['textTransform'],
|
|
51
|
+
system: 'none',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'textShadow',
|
|
55
|
+
properties: ['textShadow'],
|
|
56
|
+
system: 'none',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'whiteSpace',
|
|
60
|
+
properties: ['whiteSpace'],
|
|
61
|
+
system: 'none',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'wordBreak',
|
|
65
|
+
properties: ['wordBreak'],
|
|
66
|
+
system: 'none',
|
|
67
|
+
},
|
|
22
68
|
];
|
|
69
|
+
export var textStyleFns = buildStyleFns(textStyleFnConfigs);
|
|
23
70
|
/**
|
|
24
|
-
* A style prop function that takes
|
|
71
|
+
* A style prop function that takes component props and returns font and text styles.
|
|
25
72
|
* If no `TextStyleProps` are found, it returns an empty object.
|
|
26
73
|
*
|
|
27
74
|
* @example
|
|
28
|
-
*
|
|
75
|
+
* ```
|
|
29
76
|
* const BoxExample = () => (
|
|
30
|
-
* <Box textAlign="center">Hello, alignment!</Box>
|
|
77
|
+
* <Box textAlign="center" fontWeight="medium">Hello, alignment!</Box>
|
|
31
78
|
* );
|
|
32
|
-
*
|
|
79
|
+
* ```
|
|
33
80
|
*/
|
|
34
|
-
export
|
|
35
|
-
var _a;
|
|
36
|
-
var styles = {};
|
|
37
|
-
for (var key in props) {
|
|
38
|
-
if (textProps.includes(key)) {
|
|
39
|
-
var value = props[key];
|
|
40
|
-
styles = __assign(__assign({}, styles), (_a = {}, _a[key] = value, _a));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return styles;
|
|
44
|
-
}
|
|
81
|
+
export var text = buildStylePropFn(textStyleFns);
|
|
@@ -99,7 +99,7 @@ export declare const Modal: import("../../common").ComponentM<import("../../dial
|
|
|
99
99
|
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
100
100
|
};
|
|
101
101
|
}> & {
|
|
102
|
-
Body: import("../../common").ElementComponentM<"div", import("../..").
|
|
102
|
+
Body: import("../../common").ElementComponentM<"div", import("../..").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").GridItemStyleProps & import("../..").LayoutStyleProps & import("../..").OtherStyleProps & import("../..").PositionStyleProps & import("../..").SpaceStyleProps & import("../..").TextStyleProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
103
103
|
state: {
|
|
104
104
|
stackRef: React.RefObject<HTMLDivElement>;
|
|
105
105
|
targetRef: React.RefObject<HTMLButtonElement>;
|
|
@@ -106,7 +106,7 @@ export declare const Popup: import("../../common").ComponentM<PopupProps & Parti
|
|
|
106
106
|
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
107
107
|
};
|
|
108
108
|
}>;
|
|
109
|
-
Body: import("../../common").ElementComponentM<"div", import("../..").
|
|
109
|
+
Body: import("../../common").ElementComponentM<"div", import("../..").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").GridItemStyleProps & import("../..").LayoutStyleProps & import("../..").OtherStyleProps & import("../..").PositionStyleProps & import("../..").SpaceStyleProps & import("../..").TextStyleProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
110
110
|
state: {
|
|
111
111
|
stackRef: React.RefObject<HTMLDivElement>;
|
|
112
112
|
targetRef: React.RefObject<HTMLButtonElement>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const PopupBody: import("../../common").ElementComponentM<"div", import("../..").
|
|
2
|
+
export declare const PopupBody: import("../../common").ElementComponentM<"div", import("../..").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").GridItemStyleProps & import("../..").LayoutStyleProps & import("../..").OtherStyleProps & import("../..").PositionStyleProps & import("../..").SpaceStyleProps & import("../..").TextStyleProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
3
3
|
state: {
|
|
4
4
|
stackRef: React.RefObject<HTMLDivElement>;
|
|
5
5
|
targetRef: React.RefObject<HTMLButtonElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReturnFocus.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useReturnFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useReturnFocus.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useReturnFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAiC1B;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;OAgGzB,CAAC"}
|
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { changeFocus, createElemPropsHook } from '@workday/canvas-kit-react/common';
|
|
2
|
+
import { changeFocus, createElemPropsHook, isFocusable } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { usePopupModel } from './usePopupModel';
|
|
4
|
+
import { PopupStack } from '@workday/canvas-kit-popup-stack';
|
|
5
|
+
function getScrollParent(element) {
|
|
6
|
+
if (element === document.body || !element.parentElement) {
|
|
7
|
+
return element;
|
|
8
|
+
}
|
|
9
|
+
var styles = getComputedStyle(element);
|
|
10
|
+
if (styles.overflowY === 'scroll' || styles.overflowY === 'auto') {
|
|
11
|
+
return element;
|
|
12
|
+
}
|
|
13
|
+
return getScrollParent(element.parentElement);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get a focusable element in an element's tree
|
|
17
|
+
*/
|
|
18
|
+
function getFocusableElement(element) {
|
|
19
|
+
if (element === null || element === document.body || !element.parentElement) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
else if (isFocusable(element)) {
|
|
23
|
+
return element;
|
|
24
|
+
}
|
|
25
|
+
return getFocusableElement(element.parentElement);
|
|
26
|
+
}
|
|
4
27
|
/**
|
|
5
28
|
* Returns focus to the target element when the popup is hidden. This works well with
|
|
6
29
|
* `useInitialFocus`. This should be used with `useFocusRedirect` or `useFocusTrap` for a complete
|
|
@@ -10,6 +33,7 @@ import { usePopupModel } from './usePopupModel';
|
|
|
10
33
|
*/
|
|
11
34
|
export var useReturnFocus = createElemPropsHook(usePopupModel)(function (model) {
|
|
12
35
|
var visible = model.state.visibility !== 'hidden';
|
|
36
|
+
var elementRef = React.useRef(null);
|
|
13
37
|
// This boolean tracks keyboard-driven focus changes. This is required for `useFocusRedirect` as
|
|
14
38
|
// focus redirection needs synchronous focus management and everything else needs asynchronous
|
|
15
39
|
// focus management.
|
|
@@ -20,20 +44,60 @@ export var useReturnFocus = createElemPropsHook(usePopupModel)(function (model)
|
|
|
20
44
|
requiresFocusChangeRef.current = true;
|
|
21
45
|
}
|
|
22
46
|
}, []);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
47
|
+
// track mousedown events to determine if the mouse target is a focusable element. If it is, we
|
|
48
|
+
// should not return focus
|
|
49
|
+
var onMouseDown = React.useCallback(function (event) {
|
|
50
|
+
if (model.state.stackRef.current && event.target instanceof HTMLElement) {
|
|
51
|
+
if (!PopupStack.contains(model.state.stackRef.current, event.target)) {
|
|
52
|
+
elementRef.current = event.target;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}, [model.state.stackRef]);
|
|
56
|
+
// We use `useLayoutEffect` because the callback will be called _before_ the browser changes
|
|
57
|
+
// focus. This allows the browser to change focus as normal. For example, if the popup closes
|
|
58
|
+
// because the user hits the tab key when focused on the last focusable element,
|
|
59
|
+
// `useFocusRedirect` will cause the popup to close before the browser is finished processing the
|
|
60
|
+
// `keydown`. The browser's default action of a keydown of a tab key is to advance focus to the
|
|
61
|
+
// next focusable element. This means that the `useFocusRedirect` will change focus back to the
|
|
62
|
+
// target, then the tab key is processed by the browser to focus on the next item after the target
|
|
63
|
+
// without us having to use a focus manager to guess what the next focusable element is.
|
|
64
|
+
//
|
|
65
|
+
// But because we're using `useLayoutEffect` instead of `useEffect`, we cannot use
|
|
66
|
+
// `document.activeElement` (because the focus hasn't changed yet because the browser hasn't
|
|
67
|
+
// triggered a default action yet) to determine if a user clicked on something that can accept
|
|
68
|
+
// focus itself. If we don't short-circuit return focus, the user will intend to click on an
|
|
69
|
+
// `input` element only to get focus changed back. This is annoying to users and unintuitive. Instead,
|
|
70
|
+
// we'll use `mousedown` and `mouseup` to determine if we're closing because of a mouse click.
|
|
26
71
|
React.useLayoutEffect(function () {
|
|
27
72
|
if (!visible) {
|
|
28
73
|
return;
|
|
29
74
|
}
|
|
30
75
|
// capture the element here. The refs will be null by the time the cleanup function is called
|
|
31
|
-
var element = (model.state.returnFocusRef || model.state.targetRef)
|
|
76
|
+
var element = (model.state.returnFocusRef || model.state.targetRef)
|
|
77
|
+
.current;
|
|
78
|
+
document.addEventListener('mousedown', onMouseDown, true);
|
|
32
79
|
document.addEventListener('keydown', onKeyDown, true);
|
|
33
|
-
document.addEventListener('keyup', onKeyUp, true);
|
|
34
80
|
return function () {
|
|
81
|
+
document.removeEventListener('mousedown', onMouseDown, true);
|
|
35
82
|
document.removeEventListener('keydown', onKeyDown, true);
|
|
36
|
-
|
|
83
|
+
if (!element) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
var scrollParent = getScrollParent(element);
|
|
87
|
+
var scrollParentRect = scrollParent.getBoundingClientRect();
|
|
88
|
+
var elementRect = element.getBoundingClientRect();
|
|
89
|
+
// Don't change focus if user focused on a different element like a `input` or the target
|
|
90
|
+
// element isn't on at least halfway rendered on the screen.
|
|
91
|
+
if ((elementRef.current && getFocusableElement(elementRef.current)) || // did the user click on a focusable element?
|
|
92
|
+
elementRect.top + elementRect.height / 2 < scrollParentRect.top || // is the top half of the target element visible?
|
|
93
|
+
elementRect.bottom - elementRect.height / 2 > scrollParentRect.bottom || // is the bottom half of the target element visible?
|
|
94
|
+
elementRect.left + elementRect.width / 2 < scrollParentRect.left || // is the left half of the target element visible?
|
|
95
|
+
elementRect.right - elementRect.width / 2 > scrollParentRect.right // is the right half of the target element visible?
|
|
96
|
+
) {
|
|
97
|
+
// reset the focus element and bail early
|
|
98
|
+
elementRef.current = null;
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
37
101
|
if (requiresFocusChangeRef.current) {
|
|
38
102
|
// We need to change focus _before_ the browser process the default action of picking a new
|
|
39
103
|
// focus target. Doing this immediately prevents the `focus` event from firing on `element`,
|
|
@@ -47,7 +111,8 @@ export var useReturnFocus = createElemPropsHook(usePopupModel)(function (model)
|
|
|
47
111
|
changeFocus(element);
|
|
48
112
|
});
|
|
49
113
|
}
|
|
114
|
+
elementRef.current = null;
|
|
50
115
|
};
|
|
51
|
-
}, [model.state.returnFocusRef, model.state.targetRef, visible,
|
|
116
|
+
}, [model.state.returnFocusRef, model.state.targetRef, visible, onMouseDown, onKeyDown]);
|
|
52
117
|
return {};
|
|
53
118
|
});
|
|
@@ -53,7 +53,7 @@ export interface TabsItemProps extends ExtractProps<typeof Box, never>, Partial<
|
|
|
53
53
|
*/
|
|
54
54
|
tabIndex?: number;
|
|
55
55
|
}
|
|
56
|
-
export declare const StyledTabItem: import("@emotion/styled").StyledComponent<import("../../layout").
|
|
56
|
+
export declare const StyledTabItem: import("@emotion/styled").StyledComponent<import("../../layout").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("../../layout").ColorStyleProps & import("../../layout").DepthStyleProps & import("../../layout").FlexItemStyleProps & import("../../layout").GridItemStyleProps & import("../../layout").LayoutStyleProps & import("../../layout").OtherStyleProps & import("../../layout").PositionStyleProps & import("../../layout").SpaceStyleProps & import("../../layout").TextStyleProps & Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "name" | "style" | "ref" | "form" | "slot" | "title" | "dir" | "value" | "children" | "hidden" | "disabled" | "type" | "translate" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & {
|
|
57
57
|
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
58
58
|
} & {
|
|
59
59
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../testing/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PropCombination, Props } from './propTypes';
|
|
3
|
+
/**
|
|
4
|
+
* A helper to generate a table of all possible states for component visual testing.
|
|
5
|
+
*/
|
|
6
|
+
export interface ComponentStatesTableProps {
|
|
7
|
+
/**
|
|
8
|
+
* The props that will be passed to the component when it is rendered and the corresponding
|
|
9
|
+
* row label for that permutation. It is encouraged to use the result of permutateProps()
|
|
10
|
+
* rather than passing in a list so we don't miss any combinations.
|
|
11
|
+
*/
|
|
12
|
+
rowProps: PropCombination[];
|
|
13
|
+
/**
|
|
14
|
+
* The props that will be passed to the component when it is rendered and the corresponding
|
|
15
|
+
* column label for that permutation. It is encouraged to use the result of permutateProps()
|
|
16
|
+
* rather than passing in a list so we don't miss any combinations.
|
|
17
|
+
*/
|
|
18
|
+
columnProps: PropCombination[];
|
|
19
|
+
/**
|
|
20
|
+
* The render function called to render the component in each cell of the table. This gives you
|
|
21
|
+
* the ability to add extra styling or markup (a blue background for an inverse variant, for example).
|
|
22
|
+
*/
|
|
23
|
+
children(props: Props): React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare const ComponentStatesTable: ({ rowProps, columnProps, children, }: ComponentStatesTableProps) => JSX.Element;
|
|
26
|
+
//# sourceMappingURL=ComponentStatesTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentStatesTable.d.ts","sourceRoot":"","sources":["../../../../testing/lib/ComponentStatesTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,eAAe,EAAE,KAAK,EAAC,MAAM,aAAa,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B;;;;OAIG;IACH,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC;CACzC;AAgBD,eAAO,MAAM,oBAAoB,yCAI9B,yBAAyB,gBAkC3B,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { styled } from '@workday/canvas-kit-react/common';
|
|
14
|
+
var Table = styled('table')({
|
|
15
|
+
width: '100%',
|
|
16
|
+
thead: {
|
|
17
|
+
textAlign: 'left',
|
|
18
|
+
paddingBottom: 16,
|
|
19
|
+
},
|
|
20
|
+
'td, th': {
|
|
21
|
+
minWidth: 100,
|
|
22
|
+
paddingBottom: 16,
|
|
23
|
+
paddingRight: 16,
|
|
24
|
+
textAlign: 'left',
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
export var ComponentStatesTable = function (_a) {
|
|
28
|
+
var rowProps = _a.rowProps, columnProps = _a.columnProps, children = _a.children;
|
|
29
|
+
return (React.createElement(Table, null,
|
|
30
|
+
React.createElement("thead", null,
|
|
31
|
+
React.createElement("tr", null,
|
|
32
|
+
React.createElement("th", null, "Variants"),
|
|
33
|
+
columnProps.map(function (col) { return (React.createElement("th", { key: "component-table-heading-" + col.label.toLowerCase().replace(' ', ',') }, col.label)); }))),
|
|
34
|
+
React.createElement("tbody", null, rowProps.map(function (row) {
|
|
35
|
+
return (React.createElement("tr", { key: row.label.toLowerCase().replace(' ', '-') },
|
|
36
|
+
React.createElement("td", null, row.label),
|
|
37
|
+
columnProps.map(function (col) {
|
|
38
|
+
return (React.createElement("td", { key: col.label.toLowerCase().replace(' ', '-') }, children(__assign(__assign({}, row.props), col.props))));
|
|
39
|
+
})));
|
|
40
|
+
}))));
|
|
41
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PartialEmotionCanvasTheme, StyleRewriteFn } from '@workday/canvas-kit-react/common';
|
|
3
|
+
export declare const convertToStaticStates: StyleRewriteFn;
|
|
4
|
+
export declare const StaticStates: React.FC<React.PropsWithChildren<{
|
|
5
|
+
theme?: PartialEmotionCanvasTheme;
|
|
6
|
+
} & React.HTMLAttributes<HTMLElement>>>;
|
|
7
|
+
//# sourceMappingURL=StaticStates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StaticStates.d.ts","sourceRoot":"","sources":["../../../../testing/lib/StaticStates.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,yBAAyB,EACzB,cAAc,EACf,MAAM,kCAAkC,CAAC;AAG1C,eAAO,MAAM,qBAAqB,EAAE,cAoBnC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CACzD;IAAC,KAAK,CAAC,EAAE,yBAAyB,CAAA;CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CACxE,CASA,CAAC"}
|
|
@@ -44,6 +44,6 @@ export var convertToStaticStates = function (obj) {
|
|
|
44
44
|
export var StaticStates = function (_a) {
|
|
45
45
|
var children = _a.children, theme = _a.theme, elemProps = __rest(_a, ["children", "theme"]);
|
|
46
46
|
var localTheme = useTheme(theme);
|
|
47
|
-
localTheme.
|
|
47
|
+
localTheme._styleRewriteFn = convertToStaticStates;
|
|
48
48
|
return (React.createElement(CanvasProvider, __assign({ theme: localTheme }, elemProps), children));
|
|
49
49
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PropCombination, PropDeclaration, Props, PropsDeclaration } from './propTypes';
|
|
2
|
+
export declare const permutateProps: (allProps: PropsDeclaration, filter?: ((props: Props) => boolean) | undefined, remainingProps?: string[], values?: {
|
|
3
|
+
[key: string]: PropDeclaration;
|
|
4
|
+
}) => PropCombination[];
|
|
5
|
+
//# sourceMappingURL=permutateProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permutateProps.d.ts","sourceRoot":"","sources":["../../../../testing/lib/permutateProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAEtF,eAAO,MAAM,cAAc,aACf,gBAAgB,oBACT,KAAK,KAAK,OAAO,gCAClB,MAAM,EAAE;;MAEvB,eAAe,EAuCjB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
export var permutateProps = function (allProps, filter, remainingProps, values) {
|
|
13
|
+
if (remainingProps === void 0) { remainingProps = Object.keys(allProps); }
|
|
14
|
+
if (values === void 0) { values = {}; }
|
|
15
|
+
// When there are no more props to combine with, return result
|
|
16
|
+
var prop = remainingProps[0];
|
|
17
|
+
if (!prop) {
|
|
18
|
+
var props_1 = {};
|
|
19
|
+
Object.keys(values).forEach(function (prop) {
|
|
20
|
+
var _a;
|
|
21
|
+
props_1[prop] = (_a = values === null || values === void 0 ? void 0 : values[prop]) === null || _a === void 0 ? void 0 : _a.value;
|
|
22
|
+
});
|
|
23
|
+
if (filter && !filter(props_1)) {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
var label = Object.keys(values)
|
|
27
|
+
.map(function (prop) { var _a; return (_a = values === null || values === void 0 ? void 0 : values[prop]) === null || _a === void 0 ? void 0 : _a.label; })
|
|
28
|
+
.join(' ');
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
label: label,
|
|
32
|
+
props: props_1,
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
var possiblePropValues = allProps[prop];
|
|
37
|
+
var permutations = possiblePropValues === null || possiblePropValues === void 0 ? void 0 : possiblePropValues.map(function (value) {
|
|
38
|
+
var newValues = __assign({}, values); // Required so we don't overwrite previous references
|
|
39
|
+
newValues[prop] = value;
|
|
40
|
+
return permutateProps(allProps, filter, remainingProps.slice(1, remainingProps.length), newValues);
|
|
41
|
+
});
|
|
42
|
+
return permutations.flat();
|
|
43
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare type PropDeclaration = {
|
|
2
|
+
value: any;
|
|
3
|
+
label: string;
|
|
4
|
+
};
|
|
5
|
+
export declare type PropsDeclaration = {
|
|
6
|
+
[key: string]: PropDeclaration[];
|
|
7
|
+
};
|
|
8
|
+
export declare type Props = {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
export declare type PropCombination = {
|
|
12
|
+
label: string;
|
|
13
|
+
props: Props;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=propTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propTypes.d.ts","sourceRoot":"","sources":["../../../../testing/lib/propTypes.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe,GAAG;IAC5B,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,EAAE,CAAA;CAAC,CAAC;AAElE,oBAAY,KAAK,GAAG;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -25,11 +25,9 @@ export declare enum BrandingColor {
|
|
|
25
25
|
Licorice = "licorice",
|
|
26
26
|
BlackPepper = "blackPepper"
|
|
27
27
|
}
|
|
28
|
-
declare type
|
|
29
|
-
[K in keyof T
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
} ? U : never;
|
|
33
|
-
export declare type CanvasColor = KnownKeys<typeof colors>;
|
|
28
|
+
declare type RemoveIndex<T> = {
|
|
29
|
+
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
|
|
30
|
+
};
|
|
31
|
+
export declare type CanvasColor = keyof RemoveIndex<typeof colors>;
|
|
34
32
|
export {};
|
|
35
33
|
//# sourceMappingURL=colors.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.types.d.ts","sourceRoot":"","sources":["../../../../tokens/lib/colors.types.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAEhD,oBAAY,aAAa;IACvB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,aAAa,kBAAkB;IAC/B,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,kBAAkB,uBAAuB;IACzC,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;CAC5B;
|
|
1
|
+
{"version":3,"file":"colors.types.d.ts","sourceRoot":"","sources":["../../../../tokens/lib/colors.types.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAEhD,oBAAY,aAAa;IACvB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,aAAa,kBAAkB;IAC/B,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,kBAAkB,uBAAuB;IACzC,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;CAC5B;AAED,aAAK,WAAW,CAAC,CAAC,IAAI;KAClB,CAAC,IAAI,MAAM,CAAC,IAAI,MAAM,SAAS,CAAC,GAAG,KAAK,GAAG,MAAM,SAAS,CAAC,GAAG,KAAK,GAAG,CAAC,GAAK,CAAC,CAAC,CAAC,CAAC;CACnF,CAAC;AAEF,oBAAY,WAAW,GAAG,MAAM,WAAW,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
package/icon/lib/SystemIcon.tsx
CHANGED
|
@@ -46,7 +46,7 @@ export interface SystemIconStyles {
|
|
|
46
46
|
|
|
47
47
|
export interface SystemIconProps
|
|
48
48
|
extends SystemIconStyles,
|
|
49
|
-
Omit<IconProps, 'src' | 'color' | 'type' | 'background'> {
|
|
49
|
+
Omit<IconProps, 'src' | 'color' | 'fill' | 'type' | 'background'> {
|
|
50
50
|
/**
|
|
51
51
|
* The icon to display from `@workday/canvas-system-icons-web`.
|
|
52
52
|
*/
|
package/index.ts
CHANGED
package/layout/index.ts
CHANGED
|
@@ -3,19 +3,23 @@ import {DeprecatedColumn} from './lib/Column';
|
|
|
3
3
|
|
|
4
4
|
export { DeprecatedLayout, DeprecatedColumn};
|
|
5
5
|
export * from './lib/Box';
|
|
6
|
+
export * from './lib/utils/background';
|
|
6
7
|
export * from './lib/utils/border';
|
|
7
8
|
export * from './lib/utils/color';
|
|
8
|
-
export {DepthStyleProps} from './lib/utils/depth';
|
|
9
|
+
export {DepthStyleProps, depthStyleFnConfigs} from './lib/utils/depth';
|
|
10
|
+
export * from './lib/utils/flex';
|
|
9
11
|
export * from './lib/utils/flexItem';
|
|
10
|
-
export * from './lib/utils/
|
|
12
|
+
export * from './lib/utils/grid';
|
|
13
|
+
export * from './lib/utils/gridItem';
|
|
11
14
|
export * from './lib/utils/layout';
|
|
15
|
+
export * from './lib/utils/other';
|
|
12
16
|
export * from './lib/utils/position';
|
|
13
|
-
export {SpaceStyleProps} from './lib/utils/space';
|
|
17
|
+
export {SpaceStyleProps, spaceStyleFnConfigs} from './lib/utils/space';
|
|
14
18
|
export * from './lib/utils/text';
|
|
15
19
|
export * from './lib/Flex';
|
|
16
20
|
export * from './lib/Grid';
|
|
17
21
|
export * from './lib/Stack';
|
|
18
22
|
export type { FlexStyleProps } from './lib/utils/flex';
|
|
19
23
|
export type { GridStyleProps } from './lib/utils/grid';
|
|
20
|
-
export type { GridItemStyleProps } from './lib/utils/gridItem';
|
|
24
|
+
export type { GridItemStyleProps, gridItemStyleFnConfigs } from './lib/utils/gridItem';
|
|
21
25
|
export type { StackSpacing, StackDirection, StackStyleProps } from './lib/utils/stack';
|