@kubed/components 0.0.33 → 0.0.36

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 (133) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/cjs/Button/Button.styles.js +1 -0
  3. package/cjs/Button/Button.styles.js.map +1 -1
  4. package/cjs/Collapse/Collapse.js +2 -0
  5. package/cjs/Collapse/Collapse.js.map +1 -0
  6. package/cjs/Collapse/Collapse.styles.js +12 -0
  7. package/cjs/Collapse/Collapse.styles.js.map +1 -0
  8. package/cjs/Collapse/CollapsePanel.js +2 -0
  9. package/cjs/Collapse/CollapsePanel.js.map +1 -0
  10. package/cjs/Entity/Entity.js +7 -7
  11. package/cjs/Entity/Entity.js.map +1 -1
  12. package/cjs/Loading/Loading.js +1 -12
  13. package/cjs/Loading/Loading.js.map +1 -1
  14. package/cjs/Loading/loaders/Circle.js +13 -0
  15. package/cjs/Loading/loaders/Circle.js.map +1 -0
  16. package/cjs/Loading/loaders/Oval.js +6 -0
  17. package/cjs/Loading/loaders/Oval.js.map +1 -0
  18. package/cjs/Progress/Progress.js +1 -1
  19. package/cjs/Progress/Progress.js.map +1 -1
  20. package/cjs/Steps/Step/Step.js +2 -0
  21. package/cjs/Steps/Step/Step.js.map +1 -0
  22. package/cjs/Steps/Step/Step.styles.js +59 -0
  23. package/cjs/Steps/Step/Step.styles.js.map +1 -0
  24. package/cjs/Steps/StepCompleted/StepCompleted.js +2 -0
  25. package/cjs/Steps/StepCompleted/StepCompleted.js.map +1 -0
  26. package/cjs/Steps/Steps.js +2 -0
  27. package/cjs/Steps/Steps.js.map +1 -0
  28. package/cjs/Steps/Steps.styles.js +48 -0
  29. package/cjs/Steps/Steps.styles.js.map +1 -0
  30. package/cjs/Steps/TabStep/TabStep.js +2 -0
  31. package/cjs/Steps/TabStep/TabStep.js.map +1 -0
  32. package/cjs/Steps/TabStep/TabStep.styles.js +84 -0
  33. package/cjs/Steps/TabStep/TabStep.styles.js.map +1 -0
  34. package/cjs/TypeSelect/TypeSelect.js +2 -0
  35. package/cjs/TypeSelect/TypeSelect.js.map +1 -0
  36. package/cjs/TypeSelect/TypeSelect.styles.js +52 -0
  37. package/cjs/TypeSelect/TypeSelect.styles.js.map +1 -0
  38. package/cjs/index.js +1 -1
  39. package/cjs/index.js.map +1 -1
  40. package/cjs/utils/motion.js +1 -1
  41. package/cjs/utils/motion.js.map +1 -1
  42. package/cjs/utils/reactNode.js +2 -0
  43. package/cjs/utils/reactNode.js.map +1 -0
  44. package/cjs/utils/toArray.js.map +1 -1
  45. package/cjs/utils/types.js.map +1 -1
  46. package/esm/Button/Button.styles.js +2 -1
  47. package/esm/Button/Button.styles.js.map +1 -1
  48. package/esm/Collapse/Collapse.js +2 -0
  49. package/esm/Collapse/Collapse.js.map +1 -0
  50. package/esm/Collapse/Collapse.styles.js +12 -0
  51. package/esm/Collapse/Collapse.styles.js.map +1 -0
  52. package/esm/Collapse/CollapsePanel.js +2 -0
  53. package/esm/Collapse/CollapsePanel.js.map +1 -0
  54. package/esm/Entity/Entity.js +10 -10
  55. package/esm/Entity/Entity.js.map +1 -1
  56. package/esm/Loading/Loading.js +1 -12
  57. package/esm/Loading/Loading.js.map +1 -1
  58. package/esm/Loading/loaders/Circle.js +13 -0
  59. package/esm/Loading/loaders/Circle.js.map +1 -0
  60. package/esm/Loading/loaders/Oval.js +6 -0
  61. package/esm/Loading/loaders/Oval.js.map +1 -0
  62. package/esm/Progress/Progress.js +1 -1
  63. package/esm/Progress/Progress.js.map +1 -1
  64. package/esm/Steps/Step/Step.js +2 -0
  65. package/esm/Steps/Step/Step.js.map +1 -0
  66. package/esm/Steps/Step/Step.styles.js +59 -0
  67. package/esm/Steps/Step/Step.styles.js.map +1 -0
  68. package/esm/Steps/StepCompleted/StepCompleted.js +2 -0
  69. package/esm/Steps/StepCompleted/StepCompleted.js.map +1 -0
  70. package/esm/Steps/Steps.js +2 -0
  71. package/esm/Steps/Steps.js.map +1 -0
  72. package/esm/Steps/Steps.styles.js +48 -0
  73. package/esm/Steps/Steps.styles.js.map +1 -0
  74. package/esm/Steps/TabStep/TabStep.js +2 -0
  75. package/esm/Steps/TabStep/TabStep.js.map +1 -0
  76. package/esm/Steps/TabStep/TabStep.styles.js +84 -0
  77. package/esm/Steps/TabStep/TabStep.styles.js.map +1 -0
  78. package/esm/TypeSelect/TypeSelect.js +2 -0
  79. package/esm/TypeSelect/TypeSelect.js.map +1 -0
  80. package/esm/TypeSelect/TypeSelect.styles.js +52 -0
  81. package/esm/TypeSelect/TypeSelect.styles.js.map +1 -0
  82. package/esm/index.js +1 -1
  83. package/esm/index.js.map +1 -1
  84. package/esm/utils/motion.js +1 -1
  85. package/esm/utils/motion.js.map +1 -1
  86. package/esm/utils/reactNode.js +2 -0
  87. package/esm/utils/reactNode.js.map +1 -0
  88. package/esm/utils/toArray.js.map +1 -1
  89. package/esm/utils/types.js.map +1 -1
  90. package/lib/src/Button/Button.styles.d.ts.map +1 -1
  91. package/lib/src/Collapse/Collapse.d.ts +37 -0
  92. package/lib/src/Collapse/Collapse.d.ts.map +1 -0
  93. package/lib/src/Collapse/Collapse.styles.d.ts +3 -0
  94. package/lib/src/Collapse/Collapse.styles.d.ts.map +1 -0
  95. package/lib/src/Collapse/CollapsePanel.d.ts +19 -0
  96. package/lib/src/Collapse/CollapsePanel.d.ts.map +1 -0
  97. package/lib/src/Entity/Entity.d.ts +3 -0
  98. package/lib/src/Entity/Entity.d.ts.map +1 -1
  99. package/lib/src/Loading/Loading.d.ts +10 -2
  100. package/lib/src/Loading/Loading.d.ts.map +1 -1
  101. package/lib/src/Loading/loaders/Circle.d.ts +12 -0
  102. package/lib/src/Loading/loaders/Circle.d.ts.map +1 -0
  103. package/lib/src/Loading/loaders/Oval.d.ts +4 -0
  104. package/lib/src/Loading/loaders/Oval.d.ts.map +1 -0
  105. package/lib/src/Progress/Progress.d.ts.map +1 -1
  106. package/lib/src/Slider/Slider.d.ts.map +1 -1
  107. package/lib/src/Steps/Step/Step.d.ts +38 -0
  108. package/lib/src/Steps/Step/Step.d.ts.map +1 -0
  109. package/lib/src/Steps/Step/Step.styles.d.ts +8 -0
  110. package/lib/src/Steps/Step/Step.styles.d.ts.map +1 -0
  111. package/lib/src/Steps/StepCompleted/StepCompleted.d.ts +10 -0
  112. package/lib/src/Steps/StepCompleted/StepCompleted.d.ts.map +1 -0
  113. package/lib/src/Steps/Steps.d.ts +37 -0
  114. package/lib/src/Steps/Steps.d.ts.map +1 -0
  115. package/lib/src/Steps/Steps.styles.d.ts +10 -0
  116. package/lib/src/Steps/Steps.styles.d.ts.map +1 -0
  117. package/lib/src/Steps/TabStep/TabStep.d.ts +42 -0
  118. package/lib/src/Steps/TabStep/TabStep.d.ts.map +1 -0
  119. package/lib/src/Steps/TabStep/TabStep.styles.d.ts +8 -0
  120. package/lib/src/Steps/TabStep/TabStep.styles.d.ts.map +1 -0
  121. package/lib/src/TypeSelect/TypeSelect.d.ts +20 -0
  122. package/lib/src/TypeSelect/TypeSelect.d.ts.map +1 -0
  123. package/lib/src/TypeSelect/TypeSelect.styles.d.ts +10 -0
  124. package/lib/src/TypeSelect/TypeSelect.styles.d.ts.map +1 -0
  125. package/lib/src/index.d.ts +3 -0
  126. package/lib/src/index.d.ts.map +1 -1
  127. package/lib/src/utils/reactNode.d.ts +8 -0
  128. package/lib/src/utils/reactNode.d.ts.map +1 -0
  129. package/lib/src/utils/toArray.d.ts.map +1 -1
  130. package/lib/src/utils/types.d.ts +3 -0
  131. package/lib/src/utils/types.d.ts.map +1 -1
  132. package/lib/tsconfig.tsbuildinfo +1 -1
  133. package/package.json +2 -1
@@ -0,0 +1,48 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var styled=require("styled-components");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var styled__default=_interopDefaultLegacy(styled);const StepsRoot=styled__default.div`
2
+ &.steps-vertical {
3
+ display: flex;
4
+
5
+ .steps-wrapper {
6
+ flex-direction: column;
7
+ align-items: unset;
8
+ }
9
+
10
+ .steps-tab {
11
+ flex-direction: column;
12
+ height: auto;
13
+ align-items: flex-start;
14
+ padding: 12px 0 12px 12px;
15
+ }
16
+
17
+ .steps-content {
18
+ padding-top: 0;
19
+ padding-left: 16px;
20
+ }
21
+ }
22
+ `,StepsWrapper=styled__default.div`
23
+ display: flex;
24
+ align-items: center;
25
+
26
+ &.steps-tab {
27
+ background-color: ${({theme:t})=>t.palette.accents_1};
28
+ height: 64px;
29
+ padding: 0 20px;
30
+ }
31
+ `,StepsContent=styled__default.div`
32
+ padding-top: 16px;
33
+ `,getSeparatorStyles=t=>t?styled.css`
34
+ flex: 1;
35
+ margin-left: 15px;
36
+ width: 2px;
37
+ min-height: 24px;
38
+ margin-top: 5px;
39
+ margin-bottom: 8px;
40
+ `:styled.css`
41
+ flex: 1 1 0%;
42
+ height: 2px;
43
+ margin: 0 10px;
44
+ `,StepsSeparator=styled__default("div")`
45
+ background-color: ${({$active:t,theme:e})=>t?"#00aa72":e.palette.accents_2};
46
+ ${({$vertical:t})=>getSeparatorStyles(t)};
47
+ `;exports.StepsContent=StepsContent,exports.StepsRoot=StepsRoot,exports.StepsSeparator=StepsSeparator,exports.StepsWrapper=StepsWrapper;
48
+ //# sourceMappingURL=Steps.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Steps.styles.js","sources":["../../src/Steps/Steps.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\n\nexport const StepsRoot = styled.div`\n &.steps-vertical {\n display: flex;\n\n .steps-wrapper {\n flex-direction: column;\n align-items: unset;\n }\n\n .steps-tab {\n flex-direction: column;\n height: auto;\n align-items: flex-start;\n padding: 12px 0 12px 12px;\n }\n\n .steps-content {\n padding-top: 0;\n padding-left: 16px;\n }\n }\n`;\n\nexport const StepsWrapper = styled.div`\n display: flex;\n align-items: center;\n\n &.steps-tab {\n background-color: ${({ theme }) => theme.palette.accents_1};\n height: 64px;\n padding: 0 20px;\n }\n`;\n\nexport const StepsContent = styled.div`\n padding-top: 16px;\n`;\n\ninterface SeparatorProps {\n $active: boolean;\n $vertical: boolean;\n}\n\nconst getSeparatorStyles = (vertical) => {\n if (vertical) {\n return css`\n flex: 1;\n margin-left: 15px;\n width: 2px;\n min-height: 24px;\n margin-top: 5px;\n margin-bottom: 8px;\n `;\n }\n return css`\n flex: 1 1 0%;\n height: 2px;\n margin: 0 10px;\n `;\n};\n\nexport const StepsSeparator = styled('div')<SeparatorProps>`\n background-color: ${({ $active, theme }) => ($active ? '#00aa72' : theme.palette.accents_2)};\n ${({ $vertical }) => getSeparatorStyles($vertical)};\n`;\n"],"names":["styled","css"],"mappings":";;;;;;;;;;AACY,MAAC,SAAS,GAAGA,eAAM,CAAC,GAAG,CAAC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACU,MAAC,YAAY,GAAGA,eAAM,CAAC,GAAG,CAAC;AACvC;AACA;AACA;AACA;AACA,sBAAsB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAC/D;AACA;AACA;AACA,EAAE;AACU,MAAC,YAAY,GAAGA,eAAM,CAAC,GAAG,CAAC;AACvC;AACA,EAAE;AACF,MAAM,kBAAkB,GAAG,CAAC,QAAQ,KAAK;AACzC,EAAE,IAAI,QAAQ,EAAE;AAChB,IAAI,OAAOC,UAAG,CAAC;AACf;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,CAAC,CAAC;AACN,GAAG;AACH,EAAE,OAAOA,UAAG,CAAC;AACb;AACA;AACA;AACA,EAAE,CAAC,CAAC;AACJ,CAAC,CAAC;AACU,MAAC,cAAc,GAAGD,eAAM,CAAC,KAAK,CAAC,CAAC;AAC5C,oBAAoB,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAC5F,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,kBAAkB,CAAC,SAAS,CAAC,CAAC;AACrD;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),cx=require("classnames"),icons=require("@kubed/icons"),forwardRef=require("../../utils/forwardRef.js"),Loading=require("../../Loading/Loading.js"),TabStep_styles=require("./TabStep.styles.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var React__default=_interopDefaultLegacy(React),cx__default=_interopDefaultLegacy(cx),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__objRest=(e,t)=>{var r={};for(var a in e)__hasOwnProp.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&__getOwnPropSymbols)for(var a of __getOwnPropSymbols(e))t.indexOf(a)<0&&__propIsEnum.call(e,a)&&(r[a]=e[a]);return r};const defaultIconSizes={xs:16,sm:18,md:20,lg:22,xl:24},TabStep=forwardRef.default((e,t)=>{var r=e,{className:a,state:o,color:m,icon:l,completedIcon:f,progressIcon:u,label:n,description:s,completedDescription:_,progressDescription:v,withIcon:S=!0,iconSize:g,size:b="md",loading:c,allowStepClick:y=!0,allowStepSelect:I,classNames:P,styles:E}=r,w=__objRest(r,["className","state","color","icon","completedIcon","progressIcon","label","description","completedDescription","progressDescription","withIcon","iconSize","size","loading","allowStepClick","allowStepSelect","classNames","styles"]);const O=o==="stepCompleted"?null:o==="stepProgress"?u:l,i=g||defaultIconSizes[b],p={"data-progress":o==="stepProgress"||void 0,"data-completed":o==="stepCompleted"||void 0},d=o==="stepCompleted"?_||s:o==="stepProgress"&&v||s;return React__default.createElement(TabStep_styles.StepWrapper,__spreadValues(__spreadProps(__spreadValues({tabIndex:y?0:-1,ref:t},p),{className:cx__default("step-item",P)}),w),S&&React__default.createElement(TabStep_styles.StepIconWrapper,null,React__default.createElement(TabStep_styles.StepIcon,__spreadValues({},p),o==="stepCompleted"?React__default.createElement(TabStep_styles.StepCompletedIcon,null,c?React__default.createElement(Loading.Loading,{color:"#fff",size:i,className:"stepLoader"}):l||f||React__default.createElement(icons.Check,{size:24,color:"#fff"})):null,o!=="stepCompleted"?c?React__default.createElement(Loading.Loading,{size:i,color:m}):O||l:null)),(n||s)&&React__default.createElement(TabStep_styles.StepBody,null,n&&React__default.createElement(TabStep_styles.StepLabel,null,n),d&&React__default.createElement(TabStep_styles.StepDescription,{color:"dimmed"},d)))});TabStep.displayName="@kubed/components/TabStep",exports.TabStep=TabStep;
2
+ //# sourceMappingURL=TabStep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabStep.js","sources":["../../../src/Steps/TabStep/TabStep.tsx"],"sourcesContent":["import React from 'react';\nimport cx from 'classnames';\nimport { Check } from '@kubed/icons';\nimport { DefaultProps, KubedNumberSize, KubedSizes } from '../../theme';\nimport forwardRef from '../../utils/forwardRef';\nimport { Loading } from '../../Loading/Loading';\nimport {\n StepWrapper,\n StepIcon,\n StepIconWrapper,\n StepCompletedIcon,\n StepBody,\n StepLabel,\n StepDescription,\n} from './TabStep.styles';\n\nexport interface StepProps extends DefaultProps {\n /** Step state, controlled by Steps component */\n state?: 'stepInactive' | 'stepProgress' | 'stepCompleted';\n\n /** Step color from theme.colors */\n color?: string | 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n\n /** Should icon be displayed */\n withIcon?: boolean;\n\n /** Step icon, defaults to step index + 1 when rendered within Stepper */\n icon?: React.ReactNode;\n\n /** Step icon displayed when step is completed */\n completedIcon?: React.ReactNode;\n\n /** Step icon displayed when step is in progress */\n progressIcon?: React.ReactNode;\n\n /** Step label, render after icon */\n label?: React.ReactNode;\n\n /** Step description */\n description?: React.ReactNode;\n\n /** Step progress description */\n progressDescription?: React.ReactNode;\n\n /** Step completed description */\n completedDescription?: React.ReactNode;\n\n /** Icon wrapper size in px */\n iconSize?: number;\n\n /** Icon position relative to step body */\n iconPosition?: 'right' | 'left';\n\n /** Component size */\n size?: KubedSizes;\n\n /** Radius from theme.radius, or number to set border-radius in px */\n radius?: KubedNumberSize;\n\n /** Indicates loading state on step */\n loading?: boolean;\n\n /** Set to false to disable clicks on step */\n allowStepClick?: boolean;\n\n /** Should step selection be allowed */\n allowStepSelect?: boolean;\n\n /** Static selector base */\n __staticSelector?: string;\n}\n\nconst defaultIconSizes = {\n xs: 16,\n sm: 18,\n md: 20,\n lg: 22,\n xl: 24,\n};\n\nexport const TabStep = forwardRef<StepProps, 'div'>(\n (\n {\n className,\n state,\n color,\n icon,\n completedIcon,\n progressIcon,\n label,\n description,\n completedDescription,\n progressDescription,\n withIcon = true,\n iconSize,\n size = 'md',\n // radius = 'xl',\n loading,\n allowStepClick = true,\n allowStepSelect,\n // iconPosition = 'left',\n // __staticSelector = 'Step',\n classNames,\n styles,\n ...rest\n },\n ref\n ) => {\n const _icon = state === 'stepCompleted' ? null : state === 'stepProgress' ? progressIcon : icon;\n const _iconSize = iconSize || defaultIconSizes[size];\n\n const dataAttributes = {\n 'data-progress': state === 'stepProgress' || undefined,\n 'data-completed': state === 'stepCompleted' || undefined,\n };\n\n const crtDescription =\n state === 'stepCompleted'\n ? completedDescription || description\n : state === 'stepProgress'\n ? progressDescription || description\n : description;\n\n return (\n <StepWrapper\n tabIndex={allowStepClick ? 0 : -1}\n ref={ref}\n {...dataAttributes}\n className={cx('step-item', classNames)}\n {...rest}\n >\n {withIcon && (\n <StepIconWrapper>\n <StepIcon {...dataAttributes}>\n {state === 'stepCompleted' ? (\n <StepCompletedIcon>\n {loading ? (\n <Loading color=\"#fff\" size={_iconSize} className=\"stepLoader\" />\n ) : (\n icon || completedIcon || <Check size={24} color=\"#fff\" />\n )}\n </StepCompletedIcon>\n ) : null}\n\n {state !== 'stepCompleted' ? (\n loading ? (\n <Loading size={_iconSize} color={color} />\n ) : (\n _icon || icon\n )\n ) : null}\n </StepIcon>\n </StepIconWrapper>\n )}\n\n {(label || description) && (\n <StepBody>\n {label && <StepLabel>{label}</StepLabel>}\n {crtDescription && <StepDescription color=\"dimmed\">{crtDescription}</StepDescription>}\n </StepBody>\n )}\n </StepWrapper>\n );\n }\n);\n\nTabStep.displayName = '@kubed/components/TabStep';\n"],"names":["forwardRef","React","StepWrapper","cx","StepIconWrapper","StepIcon","StepCompletedIcon","Loading","Check","StepBody","StepLabel","StepDescription"],"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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EAAE,YAAY;AAC3B,GAAG,CAAC,GAAG,IAAI,IAAI,aAAa,oBAAoBN,cAAK,CAAC,aAAa,CAACO,WAAK,EAAE;AAC3E,IAAI,IAAI,EAAE,EAAE;AACZ,IAAI,KAAK,EAAE,MAAM;AACjB,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,eAAe,GAAG,OAAO,mBAAmBP,cAAK,CAAC,aAAa,CAACM,eAAO,EAAE;AACjG,IAAI,IAAI,EAAE,SAAS;AACnB,IAAI,KAAK;AACT,GAAG,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,WAAW,qBAAqBN,cAAK,CAAC,aAAa,CAACQ,uBAAQ,EAAE,IAAI,EAAE,KAAK,oBAAoBR,cAAK,CAAC,aAAa,CAACS,wBAAS,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,cAAc,oBAAoBT,cAAK,CAAC,aAAa,CAACU,8BAAe,EAAE;AAC1P,IAAI,KAAK,EAAE,QAAQ;AACnB,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC,EAAE;AACH,OAAO,CAAC,WAAW,GAAG,2BAA2B;;;;"}
@@ -0,0 +1,84 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var styled=require("styled-components"),utils=require("../../theme/utils.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var styled__default=_interopDefaultLegacy(styled);const StepWrapper=styled__default.div`
2
+ display: flex;
3
+ flex-direction: row;
4
+ cursor: pointer;
5
+ align-items: center;
6
+ text-align: left;
7
+ min-width: 180px;
8
+ height: 100%;
9
+ padding: 12px 15px;
10
+ &[data-progress='true'] {
11
+ background-color: ${({theme:e})=>e.palette.background};
12
+ }
13
+ `,StepBody=styled__default.div`
14
+ margin-left: 12px;
15
+ display: flex;
16
+ flex-direction: column;
17
+ `,StepLabel=styled__default.div`
18
+ font-size: 12px;
19
+ font-weight: 700;
20
+ line-height: 1.67;
21
+ text-align: left;
22
+ color: ${({theme:e})=>e.palette.accents_8};
23
+ `,StepDescription=styled__default.div`
24
+ text-align: left;
25
+ line-height: 1.67;
26
+ color: ${({theme:e})=>e.palette.accents_5};
27
+ `,StepIcon=styled__default.div`
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ position: relative;
32
+ font-weight: 700;
33
+ width: 40px;
34
+ height: 40px;
35
+ min-height: 40px;
36
+ //border-radius: 32px;
37
+ font-size: 16px;
38
+ //border: 2px solid ${({theme:e})=>e.palette.accents_2};
39
+ transition: background-color 150ms ease, border-color 150ms ease;
40
+ //background-color: ${({theme:e})=>e.palette.accents_2};
41
+ color: ${({theme:e})=>e.palette.accents_7};
42
+ &[data-progress='true'] {
43
+ &:after {
44
+ border-color: ${({theme:e})=>utils.default.getPrimaryColor(e)};
45
+ }
46
+ }
47
+ &[data-completed='true'] {
48
+ color: #fff;
49
+ &:after {
50
+ border-color: ${({theme:e})=>utils.default.getPrimaryColor(e)};
51
+ background-color: ${({theme:e})=>utils.default.getPrimaryColor(e)};
52
+ }
53
+ }
54
+
55
+ .kubed-icon {
56
+ width: 40px;
57
+ height: 40px;
58
+ }
59
+
60
+ &:after {
61
+ position: absolute;
62
+ right: 0;
63
+ bottom: 0;
64
+ content: ' ';
65
+ border: 2px solid ${({theme:e})=>e.palette.accents_3};
66
+ background-color: ${({theme:e})=>e.palette.background};
67
+ display: block;
68
+ width: 12px;
69
+ height: 12px;
70
+ border-radius: 50%;
71
+ }
72
+ `,StepIconWrapper=styled__default.div`
73
+ position: relative;
74
+ overflow: hidden;
75
+ flex-shrink: 0;
76
+ `,StepCompletedIcon=styled__default.div`
77
+ position: absolute;
78
+ display: flex;
79
+ align-items: center;
80
+ justify-content: center;
81
+ color: #fff;
82
+ inset: 0;
83
+ `;exports.StepBody=StepBody,exports.StepCompletedIcon=StepCompletedIcon,exports.StepDescription=StepDescription,exports.StepIcon=StepIcon,exports.StepIconWrapper=StepIconWrapper,exports.StepLabel=StepLabel,exports.StepWrapper=StepWrapper;
84
+ //# sourceMappingURL=TabStep.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabStep.styles.js","sources":["../../../src/Steps/TabStep/TabStep.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { KubedTheme, themeUtils } from '../../theme';\n\nexport const StepWrapper = styled.div`\n display: flex;\n flex-direction: row;\n cursor: pointer;\n align-items: center;\n text-align: left;\n min-width: 180px;\n height: 100%;\n padding: 12px 15px;\n &[data-progress='true'] {\n background-color: ${({ theme }) => theme.palette.background};\n }\n`;\n\nexport const StepBody = styled.div`\n margin-left: 12px;\n display: flex;\n flex-direction: column;\n`;\n\nexport const StepLabel = styled.div`\n font-size: 12px;\n font-weight: 700;\n line-height: 1.67;\n text-align: left;\n color: ${({ theme }) => theme.palette.accents_8};\n`;\n\nexport const StepDescription = styled.div`\n text-align: left;\n line-height: 1.67;\n color: ${({ theme }) => theme.palette.accents_5};\n`;\n\nexport const StepIcon = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n font-weight: 700;\n width: 40px;\n height: 40px;\n min-height: 40px;\n //border-radius: 32px;\n font-size: 16px;\n //border: 2px solid ${({ theme }) => theme.palette.accents_2};\n transition: background-color 150ms ease, border-color 150ms ease;\n //background-color: ${({ theme }) => theme.palette.accents_2};\n color: ${({ theme }) => theme.palette.accents_7};\n &[data-progress='true'] {\n &:after {\n border-color: ${({ theme }) => themeUtils.getPrimaryColor(theme)};\n }\n }\n &[data-completed='true'] {\n color: #fff;\n &:after {\n border-color: ${({ theme }) => themeUtils.getPrimaryColor(theme)};\n background-color: ${({ theme }) => themeUtils.getPrimaryColor(theme)};\n }\n }\n\n .kubed-icon {\n width: 40px;\n height: 40px;\n }\n\n &:after {\n position: absolute;\n right: 0;\n bottom: 0;\n content: ' ';\n border: 2px solid ${({ theme }) => theme.palette.accents_3};\n background-color: ${({ theme }) => theme.palette.background};\n display: block;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n }\n`;\n\nexport const StepIconWrapper = styled.div`\n position: relative;\n overflow: hidden;\n flex-shrink: 0;\n`;\n\nexport const StepCompletedIcon = styled.div`\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n inset: 0;\n`;\n"],"names":["styled","themeUtils"],"mappings":";;;;;;;;;;;AAEY,MAAC,WAAW,GAAGA,eAAM,CAAC,GAAG,CAAC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;AAChE;AACA,EAAE;AACU,MAAC,QAAQ,GAAGA,eAAM,CAAC,GAAG,CAAC;AACnC;AACA;AACA;AACA,EAAE;AACU,MAAC,SAAS,GAAGA,eAAM,CAAC,GAAG,CAAC;AACpC;AACA;AACA;AACA;AACA,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAClD,EAAE;AACU,MAAC,eAAe,GAAGA,eAAM,CAAC,GAAG,CAAC;AAC1C;AACA;AACA,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAClD,EAAE;AACU,MAAC,QAAQ,GAAGA,eAAM,CAAC,GAAG,CAAC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAC/D;AACA,sBAAsB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAC/D,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAClD;AACA;AACA,oBAAoB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAKC,gBAAU,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AACvE;AACA;AACA;AACA;AACA;AACA,oBAAoB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAKA,gBAAU,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AACvE,wBAAwB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAKA,gBAAU,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAC/D,sBAAsB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;AAChE;AACA;AACA;AACA;AACA;AACA,EAAE;AACU,MAAC,eAAe,GAAGD,eAAM,CAAC,GAAG,CAAC;AAC1C;AACA;AACA;AACA,EAAE;AACU,MAAC,iBAAiB,GAAGA,eAAM,CAAC,GAAG,CAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),lodash=require("lodash"),cx=require("classnames"),icons=require("@kubed/icons"),hooks=require("@kubed/hooks"),forwardRef=require("../utils/forwardRef.js"),Field=require("../Entity/Field.js"),TypeSelect_styles=require("./TypeSelect.styles.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var React__default=_interopDefaultLegacy(React),cx__default=_interopDefaultLegacy(cx);const TypeSelect=forwardRef.default(({options:e,value:n,defaultValue:i,className:v,onChange:d},m)=>{const[a,l]=React.useState(!1),y=hooks.useClickOutside(()=>{l(!1)}),k=hooks.useMergedRef(m,y),s=r=>lodash.isUndefined(r)?!1:e.some(t=>t.value===r),E=()=>s(n)?n:s(i)?i:e[0].value,[p,f]=React.useState(E());React.useEffect(()=>{s(n)&&f(n)},[n]);const w=()=>{const r=e.find(u=>u.value===p),{label:t,description:o,icon:c}=r;return React__default.createElement(TypeSelect_styles.ControlWrapper,{onClick:()=>{l(!a)},$expanded:a},React__default.createElement(Field.Field,{label:o,value:t,avatar:c}))},b=r=>{lodash.isUndefined(n)&&f(r.value),l(!1),d&&d(r.value,r)},_=()=>e.filter(t=>t.value!==p).map(t=>{const{label:o,description:c,icon:u,value:q}=t;return React__default.createElement(TypeSelect_styles.DropdownOption,{key:q,onClick:()=>b(t)},React__default.createElement(Field.Field,{label:c,value:o,avatar:u}))});return React__default.createElement(TypeSelect_styles.TypeSelectWrapper,{ref:k,className:cx__default(v,{"is-expand":a})},w(),a&&React__default.createElement(TypeSelect_styles.DropdownWrapper,null,_()),!a&&React__default.createElement(TypeSelect_styles.DropdownArrow,null,React__default.createElement(icons.ChevronDown,null)))});TypeSelect.displayName="@kubed/components/TypeSelect",exports.TypeSelect=TypeSelect;
2
+ //# sourceMappingURL=TypeSelect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeSelect.js","sources":["../../src/TypeSelect/TypeSelect.tsx"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { isUndefined } from 'lodash';\nimport cx from 'classnames';\nimport { ChevronDown } from '@kubed/icons';\nimport { useClickOutside, useMergedRef } from '@kubed/hooks';\nimport { DefaultProps } from '../theme';\nimport forwardRef from '../utils/forwardRef';\nimport { Field } from '../Entity/Field';\nimport {\n TypeSelectWrapper,\n ControlWrapper,\n DropdownWrapper,\n DropdownOption,\n DropdownArrow,\n} from './TypeSelect.styles';\n\ninterface OptionProps {\n /** Field label */\n label: React.ReactNode;\n\n /** Field description */\n description?: React.ReactNode;\n\n value: React.ReactNode;\n\n /** Field avatar */\n icon?: React.ReactNode;\n}\n\nexport interface TypeSelectProps extends DefaultProps {\n value?: any;\n defaultValue?: any;\n options: OptionProps[];\n onChange?: (value: any, option: OptionProps) => void;\n}\n\nexport const TypeSelect = forwardRef<TypeSelectProps, 'div'>(\n ({ options, value, defaultValue, className, onChange }, ref) => {\n const [expanded, setExpanded] = useState(false);\n\n const useClickOutsideRef = useClickOutside(() => {\n setExpanded(false);\n });\n const mergedRef = useMergedRef(ref, useClickOutsideRef);\n\n const isValidValue = (v) => {\n if (isUndefined(v)) {\n return false;\n }\n return options.some((option) => option.value === v);\n };\n\n const getInitialValue = () => {\n if (isValidValue(value)) {\n return value;\n }\n if (isValidValue(defaultValue)) {\n return defaultValue;\n }\n return options[0].value;\n };\n\n const [_value, setValue] = useState(getInitialValue());\n\n useEffect(() => {\n if (isValidValue(value)) {\n setValue(value);\n }\n }, [value]);\n\n const renderControl = () => {\n const currentOption = options.find((option) => option.value === _value);\n const { label, description, icon } = currentOption;\n return (\n <ControlWrapper\n onClick={() => {\n setExpanded(!expanded);\n }}\n $expanded={expanded}\n >\n <Field label={description} value={label} avatar={icon} />\n </ControlWrapper>\n );\n };\n\n const onOptionClick = (option) => {\n if (isUndefined(value)) {\n setValue(option.value);\n }\n setExpanded(false);\n onChange && onChange(option.value, option);\n };\n\n const renderDropdown = () => {\n const dropdownOptions = options.filter((option) => option.value !== _value);\n return dropdownOptions.map((option) => {\n const { label, description, icon, value: optionValue } = option;\n return (\n // @ts-ignore\n <DropdownOption key={optionValue} onClick={() => onOptionClick(option)}>\n <Field label={description} value={label} avatar={icon} />\n </DropdownOption>\n );\n });\n };\n\n return (\n <TypeSelectWrapper ref={mergedRef} className={cx(className, { 'is-expand': expanded })}>\n {renderControl()}\n {expanded && <DropdownWrapper>{renderDropdown()}</DropdownWrapper>}\n {!expanded && (\n <DropdownArrow>\n <ChevronDown />\n </DropdownArrow>\n )}\n </TypeSelectWrapper>\n );\n }\n);\n\nTypeSelect.displayName = '@kubed/components/TypeSelect';\n"],"names":["forwardRef","useState","useClickOutside","useMergedRef","isUndefined","useEffect","React","ControlWrapper","Field","DropdownOption","TypeSelectWrapper","cx","DropdownWrapper","DropdownArrow","ChevronDown"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AAE,KAAK,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;AACtE,MAAM,uBAAuBE,cAAK,CAAC,aAAa,CAACG,gCAAc,EAAE;AACjE,QAAQ,GAAG,EAAE,WAAW;AACxB,QAAQ,OAAO,EAAE,MAAM,aAAa,CAAC,MAAM,CAAC;AAC5C,OAAO,kBAAkBH,cAAK,CAAC,aAAa,CAACE,WAAK,EAAE;AACpD,QAAQ,KAAK,EAAE,WAAW;AAC1B,QAAQ,KAAK,EAAE,KAAK;AACpB,QAAQ,MAAM,EAAE,IAAI;AACpB,OAAO,CAAC,CAAC,CAAC;AACV,KAAK,CAAC,CAAC;AACP,GAAG,CAAC;AACJ,EAAE,uBAAuBF,cAAK,CAAC,aAAa,CAACI,mCAAiB,EAAE;AAChE,IAAI,GAAG,EAAE,SAAS;AAClB,IAAI,SAAS,EAAEC,WAAE,CAAC,SAAS,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;AACvD,GAAG,EAAE,aAAa,EAAE,EAAE,QAAQ,oBAAoBL,cAAK,CAAC,aAAa,CAACM,iCAAe,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,EAAE,CAAC,QAAQ,oBAAoBN,cAAK,CAAC,aAAa,CAACO,+BAAa,EAAE,IAAI,kBAAkBP,cAAK,CAAC,aAAa,CAACQ,iBAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/O,CAAC,EAAE;AACH,UAAU,CAAC,WAAW,GAAG,8BAA8B;;;;"}
@@ -0,0 +1,52 @@
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};
3
+ border-bottom: 0;
4
+ border-bottom-right-radius: 0;
5
+ border-bottom-left-radius: 0;
6
+ transition: none;
7
+ background-color: ${o.palette.accents_1};
8
+ `:null,TypeSelectWrapper=styled__default("div")`
9
+ position: relative;
10
+ border-radius: 4px;
11
+ cursor: pointer;
12
+ `,ControlWrapper=styled__default("div")`
13
+ border-radius: 4px;
14
+ border: 1px solid ${({theme:r})=>r.palette.border};
15
+ height: 64px;
16
+ padding: 12px 64px 12px 12px;
17
+ transition: all 0.3s ease-in-out;
18
+
19
+ &:hover {
20
+ border-color: ${({theme:r})=>r.palette.accents_5};
21
+ }
22
+ ${({$expanded:r,theme:o})=>getExpandedStyle(r,o)};
23
+ `,DropdownArrow=styled__default.div`
24
+ position: absolute;
25
+ height: 16px;
26
+ top: 50%;
27
+ right: 12px;
28
+ transform: translateY(-50%);
29
+ &:hover {
30
+ background-color: ${({theme:r})=>r.palette.accents_1};
31
+ }
32
+ z-index: 999;
33
+ `,DropdownWrapper=styled__default.div`
34
+ position: absolute;
35
+ top: 63px;
36
+ left: 0px;
37
+ width: 100%;
38
+ border: 1px solid ${({theme:r})=>r.palette.accents_5};
39
+ border-radius: 4px;
40
+ border-top-right-radius: 0;
41
+ border-top-left-radius: 0;
42
+ border-top: 0;
43
+ background-color: ${({theme:r})=>r.palette.background};
44
+ //box-sizing: content-box;
45
+ `,DropdownOption=styled__default.div`
46
+ height: 64px;
47
+ padding: 12px 64px 12px 12px;
48
+ &:hover {
49
+ background-color: ${({theme:r})=>r.palette.accents_0};
50
+ }
51
+ `;exports.ControlWrapper=ControlWrapper,exports.DropdownArrow=DropdownArrow,exports.DropdownOption=DropdownOption,exports.DropdownWrapper=DropdownWrapper,exports.TypeSelectWrapper=TypeSelectWrapper;
52
+ //# sourceMappingURL=TypeSelect.styles.js.map
@@ -0,0 +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;AACA,wBAAwB,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAClD,IAAI,CAAC,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AACU,MAAC,iBAAiB,GAAGC,eAAM,CAAC,KAAK,CAAC,CAAC;AAC/C;AACA;AACA;AACA,EAAE;AACU,MAAC,cAAc,GAAGA,eAAM,CAAC,KAAK,CAAC,CAAC;AAC5C;AACA,oBAAoB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;AAC1D;AACA;AACA;AACA;AACA;AACA,kBAAkB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAC3D;AACA,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AACjE,EAAE;AACU,MAAC,aAAa,GAAGA,eAAM,CAAC,GAAG,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAC/D;AACA;AACA,EAAE;AACU,MAAC,eAAe,GAAGA,eAAM,CAAC,GAAG,CAAC;AAC1C;AACA;AACA;AACA;AACA,oBAAoB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAC7D;AACA;AACA;AACA;AACA,oBAAoB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;AAC9D;AACA,EAAE;AACU,MAAC,cAAc,GAAGA,eAAM,CAAC,GAAG,CAAC;AACzC;AACA;AACA;AACA,sBAAsB,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"),Drawer=require("./Drawer/Drawer.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"),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.Drawer=Drawer.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.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"),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;
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const getTransitionName=(t,r,e)=>e!==void 0?e:`${t}-${r}`;exports.getTransitionName=getTransitionName;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const getCollapsedHeight=()=>({height:0,opacity:0}),getRealHeight=e=>{const{scrollHeight:t}=e;return{height:t,opacity:1}},getCurrentHeight=e=>({height:e?e.offsetHeight:0}),skipOpacityTransition=(e,t)=>(t==null?void 0:t.deadline)===!0||t.propertyName==="height",collapseMotion={motionName:"motion-collapse",onAppearStart:getCollapsedHeight,onEnterStart:getCollapsedHeight,onAppearActive:getRealHeight,onEnterActive:getRealHeight,onLeaveStart:getCurrentHeight,onLeaveActive:getCollapsedHeight,onAppearEnd:skipOpacityTransition,onEnterEnd:skipOpacityTransition,onLeaveEnd:skipOpacityTransition,motionDeadline:500},getTransitionName=(e,t,o)=>o!==void 0?o:`${e}-${t}`;exports.default=collapseMotion,exports.getTransitionName=getTransitionName;
2
2
  //# sourceMappingURL=motion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"motion.js","sources":["../../src/utils/motion.ts"],"sourcesContent":["// https://github.com/ant-design/ant-design/blob/master/components/_util/motion.tsx\nimport { CSSMotionProps, MotionEventHandler, MotionEndEventHandler } from 'rc-motion';\nimport { MotionEvent } from 'rc-motion/lib/interface';\n\n// ================== Collapse Motion ==================\nconst getCollapsedHeight: MotionEventHandler = () => ({ height: 0, opacity: 0 });\nconst getRealHeight: MotionEventHandler = (node) => {\n const { scrollHeight } = node;\n return { height: scrollHeight, opacity: 1 };\n};\nconst getCurrentHeight: MotionEventHandler = (node) => ({ height: node ? node.offsetHeight : 0 });\nconst skipOpacityTransition: MotionEndEventHandler = (_, event: MotionEvent) =>\n event?.deadline === true || (event as TransitionEvent).propertyName === 'height';\n\nconst collapseMotion: CSSMotionProps = {\n motionName: 'ant-motion-collapse',\n onAppearStart: getCollapsedHeight,\n onEnterStart: getCollapsedHeight,\n onAppearActive: getRealHeight,\n onEnterActive: getRealHeight,\n onLeaveStart: getCurrentHeight,\n onLeaveActive: getCollapsedHeight,\n onAppearEnd: skipOpacityTransition,\n onEnterEnd: skipOpacityTransition,\n onLeaveEnd: skipOpacityTransition,\n motionDeadline: 500,\n};\n\nconst getTransitionName = (rootPrefixCls: string, motion: string, transitionName?: string) => {\n if (transitionName !== undefined) {\n return transitionName;\n }\n return `${rootPrefixCls}-${motion}`;\n};\nexport { getTransitionName };\nexport default collapseMotion;\n"],"names":[],"mappings":";;;;AAoBK,MAAC,iBAAiB,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,KAAK;AACrE,EAAE,IAAI,cAAc,KAAK,KAAK,CAAC,EAAE;AACjC,IAAI,OAAO,cAAc,CAAC;AAC1B,GAAG;AACH,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AACtC;;;;"}
1
+ {"version":3,"file":"motion.js","sources":["../../src/utils/motion.ts"],"sourcesContent":["// https://github.com/ant-design/ant-design/blob/master/components/_util/motion.tsx\nimport { CSSMotionProps, MotionEventHandler, MotionEndEventHandler } from 'rc-motion';\nimport { MotionEvent } from 'rc-motion/lib/interface';\n\n// ================== Collapse Motion ==================\nconst getCollapsedHeight: MotionEventHandler = () => ({ height: 0, opacity: 0 });\nconst getRealHeight: MotionEventHandler = (node) => {\n const { scrollHeight } = node;\n return { height: scrollHeight, opacity: 1 };\n};\nconst getCurrentHeight: MotionEventHandler = (node) => ({ height: node ? node.offsetHeight : 0 });\nconst skipOpacityTransition: MotionEndEventHandler = (_, event: MotionEvent) =>\n event?.deadline === true || (event as TransitionEvent).propertyName === 'height';\n\nconst collapseMotion: CSSMotionProps = {\n motionName: 'motion-collapse',\n onAppearStart: getCollapsedHeight,\n onEnterStart: getCollapsedHeight,\n onAppearActive: getRealHeight,\n onEnterActive: getRealHeight,\n onLeaveStart: getCurrentHeight,\n onLeaveActive: getCollapsedHeight,\n onAppearEnd: skipOpacityTransition,\n onEnterEnd: skipOpacityTransition,\n onLeaveEnd: skipOpacityTransition,\n motionDeadline: 500,\n};\n\nconst getTransitionName = (rootPrefixCls: string, motion: string, transitionName?: string) => {\n if (transitionName !== undefined) {\n return transitionName;\n }\n return `${rootPrefixCls}-${motion}`;\n};\nexport { getTransitionName };\nexport default collapseMotion;\n"],"names":[],"mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7D,MAAM,aAAa,GAAG,CAAC,IAAI,KAAK;AAChC,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;AAChC,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC9C,CAAC,CAAC;AACF,MAAM,gBAAgB,GAAG,CAAC,IAAI,MAAM,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC,CAAC;AAC9E,MAAM,qBAAqB,GAAG,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,QAAQ,MAAM,IAAI,IAAI,KAAK,CAAC,YAAY,KAAK,QAAQ,CAAC;AAC7H,MAAC,cAAc,GAAG;AACvB,EAAE,UAAU,EAAE,iBAAiB;AAC/B,EAAE,aAAa,EAAE,kBAAkB;AACnC,EAAE,YAAY,EAAE,kBAAkB;AAClC,EAAE,cAAc,EAAE,aAAa;AAC/B,EAAE,aAAa,EAAE,aAAa;AAC9B,EAAE,YAAY,EAAE,gBAAgB;AAChC,EAAE,aAAa,EAAE,kBAAkB;AACnC,EAAE,WAAW,EAAE,qBAAqB;AACpC,EAAE,UAAU,EAAE,qBAAqB;AACnC,EAAE,UAAU,EAAE,qBAAqB;AACnC,EAAE,cAAc,EAAE,GAAG;AACrB,EAAE;AACG,MAAC,iBAAiB,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,KAAK;AACrE,EAAE,IAAI,cAAc,KAAK,KAAK,CAAC,EAAE;AACjC,IAAI,OAAO,cAAc,CAAC;AAC1B,GAAG;AACH,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AACtC;;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react");function _interopNamespace(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){t[r]=e[r]}),t.default=e,Object.freeze(t)}var React__namespace=_interopNamespace(React);const{isValidElement}=React__namespace;function replaceElement(e,t,r){return isValidElement(e)?React__namespace.cloneElement(e,typeof r=="function"?r(e.props||{}):r):t}function cloneElement(e,t){return replaceElement(e,e,t)}exports.cloneElement=cloneElement,exports.isValidElement=isValidElement,exports.replaceElement=replaceElement;
2
+ //# sourceMappingURL=reactNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactNode.js","sources":["../../src/utils/reactNode.ts"],"sourcesContent":["import * as React from 'react';\n\nexport const { isValidElement } = React;\n\ntype AnyObject = Record<any, any>;\n\ntype RenderProps = undefined | AnyObject | ((originProps: AnyObject) => AnyObject | undefined);\n\nexport function replaceElement(\n element: React.ReactNode,\n replacement: React.ReactNode,\n props: RenderProps\n): React.ReactNode {\n if (!isValidElement(element)) return replacement;\n\n return React.cloneElement(\n element,\n typeof props === 'function' ? props(element.props || {}) : props\n );\n}\n\nexport function cloneElement(element: React.ReactNode, props?: RenderProps): React.ReactElement {\n return replaceElement(element, element, props) as React.ReactElement;\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;AACY,MAAC,EAAE,cAAc,EAAE,GAAGA,iBAAM;AACjC,SAAS,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE;AAC5D,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;AAC9B,IAAI,OAAO,WAAW,CAAC;AACvB,EAAE,OAAOA,gBAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,KAAK,KAAK,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC;AACvG,CAAC;AACM,SAAS,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE;AAC7C,EAAE,OAAO,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjD;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"toArray.js","sources":["../../src/utils/toArray.ts"],"sourcesContent":["import React from 'react';\nimport { isFragment } from 'react-is';\n\nexport interface Option {\n keepEmpty?: boolean;\n}\n\nexport default function toArray(\n children: React.ReactNode,\n option: Option = {}\n): React.ReactElement[] {\n let ret: React.ReactElement[] = [];\n\n React.Children.forEach(children, (child: any) => {\n if ((child === undefined || child === null) && !option.keepEmpty) {\n return;\n }\n\n if (Array.isArray(child)) {\n ret = ret.concat(toArray(child));\n } else if (isFragment(child) && child.props) {\n ret = ret.concat(toArray(child.props.children, option));\n } else {\n ret.push(child);\n }\n });\n\n return ret;\n}\n"],"names":["React","isFragment"],"mappings":";;;;;;;;;;;AAEe,SAAS,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,EAAE,EAAE;AACvD,EAAE,IAAI,GAAG,GAAG,EAAE,CAAC;AACf,EAAEA,cAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAK;AAC9C,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE;AACnE,MAAM,OAAO;AACb,KAAK;AACL,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AAC9B,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACvC,KAAK,MAAM,IAAIC,kBAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE;AACjD,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9D,KAAK,MAAM;AACX,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtB,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,GAAG,CAAC;AACb;;;;"}
1
+ {"version":3,"file":"toArray.js","sources":["../../src/utils/toArray.ts"],"sourcesContent":["// https://github.com/react-component/util/blob/master/src/Children/toArray.ts\nimport React from 'react';\nimport { isFragment } from 'react-is';\n\nexport interface Option {\n keepEmpty?: boolean;\n}\n\nexport default function toArray(\n children: React.ReactNode,\n option: Option = {}\n): React.ReactElement[] {\n let ret: React.ReactElement[] = [];\n\n React.Children.forEach(children, (child: any) => {\n if ((child === undefined || child === null) && !option.keepEmpty) {\n return;\n }\n\n if (Array.isArray(child)) {\n ret = ret.concat(toArray(child));\n } else if (isFragment(child) && child.props) {\n ret = ret.concat(toArray(child.props.children, option));\n } else {\n ret.push(child);\n }\n });\n\n return ret;\n}\n"],"names":["React","isFragment"],"mappings":";;;;;;;;;;;AAEe,SAAS,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,EAAE,EAAE;AACvD,EAAE,IAAI,GAAG,GAAG,EAAE,CAAC;AACf,EAAEA,cAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAK;AAC9C,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE;AACnE,MAAM,OAAO;AACb,KAAK;AACL,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AAC9B,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACvC,KAAK,MAAM,IAAIC,kBAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE;AACjD,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9D,KAAK,MAAM;AACX,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtB,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,GAAG,CAAC;AACb;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../src/utils/types.ts"],"sourcesContent":["import React from 'react';\n\nexport type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends Record<string, any> ? DeepPartial<T[P]> : T[P];\n};\n\nexport const tuple = <T extends string[]>(...args: T) => args;\n\nexport type ComponentPassThrough<T extends React.ElementType, Props> = Props &\n React.ComponentPropsWithoutRef<T> & {\n /** Element or component that will be used as root element */\n component?: T;\n };\n\nexport type As<Props = any> = React.ElementType<Props>;\n\n/**\n * Extract the props of a React element or component\n */\nexport type PropsOf<T extends As> = React.ComponentPropsWithoutRef<T> & {\n as?: As;\n};\n\nexport type OmitCommonProps<Target, OmitAdditionalProps extends keyof any = never> = Omit<\n Target,\n 'transition' | 'as' | 'color' | OmitAdditionalProps\n>;\n\nexport type RightJoinProps<\n SourceProps extends object = {},\n OverrideProps extends object = {}\n> = OmitCommonProps<SourceProps, keyof OverrideProps> & OverrideProps;\n\nexport type MergeWithAs<\n ComponentProps extends object,\n AsProps extends object,\n AdditionalProps extends object = {},\n AsComponent extends As = As\n> = RightJoinProps<ComponentProps, AdditionalProps> &\n RightJoinProps<AsProps, AdditionalProps> & {\n as?: AsComponent;\n };\n\nexport type ComponentWithAs<Component extends As, Props extends object = {}> = {\n <AsComponent extends As>(\n props: MergeWithAs<\n React.ComponentProps<Component>,\n React.ComponentProps<AsComponent>,\n Props,\n AsComponent\n >\n ): JSX.Element;\n\n displayName?: string;\n propTypes?: React.WeakValidationMap<any>;\n contextTypes?: React.ValidationMap<any>;\n defaultProps?: Partial<any>;\n id?: string;\n};\n"],"names":[],"mappings":";;;;AAAY,MAAC,KAAK,GAAG,CAAC,GAAG,IAAI,KAAK;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../src/utils/types.ts"],"sourcesContent":["import React from 'react';\n\nexport type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends Record<string, any> ? DeepPartial<T[P]> : T[P];\n};\n\nexport const tuple = <T extends string[]>(...args: T) => args;\n\nexport type ComponentPassThrough<T extends React.ElementType, Props> = Props &\n React.ComponentPropsWithoutRef<T> & {\n /** Element or component that will be used as root element */\n component?: T;\n };\n\nexport type As<Props = any> = React.ElementType<Props>;\n\n/**\n * Extract the props of a React element or component\n */\nexport type PropsOf<T extends As> = React.ComponentPropsWithoutRef<T> & {\n as?: As;\n};\n\nexport type OmitCommonProps<Target, OmitAdditionalProps extends keyof any = never> = Omit<\n Target,\n 'transition' | 'as' | 'color' | OmitAdditionalProps\n>;\n\nexport type RightJoinProps<\n SourceProps extends object = {},\n OverrideProps extends object = {}\n> = OmitCommonProps<SourceProps, keyof OverrideProps> & OverrideProps;\n\nexport type MergeWithAs<\n ComponentProps extends object,\n AsProps extends object,\n AdditionalProps extends object = {},\n AsComponent extends As = As\n> = RightJoinProps<ComponentProps, AdditionalProps> &\n RightJoinProps<AsProps, AdditionalProps> & {\n as?: AsComponent;\n };\n\nexport type ComponentWithAs<Component extends As, Props extends object = {}> = {\n <AsComponent extends As>(\n props: MergeWithAs<\n React.ComponentProps<Component>,\n React.ComponentProps<AsComponent>,\n Props,\n AsComponent\n >\n ): JSX.Element;\n\n displayName?: string;\n propTypes?: React.WeakValidationMap<any>;\n contextTypes?: React.ValidationMap<any>;\n defaultProps?: Partial<any>;\n id?: string;\n};\n\nexport type ForwardRefWithStaticComponents<\n Props extends Record<string, any>,\n Static extends Record<string, any>\n> = ((props: Props) => React.ReactElement) &\n Static & {\n displayName: string;\n };\n"],"names":[],"mappings":";;;;AAAY,MAAC,KAAK,GAAG,CAAC,GAAG,IAAI,KAAK;;;;"}
@@ -65,7 +65,7 @@ import d,{css as t}from"styled-components";import{colorToRgbValues as B}from"../
65
65
  background-color: transparent;
66
66
  border-color: transparent;
67
67
  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,u={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(u[o])c=u[o];else if(e[o])c={bg:e[o],border:e[o],color:"#fff",hoverBg:e[`${o}Dark`]};else if(e.colors[o]){const g=e.colors[o];c={bg:g[2],border:g[2],color:"#fff",hoverBg:g[3]}}else c=u.default;return t`
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
69
  box-shadow: ${C(i,c,r)};
70
70
  ${_(n,c,s,l,r)};
71
71
 
@@ -92,6 +92,7 @@ import d,{css as t}from"styled-components";import{colorToRgbValues as B}from"../
92
92
  justify-content: center;
93
93
  align-items: center;
94
94
  height: 100%;
95
+ line-height: 1;
95
96
  `,R=d("span")`
96
97
  display: inherit;
97
98
  white-space: nowrap;
@@ -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`;\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,MA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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,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 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,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;AACF,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,KAAK,KAAK,GAAG,CAAC;AAC3C,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;AAChB,SAAS,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AACnC,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AACzD,CAAC,CAAC;AACF,MAAM,cAA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A;AACA;AACA;AACA,iBAAiB,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACxE,WAAW,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,GAAG,OAAO,GAAG,cAAc,CAAC;AAC/D,EAAE,EAAE,CAAC,EAAE,QAAQ,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;;;;"}
@@ -0,0 +1,2 @@
1
+ import P from"react";import{omit as v}from"lodash";import y from"./CollapsePanel.js";import b from"../utils/motion.js";import O from"../utils/toArray.js";import{cloneElement as j}from"../utils/reactNode.js";import{StyledCollapse as C}from"./Collapse.styles.js";var g=Object.defineProperty,w=Object.defineProperties,E=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,n=(r,e,o)=>e in r?g(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,l=(r,e)=>{for(var o in e||(e={}))S.call(e,o)&&n(r,o,e[o]);if(p)for(var o of p(e))A.call(e,o)&&n(r,o,e[o]);return r},i=(r,e)=>w(r,E(e));const m=r=>{const e=i(l({},b),{motionAppear:!1,leavedClassName:"kubed-collapse-content-hidden"}),o=()=>{const{children:c}=r;return O(c).map((t,d)=>{var s;if((s=t.props)==null?void 0:s.disabled){const f=t.key||String(d),{disabled:u,collapsible:a}=t.props,_=i(l({},v(t.props,["disabled"])),{key:f,collapsible:a!=null?a:u?"disabled":void 0});return j(t,_)}return t})};return P.createElement(C,l({openMotion:e,prefixCls:"kubed-collapse"},r),o())};m.Panel=y;var I=m;export{I as default};
2
+ //# sourceMappingURL=Collapse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collapse.js","sources":["../../src/Collapse/Collapse.tsx"],"sourcesContent":["// https://github.com/ant-design/ant-design/blob/master/components/collapse/Collapse.tsx\n\nimport React, { PropsWithChildren } from 'react';\nimport { CSSMotionProps } from 'rc-motion';\nimport { omit } from 'lodash';\n\n// import { CaretRight } from '@kubed/icons';\nimport CollapsePanel, { CollapsibleType } from './CollapsePanel';\nimport collapseMotion from '../utils/motion';\nimport toArray from '../utils/toArray';\nimport { cloneElement } from '../utils/reactNode';\nimport { StyledCollapse } from './Collapse.styles';\n\nexport type ExpandIconPosition = 'left' | 'right' | undefined;\n\nexport interface CollapseProps {\n activeKey?: Array<string | number> | string | number;\n defaultActiveKey?: Array<string | number> | string | number;\n accordion?: boolean;\n destroyInactivePanel?: boolean;\n onChange?: (key: string | string[]) => void;\n style?: React.CSSProperties;\n className?: string;\n bordered?: boolean;\n prefixCls?: string;\n expandIcon?: (panelProps: PanelProps) => React.ReactNode;\n expandIconPosition?: ExpandIconPosition;\n ghost?: boolean;\n collapsible?: CollapsibleType;\n children?: React.ReactNode;\n}\n\ninterface PanelProps {\n isActive?: boolean;\n header?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n showArrow?: boolean;\n forceRender?: boolean;\n /** @deprecated Use `collapsible=\"disabled\"` instead */\n disabled?: boolean;\n extra?: React.ReactNode;\n collapsible?: CollapsibleType;\n}\n\ninterface CollapseInterface extends React.FC<CollapseProps> {\n Panel: typeof CollapsePanel;\n}\n\nconst Collapse: CollapseInterface = (props: PropsWithChildren<CollapseInterface>) => {\n const openMotion: CSSMotionProps = {\n ...collapseMotion,\n motionAppear: false,\n leavedClassName: 'kubed-collapse-content-hidden',\n };\n\n const getItems = () => {\n const { children } = props;\n return toArray(children).map((child: React.ReactElement, index: number) => {\n if (child.props?.disabled) {\n const key = child.key || String(index);\n const { disabled, collapsible } = child.props;\n const childProps: CollapseProps & { key: React.Key } = {\n ...omit(child.props, ['disabled']),\n key,\n collapsible: collapsible ?? (disabled ? 'disabled' : undefined),\n };\n return cloneElement(child, childProps);\n }\n return child;\n });\n };\n\n return (\n <StyledCollapse openMotion={openMotion} prefixCls=\"kubed-collapse\" {...props}>\n {getItems()}\n </StyledCollapse>\n );\n};\n\nCollapse.Panel = CollapsePanel;\n\nexport default Collapse;\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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8
+ transition: height 0.2s cubic-bezier(0.645, 0.045, 0.355, 1),
9
+ opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) !important;
10
+ }
11
+ `;export{t as StyledCollapse};
12
+ //# sourceMappingURL=Collapse.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collapse.styles.js","sources":["../../src/Collapse/Collapse.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport RcCollapse from 'rc-collapse';\n\nexport const StyledCollapse = styled(RcCollapse)`\n .kubed-collapse-content-hidden {\n display: none;\n }\n\n .motion-collapse {\n overflow: hidden;\n transition: height 0.2s cubic-bezier(0.645, 0.045, 0.355, 1),\n opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) !important;\n }\n`;\n"],"names":[],"mappings":";;;AAEY,MAAC,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
@@ -0,0 +1,2 @@
1
+ import s from"react";import p from"classnames";import n from"rc-collapse";var c=Object.defineProperty,_=Object.defineProperties,f=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,t=(r,e,a)=>e in r?c(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,i=(r,e)=>{for(var a in e||(e={}))m.call(e,a)&&t(r,a,e[a]);if(o)for(var a of o(e))P.call(e,a)&&t(r,a,e[a]);return r},O=(r,e)=>_(r,f(e));const u=r=>{const{className:e="",showArrow:a}=r,l=p({"collapse-panel-no-arrow":!a},e);return s.createElement(n.Panel,O(i({},r),{className:l}))};var v=u;export{v as default};
2
+ //# sourceMappingURL=CollapsePanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapsePanel.js","sources":["../../src/Collapse/CollapsePanel.tsx"],"sourcesContent":["// https://github.com/ant-design/ant-design/blob/master/components/collapse/CollapsePanel.tsx\nimport React from 'react';\nimport classNames from 'classnames';\nimport RcCollapse from 'rc-collapse';\n\nexport type CollapsibleType = 'header' | 'disabled';\n\nexport interface CollapsePanelProps {\n key: string | number;\n header: React.ReactNode;\n disabled?: boolean;\n className?: string;\n style?: React.CSSProperties;\n showArrow?: boolean;\n prefixCls?: string;\n forceRender?: boolean;\n id?: string;\n extra?: React.ReactNode;\n collapsible?: CollapsibleType;\n children?: React.ReactNode;\n}\n\nconst CollapsePanel: React.FC<CollapsePanelProps> = (props: CollapsePanelProps) => {\n const { className = '', showArrow } = props;\n const collapsePanelClassName = classNames(\n {\n 'collapse-panel-no-arrow': !showArrow,\n },\n className\n );\n\n return <RcCollapse.Panel {...props} className={collapsePanelClassName} />;\n};\n\nexport default CollapsePanel;\n"],"names":["classNames","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,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;AAC7C,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACpC,QAAQ,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,EAAE,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AACF,IAAI,aAAa,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,UAAU,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAIlE,MAAM,aAAa,GAAG,CAAC,KAAK,KAAK;AACjC,EAAE,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;AAC9C,EAAE,MAAM,sBAAsB,GAAGA,EAAU,CAAC;AAC5C,IAAI,yBAAyB,EAAE,CAAC,SAAS;AACzC,GAAG,EAAE,SAAS,CAAC,CAAC;AAChB,EAAE,uBAAuBC,cAAK,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE;AACxG,IAAI,SAAS,EAAE,sBAAsB;AACrC,GAAG,CAAC,CAAC,CAAC;AACN,CAAC,CAAC;AACF,sBAAe,aAAa;;;;"}
@@ -1,13 +1,13 @@
1
- import n from"react";import l,{css as P}from"styled-components";import u from"classnames";import{useToggle as k}from"@kubed/hooks";import{Dropdown as C}from"../Dropdown/Dropdown.js";import j from"../utils/forwardRef.js";import{addColorAlpha as R}from"../utils/color.js";var D=Object.defineProperty,p=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,v=(e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_=(e,t)=>{for(var r in t||(t={}))y.call(t,r)&&v(e,r,t[r]);if(p)for(var r of p(t))b.call(t,r)&&v(e,r,t[r]);return e},S=(e,t)=>{var r={};for(var a in e)y.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&p)for(var a of p(e))t.indexOf(a)<0&&b.call(e,a)&&(r[a]=e[a]);return r};const W=(e,t)=>{const{palette:r}=t;return e?P`
1
+ import n from"react";import o,{css as w}from"styled-components";import{Dropdown as h}from"../Dropdown/Dropdown.js";import $ from"../utils/forwardRef.js";import{addColorAlpha as O}from"../utils/color.js";var P=Object.defineProperty,i=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,u=(e,t,r)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,d=(e,t)=>{for(var r in t||(t={}))m.call(t,r)&&u(e,r,t[r]);if(i)for(var r of i(t))x.call(t,r)&&u(e,r,t[r]);return e},N=(e,t)=>{var r={};for(var a in e)m.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&i)for(var a of i(e))t.indexOf(a)<0&&x.call(e,a)&&(r[a]=e[a]);return r};const j=(e,t)=>{const{palette:r}=t;return e?w`
2
2
  border-color: ${r.accents_5};
3
- box-shadow: 0 4px 8px 0 ${R(r.accents_8,.2)};
4
- `:null},I=l.div`
3
+ box-shadow: 0 4px 8px 0 ${O(r.accents_8,.2)};
4
+ `:null},C=o.div`
5
5
  position: relative;
6
6
 
7
7
  & > div:nth-child(2) {
8
8
  width: 100%;
9
9
  }
10
- `,g=l("div")`
10
+ `,y=o("div")`
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  position: relative;
@@ -19,25 +19,25 @@ import n from"react";import l,{css as P}from"styled-components";import u from"cl
19
19
  cursor: ${({expandable:e})=>e?"pointer":null};
20
20
 
21
21
  &:hover,
22
- &.is-expand {
23
- ${({hoverable:e,theme:t})=>W(e,t)};
22
+ &[aria-expanded='true'] {
23
+ ${({hoverable:e,theme:t})=>j(e,t)};
24
24
  }
25
- `,E=l("div")`
25
+ `,b=o("div")`
26
26
  display: flex;
27
27
  flex-grow: 1;
28
28
  flex-shrink: 1;
29
29
  ${({$gap:e})=>e?`gap: ${e}px`:null};
30
- `,h=l("div")`
30
+ `,v=o("div")`
31
31
  display: flex;
32
32
  border-radius: 4px;
33
33
  padding: 8px;
34
34
  margin-top: 12px;
35
35
  background-color: ${({theme:e})=>e.palette.accents_1};
36
- `,T=l("div")`
36
+ `,R=o("div")`
37
37
  padding: 12px;
38
38
  z-index: 1;
39
39
  border: 1px solid ${({theme:e})=>e.palette.accents_5};
40
40
  border-top: 0;
41
41
  border-radius: 0 0 4px 4px;
42
- `,w=j((e,t)=>{var r=e,{children:a,className:d,footer:i,gap:c=20,bordered:m=!0,expandable:o=!1,expandContent:N}=r,f=S(r,["children","className","footer","gap","bordered","expandable","expandContent"]);const[s,$]=k(!1,[!0,!1]),x=O=>{O.stopPropagation(),o&&$(!s)};return o?n.createElement(I,null,n.createElement(C,{content:n.createElement(T,{className:"expand-container"},N),appendTo:"parent",className:"entity-dropdown",maxWidth:"100%",offset:[0,-3]},n.createElement(g,_({ref:t,bordered:m,expandable:o,onClick:x,className:u({"is-expand":o&&s},d)},f),n.createElement(E,{$gap:c,className:"entity-main"},a),i&&n.createElement(h,{className:"entity-footer"},i)))):n.createElement(g,_({ref:t,bordered:m,expandable:o,onClick:x,className:u({"is-expand":o&&s},d)},f),n.createElement(E,{$gap:c,className:"entity-main"},a),i&&n.createElement(h,{className:"entity-footer"},i))});w.displayName="@kubed/components/Entity";export{w as Entity};
42
+ `,_=$((e,t)=>{var r=e,{children:a,footer:l,gap:s=20,bordered:c=!0,expandable:p=!1,expandContent:g,expandProps:E}=r,f=N(r,["children","footer","gap","bordered","expandable","expandContent","expandProps"]);return p?n.createElement(C,null,n.createElement(h,d({content:n.createElement(R,{className:"expand-container"},g),appendTo:"parent",className:"entity-dropdown",maxWidth:"100%",offset:[0,-3],placement:"bottom"},E),n.createElement(y,d({ref:t,bordered:c,expandable:p},f),n.createElement(b,{$gap:s,className:"entity-main"},a),l&&n.createElement(v,{className:"entity-footer"},l)))):n.createElement(y,d({ref:t,bordered:c,expandable:p},f),n.createElement(b,{$gap:s,className:"entity-main"},a),l&&n.createElement(v,{className:"entity-footer"},l))});_.displayName="@kubed/components/Entity";export{_ as Entity};
43
43
  //# sourceMappingURL=Entity.js.map