@kubed/components 0.0.36 → 0.0.39

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/cjs/Badge/Badge.js +1 -1
  3. package/cjs/Badge/Badge.js.map +1 -1
  4. package/cjs/Button/Button.styles.js +11 -13
  5. package/cjs/Button/Button.styles.js.map +1 -1
  6. package/cjs/Checkbox/CheckboxGroup.js +1 -1
  7. package/cjs/Checkbox/CheckboxGroup.js.map +1 -1
  8. package/cjs/Descriptions/Descriptions.js +1 -1
  9. package/cjs/Descriptions/Descriptions.js.map +1 -1
  10. package/cjs/ShowMore/ShowMore.js +11 -0
  11. package/cjs/ShowMore/ShowMore.js.map +1 -0
  12. package/cjs/Tabs/Tabs.js +1 -1
  13. package/cjs/Tabs/Tabs.js.map +1 -1
  14. package/cjs/Tabs/Tabs.styles.js +12 -12
  15. package/cjs/Tabs/Tabs.styles.js.map +1 -1
  16. package/cjs/Tag/Tag.js +13 -4
  17. package/cjs/Tag/Tag.js.map +1 -1
  18. package/cjs/TypeSelect/TypeSelect.styles.js +12 -10
  19. package/cjs/TypeSelect/TypeSelect.styles.js.map +1 -1
  20. package/cjs/index.js +1 -1
  21. package/cjs/index.js.map +1 -1
  22. package/esm/Badge/Badge.js +1 -1
  23. package/esm/Badge/Badge.js.map +1 -1
  24. package/esm/Button/Button.styles.js +40 -42
  25. package/esm/Button/Button.styles.js.map +1 -1
  26. package/esm/Checkbox/CheckboxGroup.js +1 -1
  27. package/esm/Checkbox/CheckboxGroup.js.map +1 -1
  28. package/esm/Descriptions/Descriptions.js +1 -1
  29. package/esm/Descriptions/Descriptions.js.map +1 -1
  30. package/esm/ShowMore/ShowMore.js +11 -0
  31. package/esm/ShowMore/ShowMore.js.map +1 -0
  32. package/esm/Tabs/Tabs.js +1 -1
  33. package/esm/Tabs/Tabs.js.map +1 -1
  34. package/esm/Tabs/Tabs.styles.js +30 -30
  35. package/esm/Tabs/Tabs.styles.js.map +1 -1
  36. package/esm/Tag/Tag.js +18 -9
  37. package/esm/Tag/Tag.js.map +1 -1
  38. package/esm/TypeSelect/TypeSelect.styles.js +2 -0
  39. package/esm/TypeSelect/TypeSelect.styles.js.map +1 -1
  40. package/esm/index.js +1 -1
  41. package/esm/index.js.map +1 -1
  42. package/lib/src/Checkbox/CheckboxGroup.d.ts +1 -0
  43. package/lib/src/Checkbox/CheckboxGroup.d.ts.map +1 -1
  44. package/lib/src/Descriptions/Descriptions.d.ts.map +1 -1
  45. package/lib/src/ShowMore/ShowMore.d.ts +18 -0
  46. package/lib/src/ShowMore/ShowMore.d.ts.map +1 -0
  47. package/lib/src/Tabs/Tabs.d.ts.map +1 -1
  48. package/lib/src/Tabs/Tabs.styles.d.ts +1 -1
  49. package/lib/src/Tabs/Tabs.styles.d.ts.map +1 -1
  50. package/lib/src/Tag/Tag.d.ts +8 -1
  51. package/lib/src/Tag/Tag.d.ts.map +1 -1
  52. package/lib/src/TypeSelect/TypeSelect.styles.d.ts.map +1 -1
  53. package/lib/src/index.d.ts +1 -0
  54. package/lib/src/index.d.ts.map +1 -1
  55. package/lib/tsconfig.tsbuildinfo +1 -1
  56. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.js","sources":["../../src/Tag/Tag.tsx"],"sourcesContent":["import React from 'react';\nimport styled, { css } from 'styled-components';\nimport forwardRef from '../utils/forwardRef';\nimport { DefaultProps, KubedTheme, themeUtils } from '../theme';\n\nconst colorMap = {\n default: {\n color: 'background',\n background: 'accents_8',\n },\n primary: {\n color: 'green4',\n background: 'green0',\n },\n success: {\n color: 'green4',\n background: 'green0',\n },\n secondary: {\n color: 'accents_7',\n background: 'accents_2',\n },\n warning: {\n color: 'yellow4',\n background: 'yellow0',\n },\n error: {\n color: 'red4',\n background: 'red0',\n },\n info: {\n color: 'blue4',\n background: 'blue0',\n },\n};\n\nconst getColor = (color = 'default', theme: KubedTheme) => {\n const colorValue = themeUtils.getColor(colorMap[color].color, theme);\n const background = themeUtils.getColor(colorMap[color].background, theme);\n\n return css`\n background-color: ${background};\n color: ${colorValue};\n `;\n};\n\nconst TagWrapper = styled('div')<TagProps>`\n display: inline-flex;\n align-items: center;\n padding: ${({ title }) => (title ? '0 6px 0 2px' : '0 4px')};\n line-height: 20px;\n border-radius: ${({ title }) => (title ? '3px' : '2px')};\n word-break: break-all;\n white-space: normal;\n font-weight: 600;\n ${({ color, theme }) => getColor(color, theme)};\n`;\n\nconst TagTitle = styled('span')`\n display: inline-flex;\n padding: 0 6px;\n margin: 2px 6px 2px 0;\n line-height: 16px;\n color: ${({ theme }) => theme.palette.background};\n background-color: ${({ theme }) => theme.palette.accents_7};\n border-radius: 1px;\n font-weight: 500;\n`;\n\nexport interface TagProps extends DefaultProps {\n /** Title of the tag */\n title?: React.ReactNode;\n\n /** Style of title */\n titleStyle?: React.CSSProperties;\n\n /** Tag color from theme */\n color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info' | string;\n\n /** Append element of the tag */\n append?: React.ReactNode;\n}\n\nexport const Tag = forwardRef<TagProps, 'div'>(\n ({ title, titleStyle, color, children, append, ...rest }, ref) => {\n return (\n <TagWrapper ref={ref} title={title} color={color} {...rest}>\n {title && <TagTitle style={titleStyle}>{title}</TagTitle>}\n {children}\n {append}\n </TagWrapper>\n );\n }\n);\n\nTag.displayName = '@kubed/components/Tag';\n"],"names":["themeUtils","css","styled","forwardRef","React"],"mappings":";;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,G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,IAAI,KAAK;AACT,IAAI,KAAK;AACT,GAAG,EAAE,IAAI,CAAC,EAAE,KAAK,oBAAoBA,cAAK,CAAC,aAAa,CAAC,QAAQ,EAAE;AACnE,IAAI,KAAK,EAAE,UAAU;AACrB,GAAG,EAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC/B,CAAC,EAAE;AACH,GAAG,CAAC,WAAW,GAAG,uBAAuB;;;;"}
1
+ {"version":3,"file":"Tag.js","sources":["../../src/Tag/Tag.tsx"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport styled, { css } from 'styled-components';\nimport { Close } from '@kubed/icons';\nimport forwardRef from '../utils/forwardRef';\nimport { DefaultProps, KubedTheme, KubedNumberSize, themeUtils } from '../theme';\nimport { addColorAlpha } from '../utils/color';\n\nconst colorMap = {\n default: {\n color: 'background',\n background: 'accents_8',\n },\n primary: {\n color: 'green4',\n background: 'green0',\n },\n success: {\n color: 'green4',\n background: 'green0',\n },\n secondary: {\n color: 'accents_7',\n background: 'accents_2',\n },\n warning: {\n color: 'yellow4',\n background: 'yellow0',\n },\n error: {\n color: 'red4',\n background: 'red0',\n },\n info: {\n color: 'blue4',\n background: 'blue0',\n },\n};\n\nconst getColor = (color = 'default', theme: KubedTheme) => {\n const colorValue = themeUtils.getColor(colorMap[color].color, theme);\n const background = themeUtils.getColor(colorMap[color].background, theme);\n\n return css`\n background-color: ${background};\n color: ${colorValue};\n `;\n};\n\nconst TagWrapper = styled('div')<TagProps>`\n display: inline-flex;\n align-items: center;\n padding: ${({ title }) => (title ? '0 6px 0 2px' : '0 4px')};\n line-height: 20px;\n border-radius: ${({ title, radius, theme }) =>\n radius ? themeUtils.getSizeValue(radius, theme.layout.radius) : title ? '3px' : '2px'};\n word-break: break-all;\n white-space: normal;\n font-weight: 600;\n ${({ color, theme }) => getColor(color, theme)};\n\n .tag-close {\n margin-left: 6px;\n cursor: pointer;\n border-radius: 3px;\n &:hover {\n background-color: ${({ theme }) => addColorAlpha(theme.palette.accents_6, 0.6)};\n }\n }\n`;\n\nconst TagTitle = styled('span')`\n display: inline-flex;\n padding: 0 6px;\n margin: 2px 6px 2px 0;\n line-height: 16px;\n color: ${({ theme }) => theme.palette.background};\n background-color: ${({ theme }) => theme.palette.accents_7};\n border-radius: 1px;\n font-weight: 500;\n`;\n\nexport interface TagProps extends DefaultProps {\n /** Title of the tag */\n title?: React.ReactNode;\n\n /** Style of title */\n titleStyle?: React.CSSProperties;\n\n /** Tag color from theme */\n color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info' | string;\n\n /** Append element of the tag */\n append?: React.ReactNode;\n\n /** Prepend element of the tag */\n prepend?: React.ReactNode;\n\n /** Radius of the tag */\n radius?: KubedNumberSize;\n\n visible?: boolean;\n\n closable?: boolean;\n\n onClose?: (e: React.MouseEvent<SVGElement>) => void;\n}\n\nexport const Tag = forwardRef<TagProps, 'div'>(\n (\n { radius, title, titleStyle, color, onClose, children, prepend, append, closable, ...rest },\n ref\n ) => {\n const [visible, setVisible] = useState(true);\n\n useEffect(() => {\n if ('visible' in rest) {\n setVisible(rest.visible!);\n }\n }, [rest.visible]);\n\n const handleClose = (e: React.MouseEvent<SVGElement>) => {\n e.stopPropagation();\n onClose?.(e);\n\n if (e.defaultPrevented) {\n return;\n }\n if (!('visible' in rest)) {\n setVisible(false);\n }\n };\n\n if (!visible) return null;\n\n return (\n <TagWrapper ref={ref} radius={radius} title={title} color={color} {...rest}>\n {prepend}\n {title && <TagTitle style={titleStyle}>{title}</TagTitle>}\n {children}\n {append}\n {closable && <Close variant=\"light\" className=\"tag-close\" onClick={handleClose} />}\n </TagWrapper>\n );\n }\n);\n\nTag.displayName = '@kubed/components/Tag';\n"],"names":["themeUtils","css","styled","addColorAlpha","forwardRef","useState","useEffect","React","Close"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CA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C,cAAK,CAAC,aAAa,CAAC,UAAU,EAAE,cAAc,CAAC;AACxE,IAAI,GAAG;AACP,IAAI,MAAM;AACV,IAAI,KAAK;AACT,IAAI,KAAK;AACT,GAAG,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,oBAAoBA,cAAK,CAAC,aAAa,CAAC,QAAQ,EAAE;AAC5E,IAAI,KAAK,EAAE,UAAU;AACrB,GAAG,EAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,oBAAoBA,cAAK,CAAC,aAAa,CAACC,WAAK,EAAE;AACtF,IAAI,OAAO,EAAE,OAAO;AACpB,IAAI,SAAS,EAAE,WAAW;AAC1B,IAAI,OAAO,EAAE,WAAW;AACxB,GAAG,CAAC,CAAC,CAAC;AACN,CAAC,EAAE;AACH,GAAG,CAAC,WAAW,GAAG,uBAAuB;;;;"}
@@ -1,25 +1,26 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var styled=require("styled-components");function _interopDefaultLegacy(r){return r&&typeof r=="object"&&"default"in r?r.default:r}var styled__default=_interopDefaultLegacy(styled);const getExpandedStyle=(r,o)=>r?styled.css`
2
- border-color: ${o.palette.accents_5};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var styled=require("styled-components");function _interopDefaultLegacy(o){return o&&typeof o=="object"&&"default"in o?o.default:o}var styled__default=_interopDefaultLegacy(styled);const getExpandedStyle=(o,r)=>o?styled.css`
2
+ border-color: ${r.palette.accents_5};
3
3
  border-bottom: 0;
4
4
  border-bottom-right-radius: 0;
5
5
  border-bottom-left-radius: 0;
6
6
  transition: none;
7
- background-color: ${o.palette.accents_1};
7
+ background-color: ${r.palette.accents_1};
8
8
  `:null,TypeSelectWrapper=styled__default("div")`
9
9
  position: relative;
10
10
  border-radius: 4px;
11
11
  cursor: pointer;
12
12
  `,ControlWrapper=styled__default("div")`
13
13
  border-radius: 4px;
14
- border: 1px solid ${({theme:r})=>r.palette.border};
14
+ border: 1px solid ${({theme:o})=>o.palette.border};
15
15
  height: 64px;
16
16
  padding: 12px 64px 12px 12px;
17
17
  transition: all 0.3s ease-in-out;
18
+ background-color: #fff;
18
19
 
19
20
  &:hover {
20
- border-color: ${({theme:r})=>r.palette.accents_5};
21
+ border-color: ${({theme:o})=>o.palette.accents_5};
21
22
  }
22
- ${({$expanded:r,theme:o})=>getExpandedStyle(r,o)};
23
+ ${({$expanded:o,theme:r})=>getExpandedStyle(o,r)};
23
24
  `,DropdownArrow=styled__default.div`
24
25
  position: absolute;
25
26
  height: 16px;
@@ -27,7 +28,7 @@
27
28
  right: 12px;
28
29
  transform: translateY(-50%);
29
30
  &:hover {
30
- background-color: ${({theme:r})=>r.palette.accents_1};
31
+ background-color: ${({theme:o})=>o.palette.accents_1};
31
32
  }
32
33
  z-index: 999;
33
34
  `,DropdownWrapper=styled__default.div`
@@ -35,18 +36,19 @@
35
36
  top: 63px;
36
37
  left: 0px;
37
38
  width: 100%;
38
- border: 1px solid ${({theme:r})=>r.palette.accents_5};
39
+ border: 1px solid ${({theme:o})=>o.palette.accents_5};
39
40
  border-radius: 4px;
40
41
  border-top-right-radius: 0;
41
42
  border-top-left-radius: 0;
42
43
  border-top: 0;
43
- background-color: ${({theme:r})=>r.palette.background};
44
+ background-color: ${({theme:o})=>o.palette.background};
45
+ z-index: 9999;
44
46
  //box-sizing: content-box;
45
47
  `,DropdownOption=styled__default.div`
46
48
  height: 64px;
47
49
  padding: 12px 64px 12px 12px;
48
50
  &:hover {
49
- background-color: ${({theme:r})=>r.palette.accents_0};
51
+ background-color: ${({theme:o})=>o.palette.accents_0};
50
52
  }
51
53
  `;exports.ControlWrapper=ControlWrapper,exports.DropdownArrow=DropdownArrow,exports.DropdownOption=DropdownOption,exports.DropdownWrapper=DropdownWrapper,exports.TypeSelectWrapper=TypeSelectWrapper;
52
54
  //# sourceMappingURL=TypeSelect.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TypeSelect.styles.js","sources":["../../src/TypeSelect/TypeSelect.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\n\ninterface ControlWrapperProps {\n $expanded: boolean;\n}\n\nconst getExpandedStyle = (expanded: boolean, theme) => {\n if (expanded) {\n return css`\n border-color: ${theme.palette.accents_5};\n border-bottom: 0;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n transition: none;\n background-color: ${theme.palette.accents_1};\n `;\n }\n return null;\n};\n\nexport const TypeSelectWrapper = styled('div')`\n position: relative;\n border-radius: 4px;\n cursor: pointer;\n`;\n\nexport const ControlWrapper = styled('div')<ControlWrapperProps>`\n border-radius: 4px;\n border: 1px solid ${({ theme }) => theme.palette.border};\n height: 64px;\n padding: 12px 64px 12px 12px;\n transition: all 0.3s ease-in-out;\n\n &:hover {\n border-color: ${({ theme }) => theme.palette.accents_5};\n }\n ${({ $expanded, theme }) => getExpandedStyle($expanded, theme)};\n`;\n\nexport const DropdownArrow = styled.div`\n position: absolute;\n height: 16px;\n top: 50%;\n right: 12px;\n transform: translateY(-50%);\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_1};\n }\n z-index: 999;\n`;\n\nexport const DropdownWrapper = styled.div`\n position: absolute;\n top: 63px;\n left: 0px;\n width: 100%;\n border: 1px solid ${({ theme }) => theme.palette.accents_5};\n border-radius: 4px;\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n border-top: 0;\n background-color: ${({ theme }) => theme.palette.background};\n //box-sizing: content-box;\n`;\n\nexport const DropdownOption = styled.div`\n height: 64px;\n padding: 12px 64px 12px 12px;\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_0};\n }\n`;\n"],"names":["css","styled"],"mappings":";;;;;;;;;;AACA,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,KAAK,KAAK;AAC9C,EAAE,IAAI,QAAQ,EAAE;AAChB,IAAI,OAAOA,UAAG,CAAC;AACf,oBAAoB,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAC9C;AACA;AACA;AACA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;;;;;;"}
1
+ {"version":3,"file":"TypeSelect.styles.js","sources":["../../src/TypeSelect/TypeSelect.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\n\ninterface ControlWrapperProps {\n $expanded: boolean;\n}\n\nconst getExpandedStyle = (expanded: boolean, theme) => {\n if (expanded) {\n return css`\n border-color: ${theme.palette.accents_5};\n border-bottom: 0;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n transition: none;\n background-color: ${theme.palette.accents_1};\n `;\n }\n return null;\n};\n\nexport const TypeSelectWrapper = styled('div')`\n position: relative;\n border-radius: 4px;\n cursor: pointer;\n`;\n\nexport const ControlWrapper = styled('div')<ControlWrapperProps>`\n border-radius: 4px;\n border: 1px solid ${({ theme }) => theme.palette.border};\n height: 64px;\n padding: 12px 64px 12px 12px;\n transition: all 0.3s ease-in-out;\n background-color: #fff;\n\n &:hover {\n border-color: ${({ theme }) => theme.palette.accents_5};\n }\n ${({ $expanded, theme }) => getExpandedStyle($expanded, theme)};\n`;\n\nexport const DropdownArrow = styled.div`\n position: absolute;\n height: 16px;\n top: 50%;\n right: 12px;\n transform: translateY(-50%);\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_1};\n }\n z-index: 999;\n`;\n\nexport const DropdownWrapper = styled.div`\n position: absolute;\n top: 63px;\n left: 0px;\n width: 100%;\n border: 1px solid ${({ theme }) => theme.palette.accents_5};\n border-radius: 4px;\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n border-top: 0;\n background-color: ${({ theme }) => theme.palette.background};\n z-index: 9999;\n //box-sizing: content-box;\n`;\n\nexport const DropdownOption = styled.div`\n height: 64px;\n padding: 12px 64px 12px 12px;\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_0};\n }\n`;\n"],"names":["css","styled"],"mappings":";;;;;;;;;;AACA,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,KAAK,KAAK;AAC9C,EAAE,IAAI,QAAQ,EAAE;AAChB,IAAI,OAAOA,UAAG,CA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sB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAC/D;AACA;;;;;;;;"}
package/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("./ConfigProvider/index.js"),Button=require("./Button/Button.js"),Group=require("./Group/Group.js"),Container=require("./Container/Container.js"),Center=require("./Center/Center.js"),Row=require("./Grid/Row.js"),Navs=require("./Navs/Navs.js"),Snippet=require("./Snippet/Snippet.js"),Tabs=require("./Tabs/Tabs.js"),Text=require("./Text/Text.js"),Tooltip=require("./Tooltip/Tooltip.js"),Popover=require("./Popover/Popover.js"),Divider=require("./Divider/Divider.js"),Menu=require("./Menu/Menu.js"),StatusDot=require("./StatusDot/StatusDot.js"),Tag=require("./Tag/Tag.js"),Badge=require("./Badge/Badge.js"),Alert=require("./Alert/Alert.js"),Card=require("./Card/Card.js"),Descriptions=require("./Descriptions/Descriptions.js"),Entity=require("./Entity/Entity.js"),Dropdown=require("./Dropdown/Dropdown.js"),Loading=require("./Loading/Loading.js"),LoadingOverlay=require("./LoadingOverlay/LoadingOverlay.js"),Input=require("./Input/Input.js"),InputPassword=require("./InputPassword/InputPassword.js"),FilterInput=require("./FilterInput/FilterInput.js"),Empty=require("./Empty/Empty.js"),Form=require("./Form/Form.js"),Select=require("./Select/Select.js"),Checkbox=require("./Checkbox/Checkbox.js"),Radio=require("./Radio/Radio.js"),Switch=require("./Switch/Switch.js"),InputNumber=require("./InputNumber/InputNumber.js"),DatePicker=require("./DatePicker/DatePicker.js"),TimePicker=require("./TimePicker/TimePicker.js"),Banner=require("./Banner/Banner.js"),Notify=require("./Notify/Notify.js"),AutoComplete=require("./AutoComplete/AutoComplete.js"),ActionConfirm=require("./ActionConfirm/ActionConfirm.js"),Progress=require("./Progress/Progress.js"),color=require("./utils/color.js"),Steps=require("./Steps/Steps.js"),TypeSelect=require("./TypeSelect/TypeSelect.js"),Drawer=require("./Drawer/Drawer.js"),Collapse=require("./Collapse/Collapse.js"),forwardRef=require("./utils/forwardRef.js"),toArray=require("./utils/toArray.js"),useForm=require("./Form/hooks/useForm.js"),Col=require("./Grid/Col.js"),Tab=require("./Tabs/Tab/Tab.js"),MenuLabel=require("./Menu/MenuLabel/MenuLabel.js"),MenuItem=require("./Menu/MenuItem/MenuItem.js"),BadgeAnchor=require("./Badge/BadgeAnchor.js"),Description=require("./Descriptions/Description.js"),Field=require("./Entity/Field.js"),Modal=require("./Modal/Modal.js"),ModalContext=require("./Modal/ModalProvider/ModalContext.js"),CheckboxGroup=require("./Checkbox/CheckboxGroup.js"),RadioGroup=require("./Radio/RadioGroup.js"),BannerTip=require("./Banner/BannerTip.js"),toast=require("react-hot-toast"),Slider=require("./Slider/Slider/Slider.js"),RangeSlider=require("./Slider/RangeSlider/RangeSlider.js"),Step=require("./Steps/Step/Step.js"),StepCompleted=require("./Steps/StepCompleted/StepCompleted.js"),TabStep=require("./Steps/TabStep/TabStep.js"),CssBaseline=require("./theme/CssBaseline.js"),ThemeContext=require("./theme/ThemeContext.js"),utils=require("./theme/utils.js"),FieldForm=require("rc-field-form"),FormItem=require("./Form/FormItem/FormItem.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var toast__default=_interopDefaultLegacy(toast);exports.KubedConfigProvider=index.KubedConfigProvider,exports.Button=Button.Button,exports.Group=Group.Group,exports.Container=Container.Container,exports.Center=Center.Center,exports.Row=Row.Row,exports.Navs=Navs.Navs,exports.Snippet=Snippet.Snippet,exports.Tabs=Tabs.Tabs,exports.Text=Text.Text,exports.Tooltip=Tooltip.Tooltip,exports.Popover=Popover.Popover,exports.Divider=Divider.Divider,exports.Menu=Menu.Menu,exports.StatusDot=StatusDot.StatusDot,exports.Tag=Tag.Tag,exports.Badge=Badge.Badge,exports.Alert=Alert.Alert,exports.Card=Card.Card,exports.Descriptions=Descriptions.Descriptions,exports.Entity=Entity.Entity,exports.Dropdown=Dropdown.Dropdown,exports.Loading=Loading.Loading,exports.LoadingOverlay=LoadingOverlay.LoadingOverlay,exports.Input=Input.Input,exports.InputPassword=InputPassword.InputPassword,exports.FilterInput=FilterInput.FilterInput,exports.Empty=Empty.Empty,exports.Form=Form.Form,exports.Select=Select.Select,exports.Checkbox=Checkbox.Checkbox,exports.Radio=Radio.Radio,exports.Switch=Switch.Switch,exports.InputNumber=InputNumber.InputNumber,exports.DatePicker=DatePicker.DatePicker,exports.TimePicker=TimePicker.default,exports.Banner=Banner.Banner,exports.Notify=Notify.Notify,exports.AutoComplete=AutoComplete.AutoComplete,exports.ActionConfirm=ActionConfirm.ActionConfirm,exports.Progress=Progress.Progress,exports.addColorAlpha=color.addColorAlpha,exports.colorToRgbValues=color.colorToRgbValues,exports.Steps=Steps.Steps,exports.TypeSelect=TypeSelect.TypeSelect,exports.Drawer=Drawer.default,exports.Collapse=Collapse.default,exports.forwardRef=forwardRef.default,exports.toArray=toArray.default,exports.useForm=useForm.default,exports.Col=Col.Col,exports.Tab=Tab.Tab,exports.MenuLabel=MenuLabel.MenuLabel,exports.MenuItem=MenuItem.MenuItem,exports.BadgeAnchor=BadgeAnchor.BadgeAnchor,exports.Description=Description.Description,exports.Field=Field.Field,exports.Modal=Modal.Modal,exports.useModal=ModalContext.useModal,exports.CheckboxGroup=CheckboxGroup.CheckboxGroup,exports.RadioGroup=RadioGroup.RadioGroup,exports.BannerTip=BannerTip.BannerTip,exports.notify=toast__default,exports.Slider=Slider.Slider,exports.RangeSlider=RangeSlider.RangeSlider,exports.Step=Step.Step,exports.StepCompleted=StepCompleted.StepCompleted,exports.TabStep=TabStep.TabStep,exports.CssBaseline=CssBaseline.default,exports.useTheme=ThemeContext.useTheme,exports.themeUtils=utils.default,exports.FormList=FieldForm.List,exports.FormItem=FormItem.FormItem;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("./ConfigProvider/index.js"),Button=require("./Button/Button.js"),Group=require("./Group/Group.js"),Container=require("./Container/Container.js"),Center=require("./Center/Center.js"),Row=require("./Grid/Row.js"),Navs=require("./Navs/Navs.js"),Snippet=require("./Snippet/Snippet.js"),Tabs=require("./Tabs/Tabs.js"),Text=require("./Text/Text.js"),Tooltip=require("./Tooltip/Tooltip.js"),Popover=require("./Popover/Popover.js"),Divider=require("./Divider/Divider.js"),Menu=require("./Menu/Menu.js"),StatusDot=require("./StatusDot/StatusDot.js"),Tag=require("./Tag/Tag.js"),Badge=require("./Badge/Badge.js"),Alert=require("./Alert/Alert.js"),Card=require("./Card/Card.js"),Descriptions=require("./Descriptions/Descriptions.js"),Entity=require("./Entity/Entity.js"),Dropdown=require("./Dropdown/Dropdown.js"),Loading=require("./Loading/Loading.js"),LoadingOverlay=require("./LoadingOverlay/LoadingOverlay.js"),Input=require("./Input/Input.js"),InputPassword=require("./InputPassword/InputPassword.js"),FilterInput=require("./FilterInput/FilterInput.js"),Empty=require("./Empty/Empty.js"),Form=require("./Form/Form.js"),Select=require("./Select/Select.js"),Checkbox=require("./Checkbox/Checkbox.js"),Radio=require("./Radio/Radio.js"),Switch=require("./Switch/Switch.js"),InputNumber=require("./InputNumber/InputNumber.js"),DatePicker=require("./DatePicker/DatePicker.js"),TimePicker=require("./TimePicker/TimePicker.js"),Banner=require("./Banner/Banner.js"),Notify=require("./Notify/Notify.js"),AutoComplete=require("./AutoComplete/AutoComplete.js"),ActionConfirm=require("./ActionConfirm/ActionConfirm.js"),Progress=require("./Progress/Progress.js"),color=require("./utils/color.js"),Steps=require("./Steps/Steps.js"),TypeSelect=require("./TypeSelect/TypeSelect.js"),ShowMore=require("./ShowMore/ShowMore.js"),Drawer=require("./Drawer/Drawer.js"),Collapse=require("./Collapse/Collapse.js"),forwardRef=require("./utils/forwardRef.js"),toArray=require("./utils/toArray.js"),useForm=require("./Form/hooks/useForm.js"),Col=require("./Grid/Col.js"),Tab=require("./Tabs/Tab/Tab.js"),MenuLabel=require("./Menu/MenuLabel/MenuLabel.js"),MenuItem=require("./Menu/MenuItem/MenuItem.js"),BadgeAnchor=require("./Badge/BadgeAnchor.js"),Description=require("./Descriptions/Description.js"),Field=require("./Entity/Field.js"),Modal=require("./Modal/Modal.js"),ModalContext=require("./Modal/ModalProvider/ModalContext.js"),CheckboxGroup=require("./Checkbox/CheckboxGroup.js"),RadioGroup=require("./Radio/RadioGroup.js"),BannerTip=require("./Banner/BannerTip.js"),toast=require("react-hot-toast"),Slider=require("./Slider/Slider/Slider.js"),RangeSlider=require("./Slider/RangeSlider/RangeSlider.js"),Step=require("./Steps/Step/Step.js"),StepCompleted=require("./Steps/StepCompleted/StepCompleted.js"),TabStep=require("./Steps/TabStep/TabStep.js"),CssBaseline=require("./theme/CssBaseline.js"),ThemeContext=require("./theme/ThemeContext.js"),utils=require("./theme/utils.js"),FieldForm=require("rc-field-form"),FormItem=require("./Form/FormItem/FormItem.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var toast__default=_interopDefaultLegacy(toast);exports.KubedConfigProvider=index.KubedConfigProvider,exports.Button=Button.Button,exports.Group=Group.Group,exports.Container=Container.Container,exports.Center=Center.Center,exports.Row=Row.Row,exports.Navs=Navs.Navs,exports.Snippet=Snippet.Snippet,exports.Tabs=Tabs.Tabs,exports.Text=Text.Text,exports.Tooltip=Tooltip.Tooltip,exports.Popover=Popover.Popover,exports.Divider=Divider.Divider,exports.Menu=Menu.Menu,exports.StatusDot=StatusDot.StatusDot,exports.Tag=Tag.Tag,exports.Badge=Badge.Badge,exports.Alert=Alert.Alert,exports.Card=Card.Card,exports.Descriptions=Descriptions.Descriptions,exports.Entity=Entity.Entity,exports.Dropdown=Dropdown.Dropdown,exports.Loading=Loading.Loading,exports.LoadingOverlay=LoadingOverlay.LoadingOverlay,exports.Input=Input.Input,exports.InputPassword=InputPassword.InputPassword,exports.FilterInput=FilterInput.FilterInput,exports.Empty=Empty.Empty,exports.Form=Form.Form,exports.Select=Select.Select,exports.Checkbox=Checkbox.Checkbox,exports.Radio=Radio.Radio,exports.Switch=Switch.Switch,exports.InputNumber=InputNumber.InputNumber,exports.DatePicker=DatePicker.DatePicker,exports.TimePicker=TimePicker.default,exports.Banner=Banner.Banner,exports.Notify=Notify.Notify,exports.AutoComplete=AutoComplete.AutoComplete,exports.ActionConfirm=ActionConfirm.ActionConfirm,exports.Progress=Progress.Progress,exports.addColorAlpha=color.addColorAlpha,exports.colorToRgbValues=color.colorToRgbValues,exports.Steps=Steps.Steps,exports.TypeSelect=TypeSelect.TypeSelect,exports.ShowMore=ShowMore.ShowMore,exports.Drawer=Drawer.default,exports.Collapse=Collapse.default,exports.forwardRef=forwardRef.default,exports.toArray=toArray.default,exports.useForm=useForm.default,exports.Col=Col.Col,exports.Tab=Tab.Tab,exports.MenuLabel=MenuLabel.MenuLabel,exports.MenuItem=MenuItem.MenuItem,exports.BadgeAnchor=BadgeAnchor.BadgeAnchor,exports.Description=Description.Description,exports.Field=Field.Field,exports.Modal=Modal.Modal,exports.useModal=ModalContext.useModal,exports.CheckboxGroup=CheckboxGroup.CheckboxGroup,exports.RadioGroup=RadioGroup.RadioGroup,exports.BannerTip=BannerTip.BannerTip,exports.notify=toast__default,exports.Slider=Slider.Slider,exports.RangeSlider=RangeSlider.RangeSlider,exports.Step=Step.Step,exports.StepCompleted=StepCompleted.StepCompleted,exports.TabStep=TabStep.TabStep,exports.CssBaseline=CssBaseline.default,exports.useTheme=ThemeContext.useTheme,exports.themeUtils=utils.default,exports.FormList=FieldForm.List,exports.FormItem=FormItem.FormItem;
2
2
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -17,5 +17,5 @@ import i from"react";import u,{css as c}from"styled-components";import b from"cl
17
17
  line-height: 20px;
18
18
  font-weight: 500;
19
19
  ${({color:r,theme:e,shadow:t})=>$(r,e,t)};
20
- `,g=v((r,e)=>{var t=r,{children:o,dot:n,className:s}=t,l=h(t,["children","dot","className"]);return n?i.createElement(O,_({ref:e,className:"badge"},l)):i.createElement(N,j(_({},l),{ref:e,className:b("badge",s)}),o)});g.displayName="@kubed/components/Badge";export{g as Badge};
20
+ `,g=v((r,e)=>{var t=r,{children:o,dot:n,className:s}=t,l=h(t,["children","dot","className"]);return n||!o?i.createElement(O,_({ref:e,className:"badge"},l)):i.createElement(N,j(_({},l),{ref:e,className:b("badge",s)}),o)});g.displayName="@kubed/components/Badge";export{g as Badge};
21
21
  //# sourceMappingURL=Badge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sources":["../../src/Badge/Badge.tsx"],"sourcesContent":["import React from 'react';\nimport styled, { css } from 'styled-components';\nimport cx from 'classnames';\nimport forwardRef from '../utils/forwardRef';\nimport { DefaultProps, KubedSizes, KubedTheme, themeUtils } from '../theme';\nimport { colorToRgbValues } from '../utils/color';\nimport { BadgeAnchor } from './BadgeAnchor';\nimport { StatusDot } from '../StatusDot/StatusDot';\n\nexport { BadgeAnchor };\n\nconst getColor = (color, theme: KubedTheme, shadow) => {\n const { palette } = theme;\n if (color) {\n const colorHex = themeUtils.getColor(color, theme);\n const colorRgb = colorToRgbValues(colorHex).join(' ');\n return css`\n color: ${palette.background};\n background-color: ${themeUtils.getColor(color, theme)};\n box-shadow: ${shadow ? `0 2px 4px 0 rgb(${colorRgb} / 36%)` : null};\n `;\n }\n\n return css`\n background-color: ${palette.accents_1};\n color: ${palette.accents_8};\n `;\n};\n\nconst BadgeWrapper = styled('div')<BadgeProps>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n word-break: break-all;\n white-space: normal;\n padding: 0 8px;\n border-radius: 16px;\n min-width: 32px;\n line-height: 20px;\n font-weight: 500;\n ${({ color, theme, shadow }) => getColor(color, theme, shadow)};\n`;\n\nexport interface BadgeProps extends DefaultProps {\n /** Badge color from theme */\n color?: string | 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n\n /** Display shadow or not\t */\n shadow?: boolean;\n\n /** Display Dot or not\t */\n dot?: boolean;\n\n /** Predefined button size */\n size?: KubedSizes;\n\n /** Disable animation status or not, only affect when dot is true */\n motion?: boolean;\n}\n\nexport const Badge = forwardRef<BadgeProps, 'div'>(({ children, dot, className, ...rest }, ref) => {\n if (dot) {\n return <StatusDot ref={ref} className=\"badge\" {...rest} />;\n }\n return (\n <BadgeWrapper {...rest} ref={ref} className={cx('badge', className)}>\n {children}\n </BadgeWrapper>\n );\n});\n\nBadge.displayName = '@kubed/components/Badge';\n"],"names":["React"],"mappings":";;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,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E,KAAK,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC,CAAC;AACU,MAAC,KAAK,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,GAAG,KAAK;AAC7C,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,SAAS,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;AACzG,EAAE,IAAI,GAAG,EAAE;AACX,IAAI,uBAAuBA,cAAK,CAAC,aAAa,CAAC,SAAS,EAAE,cAAc,CAAC;AACzE,MAAM,GAAG;AACT,MAAM,SAAS,EAAE,OAAO;AACxB,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AACd,GAAG;AACH,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAAC,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE;AACnG,IAAI,GAAG;AACP,IAAI,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;AACrC,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC;AAChB,CAAC,EAAE;AACH,KAAK,CAAC,WAAW,GAAG,yBAAyB;;;;"}
1
+ {"version":3,"file":"Badge.js","sources":["../../src/Badge/Badge.tsx"],"sourcesContent":["import React from 'react';\nimport styled, { css } from 'styled-components';\nimport cx from 'classnames';\nimport forwardRef from '../utils/forwardRef';\nimport { DefaultProps, KubedSizes, KubedTheme, themeUtils } from '../theme';\nimport { colorToRgbValues } from '../utils/color';\nimport { BadgeAnchor } from './BadgeAnchor';\nimport { StatusDot } from '../StatusDot/StatusDot';\n\nexport { BadgeAnchor };\n\nconst getColor = (color, theme: KubedTheme, shadow) => {\n const { palette } = theme;\n if (color) {\n const colorHex = themeUtils.getColor(color, theme);\n const colorRgb = colorToRgbValues(colorHex).join(' ');\n return css`\n color: ${palette.background};\n background-color: ${themeUtils.getColor(color, theme)};\n box-shadow: ${shadow ? `0 2px 4px 0 rgb(${colorRgb} / 36%)` : null};\n `;\n }\n\n return css`\n background-color: ${palette.accents_1};\n color: ${palette.accents_8};\n `;\n};\n\nconst BadgeWrapper = styled('div')<BadgeProps>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n word-break: break-all;\n white-space: normal;\n padding: 0 8px;\n border-radius: 16px;\n min-width: 32px;\n line-height: 20px;\n font-weight: 500;\n ${({ color, theme, shadow }) => getColor(color, theme, shadow)};\n`;\n\nexport interface BadgeProps extends DefaultProps {\n /** Badge color from theme */\n color?: string | 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n\n /** Display shadow or not\t */\n shadow?: boolean;\n\n /** Display Dot or not\t */\n dot?: boolean;\n\n /** Predefined button size */\n size?: KubedSizes;\n\n /** Disable animation status or not, only affect when dot is true */\n motion?: boolean;\n}\n\nexport const Badge = forwardRef<BadgeProps, 'div'>(({ children, dot, className, ...rest }, ref) => {\n if (dot || !children) {\n return <StatusDot ref={ref} className=\"badge\" {...rest} />;\n }\n return (\n <BadgeWrapper {...rest} ref={ref} className={cx('badge', className)}>\n {children}\n </BadgeWrapper>\n );\n});\n\nBadge.displayName = '@kubed/components/Badge';\n"],"names":["React"],"mappings":";;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GA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AACA;AACA;AACA;AACA;AACA,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC,CAAC;AACU,MAAC,KAAK,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,GAAG,KAAK;AAC7C,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,SAAS,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;AACzG,EAAE,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE;AACxB,IAAI,uBAAuBA,cAAK,CAAC,aAAa,CAAC,SAAS,EAAE,cAAc,CAAC;AACzE,MAAM,GAAG;AACT,MAAM,SAAS,EAAE,OAAO;AACxB,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AACd,GAAG;AACH,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAAC,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE;AACnG,IAAI,GAAG;AACP,IAAI,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;AACrC,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC;AAChB,CAAC,EAAE;AACH,KAAK,CAAC,WAAW,GAAG,yBAAyB;;;;"}
@@ -1,78 +1,76 @@
1
- import d,{css as t}from"styled-components";import{colorToRgbValues as B}from"../utils/color.js";const k=(r,o)=>o?t`
1
+ import c,{css as r}from"styled-components";import{colorToRgbValues as B}from"../utils/color.js";const h=(t,o)=>o?r`
2
2
  cursor: not-allowed;
3
3
  pointer-events: auto;
4
- `:r?t`
4
+ `:t?r`
5
5
  cursor: default;
6
6
  pointer-events: none;
7
- `:t`
7
+ `:r`
8
8
  cursor: pointer;
9
9
  pointer-events: auto;
10
- `,h={xs:t`
10
+ `,k={xs:r`
11
11
  font-size: 10px;
12
12
  padding: 0 14px;
13
- `,sm:t`
13
+ `,sm:r`
14
14
  font-size: 12px;
15
15
  padding: 0 20px;
16
- `,md:t`
16
+ `,md:r`
17
17
  font-size: 14px;
18
18
  padding: 0 23px;
19
- `,lg:t`
19
+ `,lg:r`
20
20
  font-size: 16px;
21
21
  padding: 0 26px;
22
- `,xl:t`
22
+ `,xl:r`
23
23
  font-size: 18px;
24
24
  padding: 0 30px;
25
- `},w=(r,o)=>t`
26
- ${h[r]};
25
+ `},w=(t,o)=>r`
26
+ ${k[t]};
27
27
  width: ${o?"100%":"auto"};
28
- height: ${({theme:n})=>n.layout.inputSizes[r]};
29
- `,_=(r="filled",o,n,i,s)=>{const{palette:l}=s;return n?t`
30
- background-color: ${l.accents_1};
31
- border-color: ${l.border};
32
- color: ${l.accents_7};
33
- opacity: 0.7;
34
- `:{filled:t`
28
+ height: ${({theme:n})=>n.layout.inputSizes[t]};
29
+ `,z=t=>t?r`
30
+ opacity: 0.6;
31
+ `:null,_=(t="filled",o)=>({filled:r`
35
32
  background-color: ${o.bg};
36
33
  border-color: ${o.border};
37
34
  color: ${o.color};
38
- `,outline:t`
35
+ `,outline:r`
39
36
  background-color: #fff;
40
37
  border-color: ${o.border};
41
38
  color: ${o.fg||o.bg};
42
- `,link:t`
39
+ `,link:r`
43
40
  font-weight: 400;
44
41
  background-color: transparent;
45
42
  border-color: transparent;
46
43
  color: ${o.fg||o.bg};
47
44
  padding: 0;
48
- `,text:t`
45
+ `,text:r`
49
46
  background-color: transparent;
50
47
  border-color: transparent;
51
48
  color: ${o.fg||o.bg};
52
- `}[r]},z=(r="filled",o,n,i,s,l)=>{if(n)return null;if(s)return t`
49
+ `})[t],C=(t="filled",o,n,l,s,d)=>{if(n)return null;if(s)return r`
53
50
  box-shadow: none;
54
- `;const{palette:e}=l;return r==="link"?t`
51
+ `;const{palette:e}=d;return t==="link"?r`
55
52
  text-decoration: underline;
56
- `:r==="text"?t`
53
+ `:t==="text"?r`
57
54
  background-color: ${e.accents_2};
58
- `:{filled:t`
55
+ `:{filled:r`
59
56
  background-color: ${o.hoverBg};
60
57
  border-color: ${o.hoverBorder||o.hoverBg};
61
- `,outline:t`
58
+ `,outline:r`
62
59
  background-color: ${o.hoverBg};
63
60
  color: ${o.color};
64
- `,text:t`
61
+ `,text:r`
65
62
  background-color: transparent;
66
63
  border-color: transparent;
67
64
  color: ${e.accents_5};
68
- `}[r]},C=(r,o,n)=>{if(r){const{expressiveness:i}=n,s=B(o.bg).join(" ");return i.buttonShadow(s)}return null},j=(r,o="default",n,i,s,l)=>{const{palette:e}=r,{background:p,border:f,accents_1:x,accents_2:y,accents_7:b,accents_8:$,accents_9:v,primary:a}=e,g={default:{bg:x,border:f,color:b,fg:b,hoverBg:y,hoverBorder:f},primary:{bg:e.colors[a][2],border:e.colors[a][2],color:"#fff",hoverBg:e.colors[a][3]},secondary:{bg:$,border:$,color:p,hoverBg:v}};let c;if(g[o])c=g[o];else if(e[o])c={bg:e[o],border:e[o],color:"#fff",hoverBg:e[`${o}Dark`]};else if(e.colors[o]){const u=e.colors[o];c={bg:u[2],border:u[2],color:"#fff",hoverBg:u[3]}}else c=g.default;return t`
69
- box-shadow: ${C(i,c,r)};
70
- ${_(n,c,s,l,r)};
65
+ `}[t]},j=(t,o,n)=>{if(t){const{expressiveness:l}=n,s=B(o.bg).join(" ");return l.buttonShadow(s)}return null},I=(t,o="default",n,l,s,d)=>{const{palette:e}=t,{background:p,border:f,accents_1:$,accents_2:y,accents_7:b,accents_8:x,accents_9:v,primary:a}=e,u={default:{bg:$,border:f,color:b,fg:b,hoverBg:y,hoverBorder:f},primary:{bg:e.colors[a][2],border:e.colors[a][2],color:"#fff",hoverBg:e.colors[a][3]},secondary:{bg:x,border:x,color:p,hoverBg:v}};let i;if(u[o])i=u[o];else if(e[o])i={bg:e[o],border:e[o],color:"#fff",hoverBg:e[`${o}Dark`]};else if(e.colors[o]){const g=e.colors[o];i={bg:g[2],border:g[2],color:"#fff",hoverBg:g[3]}}else i=u.default;return r`
66
+ box-shadow: ${j(l,i,t)};
67
+ ${_(n,i)};
68
+ ${z(s)};
71
69
 
72
70
  &:hover {
73
- ${z(n,c,s,l,i,r)};
71
+ ${C(n,i,s,d,l,t)};
74
72
  }
75
- `},I=d("div")`
73
+ `},D=c("div")`
76
74
  box-sizing: border-box;
77
75
  user-select: none;
78
76
  outline: none;
@@ -81,30 +79,30 @@ import d,{css as t}from"styled-components";import{colorToRgbValues as B}from"../
81
79
  font-weight: 600;
82
80
  border: 1px solid;
83
81
  transition: all 0.3s ease-in-out;
84
- border-radius: ${({$radius:r,theme:o})=>o.layout.radius[r]};
85
- display: ${r=>r.block?"block":"inline-block"};
86
- ${({$loading:r,disabled:o})=>k(r,o)};
87
- ${({$size:r,block:o})=>w(r,o)};
88
- ${({theme:r,$color:o,$variant:n,$shadow:i,disabled:s,$loading:l})=>j(r,o,n,i,s,l)};
89
- ${({$loading:r})=>r?"opacity: 0.6;":null};
90
- `,L=d("div")`
82
+ border-radius: ${({$radius:t,theme:o})=>o.layout.radius[t]};
83
+ display: ${t=>t.block?"block":"inline-block"};
84
+ ${({$loading:t,disabled:o})=>h(t,o)};
85
+ ${({$size:t,block:o})=>w(t,o)};
86
+ ${({theme:t,$color:o,$variant:n,$shadow:l,disabled:s,$loading:d})=>I(t,o,n,l,s,d)};
87
+ ${({$loading:t})=>t?"opacity: 0.6;":null};
88
+ `,L=c("div")`
91
89
  display: flex;
92
90
  justify-content: center;
93
91
  align-items: center;
94
92
  height: 100%;
95
93
  line-height: 1;
96
- `,R=d("span")`
94
+ `,R=c("span")`
97
95
  display: inherit;
98
96
  white-space: nowrap;
99
97
  overflow: hidden;
100
98
  text-overflow: ellipsis;
101
- `,D=d("span")`
99
+ `,H=c("span")`
102
100
  display: flex;
103
101
  align-items: center;
104
102
  margin-right: 10px;
105
- `,H=d("span")`
103
+ `,T=c("span")`
106
104
  display: flex;
107
105
  align-items: center;
108
106
  margin-left: 10px;
109
- `;export{I as ButtonContainer,L as ButtonInner,R as ButtonLabel,D as IconLeftSpan,H as IconRightSpan};
107
+ `;export{D as ButtonContainer,L as ButtonInner,R as ButtonLabel,H as IconLeftSpan,T as IconRightSpan};
110
108
  //# sourceMappingURL=Button.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.styles.js","sources":["../../src/Button/Button.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { KubedNumberSize, KubedSizes, KubedTheme } from '../theme';\nimport { colorToRgbValues } from '../utils/color';\n\ninterface ButtonStylesProps {\n $loading?: boolean;\n $size?: KubedSizes;\n $radius?: KubedNumberSize;\n theme?: KubedTheme;\n block?: boolean;\n disabled?: boolean;\n $shadow?: boolean;\n $variant?: 'filled' | 'outline' | 'text' | 'link';\n $color?: string | 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n}\n\nconst getButtonCursor = ($loading: boolean, disabled: boolean) => {\n if (disabled) {\n return css`\n cursor: not-allowed;\n pointer-events: auto;\n `;\n }\n if ($loading) {\n return css`\n cursor: default;\n pointer-events: none;\n `;\n }\n return css`\n cursor: pointer;\n pointer-events: auto;\n `;\n};\n\nconst sizes = {\n xs: css`\n font-size: 10px;\n padding: 0 14px;\n `,\n sm: css`\n font-size: 12px;\n padding: 0 20px;\n `,\n md: css`\n font-size: 14px;\n padding: 0 23px;\n `,\n lg: css`\n font-size: 16px;\n padding: 0 26px;\n `,\n xl: css`\n font-size: 18px;\n padding: 0 30px;\n `,\n};\n\nconst getButtonSize = (size, block) => css`\n ${sizes[size]};\n width: ${block ? '100%' : 'auto'};\n height: ${({ theme }) => theme.layout.inputSizes[size]};\n`;\n\nconst getButtonColor = (variant = 'filled', colorSchema, disabled, $loading, theme: KubedTheme) => {\n const { palette } = theme;\n if (disabled) {\n return css`\n background-color: ${palette.accents_1};\n border-color: ${palette.border};\n color: ${palette.accents_7};\n opacity: 0.7;\n `;\n }\n\n const styles = {\n filled: css`\n background-color: ${colorSchema.bg};\n border-color: ${colorSchema.border};\n color: ${colorSchema.color};\n `,\n outline: css`\n background-color: #fff;\n border-color: ${colorSchema.border};\n color: ${colorSchema.fg || colorSchema.bg};\n `,\n link: css`\n font-weight: 400;\n background-color: transparent;\n border-color: transparent;\n color: ${colorSchema.fg || colorSchema.bg};\n padding: 0;\n `,\n text: css`\n background-color: transparent;\n border-color: transparent;\n color: ${colorSchema.fg || colorSchema.bg};\n `,\n };\n\n return styles[variant];\n};\n\nconst getButtonHoverColor = (\n variant = 'filled',\n colorSchema,\n disabled,\n $loading,\n shadow,\n theme: KubedTheme\n) => {\n if (disabled) return null;\n if (shadow) {\n return css`\n box-shadow: none;\n `;\n }\n const { palette } = theme;\n if (variant === 'link') {\n return css`\n text-decoration: underline;\n `;\n }\n if (variant === 'text') {\n return css`\n background-color: ${palette.accents_2};\n `;\n }\n\n const styles = {\n filled: css`\n background-color: ${colorSchema.hoverBg};\n border-color: ${colorSchema.hoverBorder || colorSchema.hoverBg};\n `,\n outline: css`\n background-color: ${colorSchema.hoverBg};\n color: ${colorSchema.color};\n `,\n text: css`\n background-color: transparent;\n border-color: transparent;\n color: ${palette.accents_5};\n `,\n };\n return styles[variant];\n};\n\nconst getShadow = (shadow, colorSchema, theme) => {\n if (shadow) {\n const { expressiveness } = theme;\n const rgb = colorToRgbValues(colorSchema.bg).join(' ');\n return expressiveness.buttonShadow(rgb);\n }\n return null;\n};\n\nconst getButtonStyles = (\n theme: KubedTheme,\n color = 'default',\n variant,\n shadow,\n disabled,\n $loading\n) => {\n const { palette } = theme;\n const { background, border, accents_1, accents_2, accents_7, accents_8, accents_9, primary } =\n palette;\n const colors = {\n default: {\n bg: accents_1,\n border,\n color: accents_7,\n fg: accents_7,\n hoverBg: accents_2,\n hoverBorder: border,\n },\n primary: {\n bg: palette.colors[primary][2],\n border: palette.colors[primary][2],\n color: '#fff',\n hoverBg: palette.colors[primary][3],\n },\n secondary: {\n bg: accents_8,\n border: accents_8,\n color: background,\n hoverBg: accents_9,\n },\n };\n\n let colorSchema;\n if (colors[color]) {\n colorSchema = colors[color];\n } else if (palette[color]) {\n colorSchema = {\n bg: palette[color],\n border: palette[color],\n color: '#fff',\n hoverBg: palette[`${color}Dark`],\n };\n } else if (palette.colors[color]) {\n const currentColor = palette.colors[color];\n colorSchema = {\n bg: currentColor[2],\n border: currentColor[2],\n color: '#fff',\n hoverBg: currentColor[3],\n };\n } else {\n colorSchema = colors.default;\n }\n\n return css`\n box-shadow: ${getShadow(shadow, colorSchema, theme)};\n ${getButtonColor(variant, colorSchema, disabled, $loading, theme)};\n\n &:hover {\n ${getButtonHoverColor(variant, colorSchema, disabled, $loading, shadow, theme)};\n }\n `;\n};\n\nexport const ButtonContainer = styled('div')<ButtonStylesProps>`\n box-sizing: border-box;\n user-select: none;\n outline: none;\n position: relative;\n overflow: hidden;\n font-weight: 600;\n border: 1px solid;\n transition: all 0.3s ease-in-out;\n border-radius: ${({ $radius, theme }) => theme.layout.radius[$radius]};\n display: ${(props) => (props.block ? 'block' : 'inline-block')};\n ${({ $loading, disabled }) => getButtonCursor($loading, disabled)};\n ${({ $size, block }) => getButtonSize($size, block)};\n ${({ theme, $color, $variant, $shadow, disabled, $loading }) =>\n getButtonStyles(theme, $color, $variant, $shadow, disabled, $loading)};\n ${({ $loading }) => ($loading ? 'opacity: 0.6;' : null)};\n`;\n\nexport const ButtonInner = styled('div')<ButtonStylesProps>`\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n line-height: 1;\n`;\n\nexport const ButtonLabel = styled('span')<ButtonStylesProps>`\n display: inherit;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const IconLeftSpan = styled('span')<ButtonStylesProps>`\n display: flex;\n align-items: center;\n margin-right: 10px;\n`;\n\nexport const IconRightSpan = styled('span')<ButtonStylesProps>`\n display: flex;\n align-items: center;\n margin-left: 10px;\n`;\n"],"names":[],"mappings":";;;AAEA,MAA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,EAAE,QAAQ,EAAE,KAAK,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACpE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACtD,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACxI,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,QAAQ,GAAG,eAAe,GAAG,IAAI,CAAC;AACxD,EAAE;AACU,MAAC,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AACzC;AACA;AACA;AACA;AACA;AACA,EAAE;AACU,MAAC,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA,EAAE;AACU,MAAC,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAC3C;AACA;AACA;AACA,EAAE;AACU,MAAC,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5C;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"Button.styles.js","sources":["../../src/Button/Button.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { KubedNumberSize, KubedSizes, KubedTheme } from '../theme';\nimport { colorToRgbValues } from '../utils/color';\n\ninterface ButtonStylesProps {\n $loading?: boolean;\n $size?: KubedSizes;\n $radius?: KubedNumberSize;\n theme?: KubedTheme;\n block?: boolean;\n disabled?: boolean;\n $shadow?: boolean;\n $variant?: 'filled' | 'outline' | 'text' | 'link';\n $color?: string | 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n}\n\nconst getButtonCursor = ($loading: boolean, disabled: boolean) => {\n if (disabled) {\n return css`\n cursor: not-allowed;\n pointer-events: auto;\n `;\n }\n if ($loading) {\n return css`\n cursor: default;\n pointer-events: none;\n `;\n }\n return css`\n cursor: pointer;\n pointer-events: auto;\n `;\n};\n\nconst sizes = {\n xs: css`\n font-size: 10px;\n padding: 0 14px;\n `,\n sm: css`\n font-size: 12px;\n padding: 0 20px;\n `,\n md: css`\n font-size: 14px;\n padding: 0 23px;\n `,\n lg: css`\n font-size: 16px;\n padding: 0 26px;\n `,\n xl: css`\n font-size: 18px;\n padding: 0 30px;\n `,\n};\n\nconst getButtonSize = (size, block) => css`\n ${sizes[size]};\n width: ${block ? '100%' : 'auto'};\n height: ${({ theme }) => theme.layout.inputSizes[size]};\n`;\n\nconst getDisabledStyles = (disabled) => {\n if (disabled) {\n return css`\n opacity: 0.6;\n `;\n }\n return null;\n};\n\nconst getButtonColor = (variant = 'filled', colorSchema) => {\n const styles = {\n filled: css`\n background-color: ${colorSchema.bg};\n border-color: ${colorSchema.border};\n color: ${colorSchema.color};\n `,\n outline: css`\n background-color: #fff;\n border-color: ${colorSchema.border};\n color: ${colorSchema.fg || colorSchema.bg};\n `,\n link: css`\n font-weight: 400;\n background-color: transparent;\n border-color: transparent;\n color: ${colorSchema.fg || colorSchema.bg};\n padding: 0;\n `,\n text: css`\n background-color: transparent;\n border-color: transparent;\n color: ${colorSchema.fg || colorSchema.bg};\n `,\n };\n\n return styles[variant];\n};\n\nconst getButtonHoverColor = (\n variant = 'filled',\n colorSchema,\n disabled,\n $loading,\n shadow,\n theme: KubedTheme\n) => {\n if (disabled) return null;\n if (shadow) {\n return css`\n box-shadow: none;\n `;\n }\n const { palette } = theme;\n if (variant === 'link') {\n return css`\n text-decoration: underline;\n `;\n }\n if (variant === 'text') {\n return css`\n background-color: ${palette.accents_2};\n `;\n }\n\n const styles = {\n filled: css`\n background-color: ${colorSchema.hoverBg};\n border-color: ${colorSchema.hoverBorder || colorSchema.hoverBg};\n `,\n outline: css`\n background-color: ${colorSchema.hoverBg};\n color: ${colorSchema.color};\n `,\n text: css`\n background-color: transparent;\n border-color: transparent;\n color: ${palette.accents_5};\n `,\n };\n return styles[variant];\n};\n\nconst getShadow = (shadow, colorSchema, theme) => {\n if (shadow) {\n const { expressiveness } = theme;\n const rgb = colorToRgbValues(colorSchema.bg).join(' ');\n return expressiveness.buttonShadow(rgb);\n }\n return null;\n};\n\nconst getButtonStyles = (\n theme: KubedTheme,\n color = 'default',\n variant,\n shadow,\n disabled,\n $loading\n) => {\n const { palette } = theme;\n const { background, border, accents_1, accents_2, accents_7, accents_8, accents_9, primary } =\n palette;\n const colors = {\n default: {\n bg: accents_1,\n border,\n color: accents_7,\n fg: accents_7,\n hoverBg: accents_2,\n hoverBorder: border,\n },\n primary: {\n bg: palette.colors[primary][2],\n border: palette.colors[primary][2],\n color: '#fff',\n hoverBg: palette.colors[primary][3],\n },\n secondary: {\n bg: accents_8,\n border: accents_8,\n color: background,\n hoverBg: accents_9,\n },\n };\n\n let colorSchema;\n if (colors[color]) {\n colorSchema = colors[color];\n } else if (palette[color]) {\n colorSchema = {\n bg: palette[color],\n border: palette[color],\n color: '#fff',\n hoverBg: palette[`${color}Dark`],\n };\n } else if (palette.colors[color]) {\n const currentColor = palette.colors[color];\n colorSchema = {\n bg: currentColor[2],\n border: currentColor[2],\n color: '#fff',\n hoverBg: currentColor[3],\n };\n } else {\n colorSchema = colors.default;\n }\n\n return css`\n box-shadow: ${getShadow(shadow, colorSchema, theme)};\n ${getButtonColor(variant, colorSchema)};\n ${getDisabledStyles(disabled)};\n\n &:hover {\n ${getButtonHoverColor(variant, colorSchema, disabled, $loading, shadow, theme)};\n }\n `;\n};\n\nexport const ButtonContainer = styled('div')<ButtonStylesProps>`\n box-sizing: border-box;\n user-select: none;\n outline: none;\n position: relative;\n overflow: hidden;\n font-weight: 600;\n border: 1px solid;\n transition: all 0.3s ease-in-out;\n border-radius: ${({ $radius, theme }) => theme.layout.radius[$radius]};\n display: ${(props) => (props.block ? 'block' : 'inline-block')};\n ${({ $loading, disabled }) => getButtonCursor($loading, disabled)};\n ${({ $size, block }) => getButtonSize($size, block)};\n ${({ theme, $color, $variant, $shadow, disabled, $loading }) =>\n getButtonStyles(theme, $color, $variant, $shadow, disabled, $loading)};\n ${({ $loading }) => ($loading ? 'opacity: 0.6;' : null)};\n`;\n\nexport const ButtonInner = styled('div')<ButtonStylesProps>`\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n line-height: 1;\n`;\n\nexport const ButtonLabel = styled('span')<ButtonStylesProps>`\n display: inherit;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const IconLeftSpan = styled('span')<ButtonStylesProps>`\n display: flex;\n align-items: center;\n margin-right: 10px;\n`;\n\nexport const IconRightSpan = styled('span')<ButtonStylesProps>`\n display: flex;\n align-items: center;\n margin-left: 10px;\n`;\n"],"names":[],"mappings":";;;AAEA,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK;AAChD,EAAE,IAAI,QAAQ,EAAE;AAChB,IAAI,OAAO,GAAG,CAAC;AACf;AACA;AACA,IAAI,CAAC,CAAC;AACN,GAAG;AACH,EAAE,IAAI,QAAQ,EAAE;AAChB,IAAI,OAAO,GAAG,CAAC;AACf;AACA;AACA,IAAI,CAAC,CAAC;AACN,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb;AACA;AACA,EAAE,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,MAAM,KAAK,GAAG;AACd,EAAE,EAAE,EAAE,GAAG,CAAC;AACV;AACA;AACA,EAAE,CAAC;AACH,EAAE,EAAE,EAAE,GAAG,CAAC;AACV;AACA;AACA,EAAE,CAAC;AACH,EAAE,EAAE,EAAE,GAAG,CAAC;AACV;AACA;AACA,EAAE,CAAC;AACH,EAAE,EAAE,EAAE,GAAG,CAAC;AACV;AACA;AACA,EAAE,CAAC;AACH,EAAE,EAAE,EAAE,GAAG,CAAC;AACV;AACA;AACA,EAAE,CAAC;AACH,CAAC,CAAC;A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A;AACA;;;;"}
@@ -1,2 +1,2 @@
1
- import s,{useMemo as b,useEffect as h}from"react";import{useUncontrolled as C}from"@kubed/hooks";import{isUndefined as c}from"lodash";import{Group as G}from"../Group/Group.js";import{CheckboxContext as j}from"./CheckboxContext.js";const i=({onChange:m,disabled:r,value:e,defaultValue:p,children:l})=>{const[t,n]=C({value:e,defaultValue:p,finalValue:[],rule:o=>!c(o),onChange:m}),f=(o,d)=>{if(!c(e))return;const u=t.filter(k=>k!==o),x=d?[...u,o]:u;n(x)},a=b(()=>({updateState:f,disabledAll:r,inGroup:!0,values:t}),[r,t.join(",")]);return e&&h(()=>{n(e)},[e.join(",")]),s.createElement(j.Provider,{value:a},s.createElement(G,null,l))};i.displayName="@kubed/components/CheckboxGroup";export{i as CheckboxGroup};
1
+ import c,{useMemo as C,useEffect as G}from"react";import{useUncontrolled as h}from"@kubed/hooks";import{isUndefined as i}from"lodash";import{Group as j}from"../Group/Group.js";import{CheckboxContext as E}from"./CheckboxContext.js";const m=({onChange:p,disabled:r,value:e,defaultValue:l,children:n,unstyled:f})=>{const[t,u]=h({value:e,defaultValue:l,finalValue:[],rule:o=>!i(o),onChange:p}),a=(o,x)=>{if(!i(e))return;const s=t.filter(b=>b!==o),k=x?[...s,o]:s;u(k)},d=C(()=>({updateState:a,disabledAll:r,inGroup:!0,values:t}),[r,t.join(",")]);return e&&G(()=>{u(e)},[e.join(",")]),c.createElement(E.Provider,{value:d},f?n:c.createElement(j,null,n))};m.displayName="@kubed/components/CheckboxGroup";export{m as CheckboxGroup};
2
2
  //# sourceMappingURL=CheckboxGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxGroup.js","sources":["../../src/Checkbox/CheckboxGroup.tsx"],"sourcesContent":["import React, { useMemo, useEffect } from 'react';\nimport { useUncontrolled } from '@kubed/hooks';\nimport { isUndefined } from 'lodash';\nimport { Group } from '../Group/Group';\nimport { CheckboxContext } from './CheckboxContext';\n\ninterface Props {\n value?: string[];\n defaultValue?: string[];\n disabled?: boolean;\n onChange?: (values: string[]) => void;\n}\n\ntype NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;\nexport type CheckboxGroupProps = Props & NativeAttrs;\n\nexport const CheckboxGroup: React.FC<React.PropsWithChildren<CheckboxGroupProps>> = ({\n onChange,\n disabled,\n value,\n defaultValue,\n children,\n}: CheckboxGroupProps) => {\n const [_value, setValue] = useUncontrolled({\n value,\n defaultValue,\n finalValue: [],\n rule: (val) => !isUndefined(val),\n onChange,\n });\n\n const updateState = (val, checked) => {\n if (!isUndefined(value)) return;\n const removed = _value.filter((v) => v !== val);\n const next = checked ? [...removed, val] : removed;\n setValue(next);\n };\n\n const providerValue = useMemo(() => {\n return {\n updateState,\n disabledAll: disabled,\n inGroup: true,\n values: _value,\n };\n }, [disabled, _value.join(',')]);\n\n if (value) {\n useEffect(() => {\n setValue(value);\n }, [value.join(',')]);\n }\n\n return (\n <CheckboxContext.Provider value={providerValue}>\n <Group>{children}</Group>\n </CheckboxContext.Provider>\n );\n};\n\nCheckboxGroup.displayName = '@kubed/components/CheckboxGroup';\n"],"names":["React"],"mappings":";;;;;;AAKY,MAAC,aAAa,GAAG,CAAC;AAC9B,EAAE,QAAQ;AACV,EAAE,QAAQ;AACV,EAAE,KAAK;AACP,EAAE,YAAY;AACd,EAAE,QAAQ;AACV,CAAC,KAAK;AACN,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,eAAe,CAAC;AAC7C,IAAI,KAAK;AACT,IAAI,YAAY;AAChB,IAAI,UAAU,EAAE,EAAE;AAClB,IAAI,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;AACpC,IAAI,QAAQ;AACZ,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK;AACxC,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3B,MAAM,OAAO;AACb,IAAI,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;AACpD,IAAI,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,GAAG,OAAO,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;AACvD,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnB,GAAG,CAAC;AACJ,EAAE,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM;AACtC,IAAI,OAAO;AACX,MAAM,WAAW;AACjB,MAAM,WAAW,EAAE,QAAQ;AAC3B,MAAM,OAAO,EAAE,IAAI;AACnB,MAAM,MAAM,EAAE,MAAM;AACpB,KAAK,CAAC;AACN,GAAG,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnC,EAAE,IAAI,KAAK,EAAE;AACb,IAAI,SAAS,CAAC,MAAM;AACpB,MAAM,QAAQ,CAAC,KAAK,CAAC,CAAC;AACtB,KAAK,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1B,GAAG;AACH,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAAC,eAAe,CAAC,QAAQ,EAAE;AACvE,IAAI,KAAK,EAAE,aAAa;AACxB,GAAG,kBAAkBA,cAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;AACjE,EAAE;AACF,aAAa,CAAC,WAAW,GAAG,iCAAiC;;;;"}
1
+ {"version":3,"file":"CheckboxGroup.js","sources":["../../src/Checkbox/CheckboxGroup.tsx"],"sourcesContent":["import React, { useMemo, useEffect } from 'react';\nimport { useUncontrolled } from '@kubed/hooks';\nimport { isUndefined } from 'lodash';\nimport { Group } from '../Group/Group';\nimport { CheckboxContext } from './CheckboxContext';\n\ninterface Props {\n value?: string[];\n defaultValue?: string[];\n disabled?: boolean;\n onChange?: (values: string[]) => void;\n unstyled?: boolean;\n}\n\ntype NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;\nexport type CheckboxGroupProps = Props & NativeAttrs;\n\nexport const CheckboxGroup: React.FC<React.PropsWithChildren<CheckboxGroupProps>> = ({\n onChange,\n disabled,\n value,\n defaultValue,\n children,\n unstyled,\n}: CheckboxGroupProps) => {\n const [_value, setValue] = useUncontrolled({\n value,\n defaultValue,\n finalValue: [],\n rule: (val) => !isUndefined(val),\n onChange,\n });\n\n const updateState = (val, checked) => {\n if (!isUndefined(value)) return;\n const removed = _value.filter((v) => v !== val);\n const next = checked ? [...removed, val] : removed;\n setValue(next);\n };\n\n const providerValue = useMemo(() => {\n return {\n updateState,\n disabledAll: disabled,\n inGroup: true,\n values: _value,\n };\n }, [disabled, _value.join(',')]);\n\n if (value) {\n useEffect(() => {\n setValue(value);\n }, [value.join(',')]);\n }\n\n return (\n <CheckboxContext.Provider value={providerValue}>\n {unstyled ? children : <Group>{children}</Group>}\n </CheckboxContext.Provider>\n );\n};\n\nCheckboxGroup.displayName = '@kubed/components/CheckboxGroup';\n"],"names":["React"],"mappings":";;;;;;AAKY,MAAC,aAAa,GAAG,CAAC;AAC9B,EAAE,QAAQ;AACV,EAAE,QAAQ;AACV,EAAE,KAAK;AACP,EAAE,YAAY;AACd,EAAE,QAAQ;AACV,EAAE,QAAQ;AACV,CAAC,KAAK;AACN,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,eAAe,CAAC;AAC7C,IAAI,KAAK;AACT,IAAI,YAAY;AAChB,IAAI,UAAU,EAAE,EAAE;AAClB,IAAI,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;AACpC,IAAI,QAAQ;AACZ,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK;AACxC,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3B,MAAM,OAAO;AACb,IAAI,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;AACpD,IAAI,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,GAAG,OAAO,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;AACvD,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnB,GAAG,CAAC;AACJ,EAAE,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM;AACtC,IAAI,OAAO;AACX,MAAM,WAAW;AACjB,MAAM,WAAW,EAAE,QAAQ;AAC3B,MAAM,OAAO,EAAE,IAAI;AACnB,MAAM,MAAM,EAAE,MAAM;AACpB,KAAK,CAAC;AACN,GAAG,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnC,EAAE,IAAI,KAAK,EAAE;AACb,IAAI,SAAS,CAAC,MAAM;AACpB,MAAM,QAAQ,CAAC,KAAK,CAAC,CAAC;AACtB,KAAK,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1B,GAAG;AACH,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAAC,eAAe,CAAC,QAAQ,EAAE;AACvE,IAAI,KAAK,EAAE,aAAa;AACxB,GAAG,EAAE,QAAQ,GAAG,QAAQ,mBAAmBA,cAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;AACvF,EAAE;AACF,aAAa,CAAC,WAAW,GAAG,iCAAiC;;;;"}
@@ -1,2 +1,2 @@
1
- import r from"react";import{Description as a}from"./Description.js";export{Description}from"./Description.js";function t({variant:n="default",data:o=[]}){return r.createElement(r.Fragment,null,o.map((e,i)=>r.createElement(a,{variant:n,label:e.label,key:String(e.value)||`key-${i}`},e.value)))}t.displayName="@kubed/components/Descriptions";export{t as Descriptions};
1
+ import e from"react";import{Description as p}from"./Description.js";export{Description}from"./Description.js";function r({variant:i="default",data:n=[]}){return e.createElement(e.Fragment,null,n.map((t,o)=>e.createElement(p,{variant:i,label:t.label,key:`description-${o}`},t.value)))}r.displayName="@kubed/components/Descriptions";export{r as Descriptions};
2
2
  //# sourceMappingURL=Descriptions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Descriptions.js","sources":["../../src/Descriptions/Descriptions.tsx"],"sourcesContent":["import React from 'react';\nimport { DefaultProps } from '../theme';\nimport { Description } from './Description';\n\nexport { Description };\n\ntype DescriptionItem = {\n label: React.ReactNode;\n value: React.ReactNode;\n};\n\nexport interface DescriptionsProps extends DefaultProps {\n /** Controls Description appearance */\n variant?: 'default' | 'unstyled';\n\n /** Description data */\n data?: DescriptionItem[];\n}\n\nexport function Descriptions({ variant = 'default', data = [] }: DescriptionsProps) {\n return (\n <>\n {data.map((item, index) => {\n return (\n <Description\n variant={variant}\n label={item.label}\n key={String(item.value) || `key-${index}`}\n >\n {item.value}\n </Description>\n );\n })}\n </>\n );\n}\n\nDescriptions.displayName = '@kubed/components/Descriptions';\n"],"names":["React"],"mappings":";;;;AAGO,SAAS,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,EAAE,IAAI,GAAG,EAAE,EAAE,EAAE;AACjE,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAACA,cAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK;AAC7F,IAAI,uBAAuBA,cAAK,CAAC,aAAa,CAAC,WAAW,EAAE;AAC5D,MAAM,OAAO;AACb,MAAM,KAAK,EAAE,IAAI,CAAC,KAAK;AACvB,MAAM,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC/C,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;AACnB,GAAG,CAAC,CAAC,CAAC;AACN,CAAC;AACD,YAAY,CAAC,WAAW,GAAG,gCAAgC;;;;"}
1
+ {"version":3,"file":"Descriptions.js","sources":["../../src/Descriptions/Descriptions.tsx"],"sourcesContent":["import React from 'react';\nimport { DefaultProps } from '../theme';\nimport { Description } from './Description';\n\nexport { Description };\n\ntype DescriptionItem = {\n label: React.ReactNode;\n value: React.ReactNode;\n};\n\nexport interface DescriptionsProps extends DefaultProps {\n /** Controls Description appearance */\n variant?: 'default' | 'unstyled';\n\n /** Description data */\n data?: DescriptionItem[];\n}\n\nexport function Descriptions({ variant = 'default', data = [] }: DescriptionsProps) {\n return (\n <>\n {data.map((item, index) => {\n return (\n <Description variant={variant} label={item.label} key={`description-${index}`}>\n {item.value}\n </Description>\n );\n })}\n </>\n );\n}\n\nDescriptions.displayName = '@kubed/components/Descriptions';\n"],"names":["React"],"mappings":";;;;AAGO,SAAS,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,EAAE,IAAI,GAAG,EAAE,EAAE,EAAE;AACjE,EAAE,uBAAuBA,cAAK,CAAC,aAAa,CAACA,cAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK;AAC7F,IAAI,uBAAuBA,cAAK,CAAC,aAAa,CAAC,WAAW,EAAE;AAC5D,MAAM,OAAO;AACb,MAAM,KAAK,EAAE,IAAI,CAAC,KAAK;AACvB,MAAM,GAAG,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AACjC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;AACnB,GAAG,CAAC,CAAC,CAAC;AACN,CAAC;AACD,YAAY,CAAC,WAAW,GAAG,gCAAgC;;;;"}
@@ -0,0 +1,11 @@
1
+ import a,{useState as s,useRef as E,useEffect as H}from"react";import f from"styled-components";import P from"../utils/forwardRef.js";var L=Object.defineProperty,i=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,p=(e,r,t)=>r in e?L(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,j=(e,r)=>{for(var t in r||(r={}))h.call(r,t)&&p(e,t,r[t]);if(i)for(var t of i(r))m.call(r,t)&&p(e,t,r[t]);return e},C=(e,r)=>{var t={};for(var o in e)h.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&i)for(var o of i(e))r.indexOf(o)<0&&m.call(e,o)&&(t[o]=e[o]);return t};const D=f.div`
2
+ position: relative;
3
+ `,N=f("div")`
4
+ display: flex;
5
+ flex-direction: column;
6
+ overflow: hidden;
7
+ transition-property: max-height;
8
+ transition-duration: ${({$transitionDuration:e})=>e}ms;
9
+ transition-timing-function: ease-in-out;
10
+ `,I=f.div``,u=P((e,r)=>{var t=e,{expanded:o=!1,maxHeight:l=100,transitionDuration:w=300,hideLabel:v,showLabel:_,children:c,controlRef:$}=t,g=C(t,["expanded","maxHeight","transitionDuration","hideLabel","showLabel","children","controlRef"]);const[d,y]=s(o),[b,S]=s(o),[x,O]=s(null),n=E(null),M=d?v:_;return H(()=>{n.current&&(S(l<n.current.offsetHeight),O(n.current.offsetHeight))},[l,c]),a.createElement(D,j({ref:r},g),a.createElement(N,{$transitionDuration:w,style:{maxHeight:d?x||void 0:l}},a.createElement("div",{ref:n},c)),b&&a.createElement(I,{className:"showmore-button",ref:n,onClick:()=>y(R=>!R)},M))});u.displayName="@kubed/components/ShowMore";export{u as ShowMore};
11
+ //# sourceMappingURL=ShowMore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShowMore.js","sources":["../../src/ShowMore/ShowMore.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\nimport styled from 'styled-components';\nimport forwardRef from '../utils/forwardRef';\nimport { DefaultProps } from '../theme';\n\nconst ShowMoreWrapper = styled.div`\n position: relative;\n`;\n\ninterface ShowMoreContentProps {\n $transitionDuration?: number;\n}\n\nconst ShowMoreContent = styled('div')<ShowMoreContentProps>`\n display: flex;\n flex-direction: column;\n overflow: hidden;\n transition-property: max-height;\n transition-duration: ${({ $transitionDuration }) => $transitionDuration}ms;\n transition-timing-function: ease-in-out;\n`;\n\nconst ShowMoreButton = styled.div``;\n\nexport interface FilterInputProps extends DefaultProps {\n /** Max height of visible content, when this point is reached ShowMore appears */\n maxHeight: number;\n\n /** Label for close ShowMore action */\n hideLabel: React.ReactNode;\n\n /** Label for open ShowMore action */\n showLabel: React.ReactNode;\n\n /** Get ref of ShowMore toggle button */\n controlRef?: React.ForwardedRef<HTMLButtonElement>;\n\n /** Initial ShowMore state, true to wrap content in ShowMore, false to show content without ShowMore, opened state will be updated on mount */\n expanded?: boolean;\n\n /** ShowMore reveal transition duration in ms, 0 or null to turn off animation */\n transitionDuration?: number;\n}\n\nexport const ShowMore = forwardRef<FilterInputProps, 'div'>(\n (\n {\n expanded = false,\n maxHeight = 100,\n transitionDuration = 300,\n hideLabel,\n showLabel,\n children,\n controlRef,\n ...rest\n },\n ref\n ) => {\n const [show, setShowState] = useState(expanded);\n const [showMore, setShowMore] = useState(expanded);\n const [contentHeight, setContentHeight] = useState<number>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const showMoreLabel = show ? hideLabel : showLabel;\n\n useEffect(() => {\n if (contentRef.current) {\n setShowMore(maxHeight < contentRef.current.offsetHeight);\n setContentHeight(contentRef.current.offsetHeight);\n }\n }, [maxHeight, children]);\n\n return (\n <ShowMoreWrapper ref={ref} {...rest}>\n <ShowMoreContent\n $transitionDuration={transitionDuration}\n style={{ maxHeight: !show ? maxHeight : contentHeight || undefined }}\n >\n <div ref={contentRef}>{children}</div>\n </ShowMoreContent>\n {showMore && (\n <ShowMoreButton\n className=\"showmore-button\"\n ref={contentRef}\n onClick={() => setShowState((opened) => !opened)}\n >\n {showMoreLabel}\n </ShowMoreButton>\n )}\n </ShowMoreWrapper>\n );\n }\n);\n\nShowMore.displayName = '@kubed/components/ShowMore';\n"],"names":["React"],"mappings":";;;;AAAA,IAAI,SAAS,GAAG,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,cAAc,EAAE;AACjF,IAAI,SAAS,EAAE,iBAAiB;AAChC,IAAI,GAAG,EAAE,UAAU;AACnB,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC;AACpD,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC;AACrB,CAAC,EAAE;AACH,QAAQ,CAAC,WAAW,GAAG,4BAA4B;;;;"}
package/esm/Tabs/Tabs.js CHANGED
@@ -1,2 +1,2 @@
1
- import a,{useState as T,useRef as O,useEffect as W}from"react";import $ from"classnames";import{useUncontrolled as U,useId as q,useReducedMotion as H}from"@kubed/hooks";import{Group as J}from"../Group/Group.js";import Q from"../utils/toArray.js";import{WRAPPER_PADDING as E,TabControl as X,TabControlLabel as Z,TabsContainer as ee,TabControlList as te,PillsBg as re,LineBg as ne,TabPanel as ie}from"./Tabs.styles.js";var ae=Object.defineProperty,oe=Object.defineProperties,le=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,R=(t,e,r)=>e in t?ae(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e||(e={}))C.call(e,r)&&R(t,r,e[r]);if(h)for(var r of h(e))A.call(e,r)&&R(t,r,e[r]);return t},se=(t,e)=>oe(t,le(e)),ce=(t,e)=>{var r={};for(var n in t)C.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&h)for(var n of h(t))e.indexOf(n)<0&&A.call(t,n)&&(r[n]=t[n]);return r};const ue={horizontal:"row",vertical:"column"},fe=t=>{for(let e=0;e<t.length;e+=1)if(!t[e].disabled)return t[e].key;return-1},de=t=>Q(t).map(e=>{if(a.isValidElement(e)){const r=e.key!==void 0?String(e.key):void 0;return se(j({key:r},e.props),{node:e})}return null});function k(t){var e=t,{children:r,name:n,variant:o="pills",activeKey:D,defaultActiveKey:x,onTabChange:z,color:_,grow:y,radius:p="lg",size:P="sm",position:f="left",direction:d="horizontal",tabPadding:B="xs",transitionDuration:K=150,transitionTimingFunction:N}=e,S=ce(e,["children","name","variant","activeKey","defaultActiveKey","onTabChange","color","grow","radius","size","position","direction","tabPadding","transitionDuration","transitionTimingFunction"]);const[w,G]=T(!1),v=de(r),[l,I]=U({value:D,defaultValue:x,finalValue:fe(v),onChange:z,rule:i=>!!i}),[s,L]=T({width:0,height:0,translate:0,translateY:0}),M=q(n),V=H(),g=O({}),m=O(null);W(()=>{if(o==="outline")return null;const i=new ResizeObserver(()=>{if(l in g.current&&m.current){const u=g.current[l].getBoundingClientRect();L({width:u.width,height:u.height,translate:u.x-m.current.getBoundingClientRect().x-E,translateY:u.y-m.current.getBoundingClientRect().y-E}),w||setTimeout(()=>{G(!0)},4)}});return i.observe(m.current),()=>i.disconnect()},[l]);const Y=v.map(i=>{const{key:c,label:u}=i,b=l===c;return a.createElement(X,{key:c,active:b,radius:p,size:P,reduceMotion:V||!w,transitionTimingFunction:N,transitionDuration:K,className:$("tab-item",{"tab-item__active":b})},a.createElement(Z,{active:b,htmlFor:`${M}-${c}`,ref:F=>{g.current[c]=F},onClick:()=>I(c)},u))});return a.createElement(ee,j({variant:o,direction:d,position:f},S),a.createElement(te,{variant:o,fullWidth:y,radius:p,size:P,position:f,direction:d,ref:m},!!l&&o!=="outline"&&(o==="pills"?a.createElement(re,{variant:o,radius:p,color:_,width:s.width,transform:s.translate}):a.createElement(ne,{variant:o,radius:p,color:_,direction:d,position:f,width:s.width,height:s.height,transform:s.translate,translateY:s.translateY})),a.createElement(J,{grow:y,spacing:0,position:f,direction:ue[d],className:"tab-group"},Y)),a.createElement(ie,{direction:d,position:f,variant:o,tabPadding:B},v.map(i=>i.key===l?i.children:null)))}k.displayName="@kubed/components/Tabs";export{k as Tabs};
1
+ import i,{useState as T,useRef as O,useEffect as W}from"react";import $ from"classnames";import{useUncontrolled as U,useId as q,useReducedMotion as H}from"@kubed/hooks";import{Group as J}from"../Group/Group.js";import Q from"../utils/toArray.js";import{WRAPPER_PADDING as E,TabControl as X,TabControlLabel as Z,TabsContainer as ee,TabControlList as te,PillsBg as re,LineBg as ne,TabPanel as ae}from"./Tabs.styles.js";var ie=Object.defineProperty,oe=Object.defineProperties,le=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,R=(t,e,r)=>e in t?ie(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e||(e={}))C.call(e,r)&&R(t,r,e[r]);if(g)for(var r of g(e))A.call(e,r)&&R(t,r,e[r]);return t},se=(t,e)=>oe(t,le(e)),ce=(t,e)=>{var r={};for(var n in t)C.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&g)for(var n of g(t))e.indexOf(n)<0&&A.call(t,n)&&(r[n]=t[n]);return r};const ue={horizontal:"row",vertical:"column"},me=t=>{for(let e=0;e<t.length;e+=1)if(!t[e].disabled)return t[e].key;return-1},fe=t=>Q(t).map(e=>{if(i.isValidElement(e)){const r=e.key!==void 0?String(e.key):void 0;return se(j({key:r},e.props),{node:e})}return null});function k(t){var e=t,{children:r,name:n,variant:o="pills",activeKey:D,defaultActiveKey:N,onTabChange:x,color:h,grow:y,radius:p="lg",size:P="sm",position:m="left",direction:f="horizontal",tabPadding:z="xs",transitionDuration:B=150,transitionTimingFunction:K}=e,S=ce(e,["children","name","variant","activeKey","defaultActiveKey","onTabChange","color","grow","radius","size","position","direction","tabPadding","transitionDuration","transitionTimingFunction"]);const[w,G]=T(!1),v=fe(r),[l,I]=U({value:D,defaultValue:N,finalValue:me(v),onChange:x,rule:a=>!!a}),[s,L]=T({width:0,height:0,translate:0,translateY:0}),M=q(n),V=H(),b=O({}),d=O(null);W(()=>{if(o==="outline")return null;const a=new ResizeObserver(()=>{if(l in b.current&&d.current){const u=b.current[l].getBoundingClientRect();L({width:u.width,height:u.height,translate:u.x-d.current.getBoundingClientRect().x-E,translateY:u.y-d.current.getBoundingClientRect().y-E}),w||setTimeout(()=>{G(!0)},4)}});return a.observe(d.current),()=>a.disconnect()},[l]);const Y=v.map(a=>{const{key:c,label:u}=a,_=l===c;return i.createElement(X,{key:c,active:_,radius:p,size:P,reduceMotion:V||!w,transitionTimingFunction:K,transitionDuration:B,className:$("tab-item",{"tab-item__active":_})},i.createElement(Z,{active:_,htmlFor:`${M}-${c}`,ref:F=>{b.current[c]=F},onClick:()=>I(c),className:"tab-label"},u))});return i.createElement(ee,j({variant:o,direction:f,position:m},S),i.createElement(te,{variant:o,fullWidth:y,radius:p,size:P,position:m,direction:f,color:h,ref:d},!!l&&o!=="outline"&&(o==="pills"?i.createElement(re,{variant:o,radius:p,color:h,width:s.width,transform:s.translate}):i.createElement(ne,{variant:o,radius:p,color:h,direction:f,position:m,width:s.width,height:s.height,transform:s.translate,translateY:s.translateY,className:"line-bg"})),i.createElement(J,{grow:y,spacing:0,position:m,direction:ue[f],className:"tab-group"},Y)),i.createElement(ae,{direction:f,position:m,variant:o,tabPadding:z},v.map(a=>a.key===l?a.children:null)))}k.displayName="@kubed/components/Tabs";export{k as Tabs};
2
2
  //# sourceMappingURL=Tabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.js","sources":["../../src/Tabs/Tabs.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport cx from 'classnames';\nimport { useId, useUncontrolled, useReducedMotion } from '@kubed/hooks';\nimport { KubedNumberSize, KubedSizes } from '../theme';\nimport { Group, GroupPosition, GroupDirection } from '../Group/Group';\nimport { Tab, TabProps } from './Tab/Tab';\nimport toArray from '../utils/toArray';\n\nimport {\n TabsContainer,\n TabControlList,\n TabControl,\n TabControlLabel,\n TabPanel,\n WRAPPER_PADDING,\n PillsBg,\n LineBg,\n} from './Tabs.styles';\n\nexport { Tab };\nexport type { TabProps };\n\nconst directionMapping = {\n horizontal: 'row',\n vertical: 'column',\n};\n\nconst findDefaultTab = (tabs: TabProps[]) => {\n for (let i = 0; i < tabs.length; i += 1) {\n if (!tabs[i].disabled) {\n return tabs[i].key;\n }\n }\n\n return -1;\n};\n\nexport interface TabsProps\n extends Omit<React.ComponentPropsWithoutRef<'div'>, 'value' | 'onChange'> {\n /** Current selected value */\n variant?: 'pills' | 'line' | 'outline';\n\n /** Current selected value */\n activeKey?: string;\n\n /** Default value for uncontrolled component */\n defaultActiveKey?: string;\n\n /** Called when value changes */\n onChange?(value: string): void;\n\n /** Name of the radio group, default to random id */\n name?: string;\n\n /** True if component should have 100% width */\n grow?: boolean;\n\n /** Active control color from theme, defaults to white in light color scheme and theme.colors.dark[9] in dark */\n color?: string | 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n\n /** Controls font-size, paddings and height */\n size?: KubedSizes;\n\n /** Border-radius from theme or number to set border-radius in px */\n radius?: KubedNumberSize;\n\n /** Tab controls position */\n position?: GroupPosition;\n\n /** Tab controls direction */\n direction?: 'horizontal' | 'vertical';\n\n /** Controls tab content padding-top */\n tabPadding?: KubedNumberSize;\n\n /** Called when tab control is clicked with tab index */\n onTabChange?(tabKey: string): void;\n\n /** Transition duration in ms, set to 0 to turn off transitions */\n transitionDuration?: number;\n\n /** Transition timing function for all transitions, defaults to theme.transitionTimingFunction */\n transitionTimingFunction?: string;\n}\n\nconst parseTabList = (children: React.ReactNode): TabProps[] => {\n return toArray(children).map((node: React.ReactElement<TabProps>) => {\n if (React.isValidElement(node)) {\n const key = node.key !== undefined ? String(node.key) : undefined;\n return {\n key,\n ...node.props,\n node,\n };\n }\n return null;\n });\n};\n\nexport function Tabs({\n children,\n name,\n variant = 'pills',\n activeKey,\n defaultActiveKey,\n onTabChange,\n color,\n grow,\n radius = 'lg',\n size = 'sm',\n position = 'left',\n direction = 'horizontal',\n tabPadding = 'xs',\n transitionDuration = 150,\n transitionTimingFunction,\n ...others\n}: TabsProps) {\n const [shouldAnimate, setShouldAnimate] = useState(false);\n const tabs = parseTabList(children);\n\n const [_activeKey, handleActiveTabChange] = useUncontrolled({\n value: activeKey,\n defaultValue: defaultActiveKey,\n finalValue: findDefaultTab(tabs),\n onChange: onTabChange,\n rule: (val) => !!val,\n });\n\n const [activePosition, setActivePosition] = useState({\n width: 0,\n height: 0,\n translate: 0,\n translateY: 0,\n });\n const uuid = useId(name);\n const reduceMotion = useReducedMotion();\n const refs = useRef<Record<string, HTMLLabelElement>>({});\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (variant === 'outline') return null;\n const observer = new ResizeObserver(() => {\n if (_activeKey in refs.current && wrapperRef.current) {\n const element = refs.current[_activeKey];\n const rect = element.getBoundingClientRect();\n setActivePosition({\n width: rect.width,\n height: rect.height,\n translate: rect.x - wrapperRef.current.getBoundingClientRect().x - WRAPPER_PADDING,\n translateY: rect.y - wrapperRef.current.getBoundingClientRect().y - WRAPPER_PADDING,\n });\n\n if (!shouldAnimate) {\n setTimeout(() => {\n setShouldAnimate(true);\n }, 4);\n }\n }\n });\n observer.observe(wrapperRef.current);\n return () => observer.disconnect();\n }, [_activeKey]);\n\n const items = tabs.map((item) => {\n const { key, label } = item;\n const isActive = _activeKey === key;\n return (\n <TabControl\n key={key}\n active={isActive}\n radius={radius}\n size={size}\n reduceMotion={reduceMotion || !shouldAnimate}\n transitionTimingFunction={transitionTimingFunction}\n transitionDuration={transitionDuration}\n className={cx('tab-item', { 'tab-item__active': isActive })}\n >\n <TabControlLabel\n active={isActive}\n htmlFor={`${uuid}-${key}`}\n ref={(node) => {\n refs.current[key] = node;\n }}\n onClick={() => handleActiveTabChange(key)}\n >\n {label}\n </TabControlLabel>\n </TabControl>\n );\n });\n\n return (\n <TabsContainer variant={variant} direction={direction} position={position} {...others}>\n <TabControlList\n variant={variant}\n fullWidth={grow}\n radius={radius}\n size={size}\n position={position}\n direction={direction}\n ref={wrapperRef}\n >\n {!!_activeKey &&\n variant !== 'outline' &&\n (variant === 'pills' ? (\n <PillsBg\n variant={variant}\n radius={radius}\n color={color}\n width={activePosition.width}\n transform={activePosition.translate}\n />\n ) : (\n <LineBg\n variant={variant}\n radius={radius}\n color={color}\n direction={direction}\n position={position}\n width={activePosition.width}\n height={activePosition.height}\n transform={activePosition.translate}\n translateY={activePosition.translateY}\n />\n ))}\n <Group\n grow={grow}\n spacing={0}\n position={position}\n direction={directionMapping[direction] as GroupDirection}\n className=\"tab-group\"\n >\n {items}\n </Group>\n </TabControlList>\n\n <TabPanel direction={direction} position={position} variant={variant} tabPadding={tabPadding}>\n {tabs.map((tab) => {\n if (tab.key === _activeKey) {\n return tab.children;\n }\n return null;\n })}\n </TabPanel>\n </TabsContainer>\n );\n}\n\nTabs.displayName = '@kubed/components/Tabs';\n"],"names":["React"],"mappings":";;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC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G,CAAC,QAAQ,CAAC;AAC1B,KAAK;AACL,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AACD,IAAI,CAAC,WAAW,GAAG,wBAAwB;;;;"}
1
+ {"version":3,"file":"Tabs.js","sources":["../../src/Tabs/Tabs.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport cx from 'classnames';\nimport { useId, useUncontrolled, useReducedMotion } from '@kubed/hooks';\nimport { KubedNumberSize, KubedSizes } from '../theme';\nimport { Group, GroupPosition, GroupDirection } from '../Group/Group';\nimport { Tab, TabProps } from './Tab/Tab';\nimport toArray from '../utils/toArray';\n\nimport {\n TabsContainer,\n TabControlList,\n TabControl,\n TabControlLabel,\n TabPanel,\n WRAPPER_PADDING,\n PillsBg,\n LineBg,\n} from './Tabs.styles';\n\nexport { Tab };\nexport type { TabProps };\n\nconst directionMapping = {\n horizontal: 'row',\n vertical: 'column',\n};\n\nconst findDefaultTab = (tabs: TabProps[]) => {\n for (let i = 0; i < tabs.length; i += 1) {\n if (!tabs[i].disabled) {\n return tabs[i].key;\n }\n }\n\n return -1;\n};\n\nexport interface TabsProps\n extends Omit<React.ComponentPropsWithoutRef<'div'>, 'value' | 'onChange'> {\n /** Current selected value */\n variant?: 'pills' | 'line' | 'outline';\n\n /** Current selected value */\n activeKey?: string;\n\n /** Default value for uncontrolled component */\n defaultActiveKey?: string;\n\n /** Called when value changes */\n onChange?(value: string): void;\n\n /** Name of the radio group, default to random id */\n name?: string;\n\n /** True if component should have 100% width */\n grow?: boolean;\n\n /** Active control color from theme, defaults to white in light color scheme and theme.colors.dark[9] in dark */\n color?: string | 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n\n /** Controls font-size, paddings and height */\n size?: KubedSizes;\n\n /** Border-radius from theme or number to set border-radius in px */\n radius?: KubedNumberSize;\n\n /** Tab controls position */\n position?: GroupPosition;\n\n /** Tab controls direction */\n direction?: 'horizontal' | 'vertical';\n\n /** Controls tab content padding-top */\n tabPadding?: KubedNumberSize;\n\n /** Called when tab control is clicked with tab index */\n onTabChange?(tabKey: string): void;\n\n /** Transition duration in ms, set to 0 to turn off transitions */\n transitionDuration?: number;\n\n /** Transition timing function for all transitions, defaults to theme.transitionTimingFunction */\n transitionTimingFunction?: string;\n}\n\nconst parseTabList = (children: React.ReactNode): TabProps[] => {\n return toArray(children).map((node: React.ReactElement<TabProps>) => {\n if (React.isValidElement(node)) {\n const key = node.key !== undefined ? String(node.key) : undefined;\n return {\n key,\n ...node.props,\n node,\n };\n }\n return null;\n });\n};\n\nexport function Tabs({\n children,\n name,\n variant = 'pills',\n activeKey,\n defaultActiveKey,\n onTabChange,\n color,\n grow,\n radius = 'lg',\n size = 'sm',\n position = 'left',\n direction = 'horizontal',\n tabPadding = 'xs',\n transitionDuration = 150,\n transitionTimingFunction,\n ...others\n}: TabsProps) {\n const [shouldAnimate, setShouldAnimate] = useState(false);\n const tabs = parseTabList(children);\n\n const [_activeKey, handleActiveTabChange] = useUncontrolled({\n value: activeKey,\n defaultValue: defaultActiveKey,\n finalValue: findDefaultTab(tabs),\n onChange: onTabChange,\n rule: (val) => !!val,\n });\n\n const [activePosition, setActivePosition] = useState({\n width: 0,\n height: 0,\n translate: 0,\n translateY: 0,\n });\n const uuid = useId(name);\n const reduceMotion = useReducedMotion();\n const refs = useRef<Record<string, HTMLLabelElement>>({});\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (variant === 'outline') return null;\n const observer = new ResizeObserver(() => {\n if (_activeKey in refs.current && wrapperRef.current) {\n const element = refs.current[_activeKey];\n const rect = element.getBoundingClientRect();\n setActivePosition({\n width: rect.width,\n height: rect.height,\n translate: rect.x - wrapperRef.current.getBoundingClientRect().x - WRAPPER_PADDING,\n translateY: rect.y - wrapperRef.current.getBoundingClientRect().y - WRAPPER_PADDING,\n });\n\n if (!shouldAnimate) {\n setTimeout(() => {\n setShouldAnimate(true);\n }, 4);\n }\n }\n });\n observer.observe(wrapperRef.current);\n return () => observer.disconnect();\n }, [_activeKey]);\n\n const items = tabs.map((item) => {\n const { key, label } = item;\n const isActive = _activeKey === key;\n return (\n <TabControl\n key={key}\n active={isActive}\n radius={radius}\n size={size}\n reduceMotion={reduceMotion || !shouldAnimate}\n transitionTimingFunction={transitionTimingFunction}\n transitionDuration={transitionDuration}\n className={cx('tab-item', { 'tab-item__active': isActive })}\n >\n <TabControlLabel\n active={isActive}\n htmlFor={`${uuid}-${key}`}\n ref={(node) => {\n refs.current[key] = node;\n }}\n onClick={() => handleActiveTabChange(key)}\n className=\"tab-label\"\n >\n {label}\n </TabControlLabel>\n </TabControl>\n );\n });\n\n return (\n <TabsContainer variant={variant} direction={direction} position={position} {...others}>\n <TabControlList\n variant={variant}\n fullWidth={grow}\n radius={radius}\n size={size}\n position={position}\n direction={direction}\n color={color}\n ref={wrapperRef}\n >\n {!!_activeKey &&\n variant !== 'outline' &&\n (variant === 'pills' ? (\n <PillsBg\n variant={variant}\n radius={radius}\n color={color}\n width={activePosition.width}\n transform={activePosition.translate}\n />\n ) : (\n <LineBg\n variant={variant}\n radius={radius}\n color={color}\n direction={direction}\n position={position}\n width={activePosition.width}\n height={activePosition.height}\n transform={activePosition.translate}\n translateY={activePosition.translateY}\n className=\"line-bg\"\n />\n ))}\n <Group\n grow={grow}\n spacing={0}\n position={position}\n direction={directionMapping[direction] as GroupDirection}\n className=\"tab-group\"\n >\n {items}\n </Group>\n </TabControlList>\n\n <TabPanel direction={direction} position={position} variant={variant} tabPadding={tabPadding}>\n {tabs.map((tab) => {\n if (tab.key === _activeKey) {\n return tab.children;\n }\n return null;\n })}\n </TabPanel>\n </TabsContainer>\n );\n}\n\nTabs.displayName = '@kubed/components/Tabs';\n"],"names":["React"],"mappings":";;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,G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