@kubed/components 0.2.36 → 0.3.0-alpha.1

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 (240) hide show
  1. package/cjs/Alert/Alert.js +4 -4
  2. package/cjs/Alert/Alert.js.map +1 -1
  3. package/cjs/Badge/Badge.js +4 -4
  4. package/cjs/Badge/Badge.js.map +1 -1
  5. package/cjs/Badge/BadgeAnchor.js.map +1 -1
  6. package/cjs/Banner/Banner.js.map +1 -1
  7. package/cjs/Button/Button.styles.js +9 -9
  8. package/cjs/Button/Button.styles.js.map +1 -1
  9. package/cjs/Checkbox/Checkbox.js +1 -1
  10. package/cjs/Checkbox/Checkbox.js.map +1 -1
  11. package/cjs/Collapse/Collapse.js.map +1 -1
  12. package/cjs/Collapse/CollapsePanel.js +1 -1
  13. package/cjs/DatePicker/generatePicker/generateRangePicker.js +1 -1
  14. package/cjs/DatePicker/generatePicker/generateRangePicker.js.map +1 -1
  15. package/cjs/DatePicker/generatePicker/generateSinglePicker.js +1 -1
  16. package/cjs/DatePicker/generatePicker/generateSinglePicker.js.map +1 -1
  17. package/cjs/Descriptions/Description.js.map +1 -1
  18. package/cjs/Divider/Divider.js +1 -1
  19. package/cjs/Drawer/Drawer.js +1 -1
  20. package/cjs/Drawer/Drawer.js.map +1 -1
  21. package/cjs/Drawer/Drawer.styles.js.map +1 -1
  22. package/cjs/Dropdown/Dropdown.js +1 -1
  23. package/cjs/Dropzone/DropzoneStatus.js.map +1 -1
  24. package/cjs/Entity/Entity.js.map +1 -1
  25. package/cjs/FilterInput/FilterInput.js +1 -1
  26. package/cjs/FilterInput/FilterInput.js.map +1 -1
  27. package/cjs/FilterInput/FilterInput.styles.js.map +1 -1
  28. package/cjs/Form/Form.js +3 -3
  29. package/cjs/Form/FormItem/FormItem.js +3 -3
  30. package/cjs/Form/FormItem/FormItem.js.map +1 -1
  31. package/cjs/Grid/Row.js +3 -3
  32. package/cjs/Grid/Row.js.map +1 -1
  33. package/cjs/Group/Group.js +12 -12
  34. package/cjs/Group/Group.js.map +1 -1
  35. package/cjs/Input/Input.js +1 -1
  36. package/cjs/InputNumber/InputNumber.js +2 -2
  37. package/cjs/Menu/Menu.js.map +1 -1
  38. package/cjs/Menu/MenuButton/MenuButton.js +1 -1
  39. package/cjs/Menu/MenuButton/MenuButton.styles.js.map +1 -1
  40. package/cjs/Modal/Modal.js +1 -1
  41. package/cjs/Modal/Modal.styles.js.map +1 -1
  42. package/cjs/Navs/Navs.js +1 -1
  43. package/cjs/Navs/Navs.styles.js.map +1 -1
  44. package/cjs/Progress/Progress.styles.js.map +1 -1
  45. package/cjs/Radio/Radio.js +9 -9
  46. package/cjs/Radio/Radio.js.map +1 -1
  47. package/cjs/Sheet/Sheet.styles.js +4 -4
  48. package/cjs/Skeleton/Skeleton.js +1 -1
  49. package/cjs/Skeleton/Skeleton.styles.js.map +1 -1
  50. package/cjs/Slider/Slider/Slider.js +1 -1
  51. package/cjs/Slider/Slider/Slider.js.map +1 -1
  52. package/cjs/Slider/SliderRoot/SliderRoot.js +1 -1
  53. package/cjs/Slider/SliderRoot/SliderRoot.js.map +1 -1
  54. package/cjs/Slider/SliderRoot/SliderRoot.styles.js +1 -1
  55. package/cjs/Slider/Thumb/Thumb.js +1 -1
  56. package/cjs/Slider/Track/Track.styles.js +7 -7
  57. package/cjs/StatusDot/StatusDot.js.map +1 -1
  58. package/cjs/Steps/Step/Step.js +1 -1
  59. package/cjs/Steps/Step/Step.styles.js.map +1 -1
  60. package/cjs/Steps/Steps.js +1 -1
  61. package/cjs/Steps/Steps.js.map +1 -1
  62. package/cjs/Steps/Steps.styles.js.map +1 -1
  63. package/cjs/Steps/TabStep/TabStep.js +1 -1
  64. package/cjs/Steps/TabStep/TabStep.styles.js.map +1 -1
  65. package/cjs/Switch/Switch.js +1 -1
  66. package/cjs/Table/BaseTable/BasePagination.js +1 -1
  67. package/cjs/Table/BaseTable/Table.js +2 -2
  68. package/cjs/Table/BaseTable/Table.js.map +1 -1
  69. package/cjs/Table/BaseTable/TableBody.js +1 -1
  70. package/cjs/Table/BaseTable/TableCell.js +1 -1
  71. package/cjs/Table/BaseTable/TableFilteredEmpty/Description.styles.js +2 -2
  72. package/cjs/Table/BaseTable/TableHead.js +1 -1
  73. package/cjs/Table/DataTable/Table.js.map +1 -1
  74. package/cjs/Table/DataTable/Toolbar.js +1 -1
  75. package/cjs/Tabs/Tabs.js +1 -1
  76. package/cjs/Tabs/Tabs.styles.js.map +1 -1
  77. package/cjs/Tag/Tag.js.map +1 -1
  78. package/cjs/Textarea/Textarea.js +2 -2
  79. package/cjs/Textarea/Textarea.js.map +1 -1
  80. package/cjs/Tooltip/Tooltip.styles.js.map +1 -1
  81. package/cjs/TypeSelect/TypeSelect.js +1 -1
  82. package/cjs/TypeSelect/TypeSelect.styles.js.map +1 -1
  83. package/cjs/theme/ThemeProvider.js.map +1 -1
  84. package/cjs/theme/presets/dark.js.map +1 -1
  85. package/cjs/utils/forwardRef.js.map +1 -1
  86. package/cjs/utils/types.js.map +1 -1
  87. package/esm/ActionConfirm/ActionConfirm.js.map +1 -1
  88. package/esm/Alert/Alert.js +4 -4
  89. package/esm/Alert/Alert.js.map +1 -1
  90. package/esm/Badge/Badge.js +3 -3
  91. package/esm/Badge/Badge.js.map +1 -1
  92. package/esm/Badge/BadgeAnchor.js +8 -8
  93. package/esm/Badge/BadgeAnchor.js.map +1 -1
  94. package/esm/Banner/Banner.js +5 -5
  95. package/esm/Banner/Banner.js.map +1 -1
  96. package/esm/Card/Card.js +3 -3
  97. package/esm/Card/Card.js.map +1 -1
  98. package/esm/Center/Center.js +2 -2
  99. package/esm/Center/Center.js.map +1 -1
  100. package/esm/Checkbox/Checkbox.js.map +1 -1
  101. package/esm/Collapse/Collapse.js +1 -1
  102. package/esm/Collapse/Collapse.js.map +1 -1
  103. package/esm/Collapse/CollapsePanel.js.map +1 -1
  104. package/esm/Container/Container.js +4 -4
  105. package/esm/Container/Container.js.map +1 -1
  106. package/esm/DatePicker/generatePicker/generateRangePicker.js +1 -1
  107. package/esm/DatePicker/generatePicker/generateRangePicker.js.map +1 -1
  108. package/esm/DatePicker/generatePicker/generateSinglePicker.js +1 -1
  109. package/esm/DatePicker/generatePicker/generateSinglePicker.js.map +1 -1
  110. package/esm/Descriptions/Description.js.map +1 -1
  111. package/esm/Divider/Divider.js.map +1 -1
  112. package/esm/Drawer/Drawer.js +1 -1
  113. package/esm/Drawer/Drawer.js.map +1 -1
  114. package/esm/Drawer/Drawer.styles.js.map +1 -1
  115. package/esm/Dropdown/Dropdown.js +2 -2
  116. package/esm/Dropdown/Dropdown.js.map +1 -1
  117. package/esm/Dropzone/Dropzone.styles.js.map +1 -1
  118. package/esm/Dropzone/DropzoneStatus.js.map +1 -1
  119. package/esm/Empty/Empty.js +1 -1
  120. package/esm/Empty/Empty.js.map +1 -1
  121. package/esm/Entity/Entity.js.map +1 -1
  122. package/esm/Entity/Field.js.map +1 -1
  123. package/esm/FilterInput/FilterInput.js +1 -1
  124. package/esm/FilterInput/FilterInput.js.map +1 -1
  125. package/esm/FilterInput/FilterInput.styles.js +3 -3
  126. package/esm/FilterInput/FilterInput.styles.js.map +1 -1
  127. package/esm/Form/Form.js +3 -3
  128. package/esm/Form/Form.js.map +1 -1
  129. package/esm/Form/FormItem/FormItem.js +4 -4
  130. package/esm/Form/FormItem/FormItem.js.map +1 -1
  131. package/esm/Grid/Col.js +5 -5
  132. package/esm/Grid/Col.js.map +1 -1
  133. package/esm/Grid/Row.js +4 -4
  134. package/esm/Grid/Row.js.map +1 -1
  135. package/esm/Group/Group.js +2 -2
  136. package/esm/Group/Group.js.map +1 -1
  137. package/esm/Input/Input.js +1 -1
  138. package/esm/Input/Input.js.map +1 -1
  139. package/esm/InputNumber/InputNumber.js.map +1 -1
  140. package/esm/Loading/loaders/Circle.js +2 -2
  141. package/esm/Loading/loaders/Circle.js.map +1 -1
  142. package/esm/Menu/Menu.js.map +1 -1
  143. package/esm/Menu/MenuButton/MenuButton.js +1 -1
  144. package/esm/Modal/ConfirmDialog/ConfirmDialog.js.map +1 -1
  145. package/esm/Modal/Modal.js +1 -1
  146. package/esm/Modal/Modal.js.map +1 -1
  147. package/esm/Modal/Modal.styles.js.map +1 -1
  148. package/esm/Navs/Navs.js +1 -1
  149. package/esm/Navs/Navs.js.map +1 -1
  150. package/esm/Navs/Navs.styles.js.map +1 -1
  151. package/esm/Progress/Progress.styles.js +8 -8
  152. package/esm/Progress/Progress.styles.js.map +1 -1
  153. package/esm/Radio/Radio.js +6 -6
  154. package/esm/Radio/Radio.js.map +1 -1
  155. package/esm/Select/Select.styles.js.map +1 -1
  156. package/esm/Sheet/Sheet.styles.js.map +1 -1
  157. package/esm/ShowMore/ShowMore.js +2 -2
  158. package/esm/ShowMore/ShowMore.js.map +1 -1
  159. package/esm/Skeleton/Skeleton.js +1 -1
  160. package/esm/Skeleton/Skeleton.js.map +1 -1
  161. package/esm/Slider/Marks/Marks.style.js +3 -3
  162. package/esm/Slider/Marks/Marks.style.js.map +1 -1
  163. package/esm/Slider/Slider/Slider.js +1 -1
  164. package/esm/Slider/Slider/Slider.js.map +1 -1
  165. package/esm/Slider/SliderRoot/SliderRoot.js +1 -1
  166. package/esm/Slider/SliderRoot/SliderRoot.js.map +1 -1
  167. package/esm/Slider/SliderRoot/SliderRoot.styles.js.map +1 -1
  168. package/esm/Slider/Thumb/Thumb.js +1 -1
  169. package/esm/Slider/Thumb/Thumb.js.map +1 -1
  170. package/esm/Slider/Thumb/Thumb.styles.js.map +1 -1
  171. package/esm/SliderConfirm/SliderConfirm.styles.js.map +1 -1
  172. package/esm/Snippet/Snippet.js.map +1 -1
  173. package/esm/StatusDot/StatusDot.js +6 -6
  174. package/esm/StatusDot/StatusDot.js.map +1 -1
  175. package/esm/Steps/Step/Step.js +1 -1
  176. package/esm/Steps/Step/Step.js.map +1 -1
  177. package/esm/Steps/Step/Step.styles.js.map +1 -1
  178. package/esm/Steps/Steps.js +1 -1
  179. package/esm/Steps/Steps.js.map +1 -1
  180. package/esm/Steps/Steps.styles.js.map +1 -1
  181. package/esm/Steps/TabStep/TabStep.js +1 -1
  182. package/esm/Steps/TabStep/TabStep.js.map +1 -1
  183. package/esm/Steps/TabStep/TabStep.styles.js.map +1 -1
  184. package/esm/Switch/Switch.js +1 -1
  185. package/esm/Switch/Switch.js.map +1 -1
  186. package/esm/Switch/Switch.styles.js.map +1 -1
  187. package/esm/Table/BaseTable/BasePagination.js +2 -2
  188. package/esm/Table/BaseTable/BasePagination.js.map +1 -1
  189. package/esm/Table/BaseTable/Table.js +2 -2
  190. package/esm/Table/BaseTable/Table.js.map +1 -1
  191. package/esm/Table/BaseTable/TableBody.js +1 -1
  192. package/esm/Table/BaseTable/TableBody.js.map +1 -1
  193. package/esm/Table/BaseTable/TableCell.js +1 -1
  194. package/esm/Table/BaseTable/TableEmpty/CreateButton.styles.js.map +1 -1
  195. package/esm/Table/BaseTable/TableEmpty/index.styles.js +2 -2
  196. package/esm/Table/BaseTable/TableEmpty/index.styles.js.map +1 -1
  197. package/esm/Table/BaseTable/TableFilteredEmpty/Description.styles.js.map +1 -1
  198. package/esm/Table/BaseTable/TableHead.js +1 -1
  199. package/esm/Table/BaseTable/TableHead.js.map +1 -1
  200. package/esm/Table/BaseTable/Toolbar/index.styles.js.map +1 -1
  201. package/esm/Table/DataTable/Table.js +1 -1
  202. package/esm/Table/DataTable/Table.js.map +1 -1
  203. package/esm/Table/DataTable/Toolbar.js.map +1 -1
  204. package/esm/Tabs/Tabs.js +1 -1
  205. package/esm/Tabs/Tabs.js.map +1 -1
  206. package/esm/Tabs/Tabs.styles.js.map +1 -1
  207. package/esm/Tag/Tag.js +1 -1
  208. package/esm/Tag/Tag.js.map +1 -1
  209. package/esm/Text/Text.js +2 -2
  210. package/esm/Text/Text.js.map +1 -1
  211. package/esm/Textarea/Textarea.js +1 -1
  212. package/esm/Textarea/Textarea.js.map +1 -1
  213. package/esm/Tooltip/Tooltip.styles.js.map +1 -1
  214. package/esm/TypeSelect/TypeSelect.js +1 -1
  215. package/esm/TypeSelect/TypeSelect.js.map +1 -1
  216. package/esm/TypeSelect/TypeSelect.styles.js.map +1 -1
  217. package/esm/utils/forwardRef.js.map +1 -1
  218. package/esm/utils/types.js.map +1 -1
  219. package/lib/src/Drawer/Drawer.d.ts +1 -1
  220. package/lib/src/Drawer/Drawer.d.ts.map +1 -1
  221. package/lib/src/Dropzone/Dropzone.d.ts +3 -3
  222. package/lib/src/Dropzone/DropzoneStatus.d.ts +3 -3
  223. package/lib/src/Dropzone/DropzoneStatus.d.ts.map +1 -1
  224. package/lib/src/Form/FormItem/FormItem.d.ts.map +1 -1
  225. package/lib/src/Menu/Menu.d.ts.map +1 -1
  226. package/lib/src/Select/Select.styles.d.ts +1 -1
  227. package/lib/src/Select/iconUtil.d.ts +1 -1
  228. package/lib/src/Sheet/Sheet.d.ts +2 -2
  229. package/lib/src/Sheet/Sheet.d.ts.map +1 -1
  230. package/lib/src/Slider/SliderRoot/SliderRoot.d.ts.map +1 -1
  231. package/lib/src/Steps/Step/Step.styles.d.ts.map +1 -1
  232. package/lib/src/Steps/Steps.d.ts.map +1 -1
  233. package/lib/src/Table/DataTable/Table.d.ts +1 -57
  234. package/lib/src/Table/DataTable/Table.d.ts.map +1 -1
  235. package/lib/src/Table/DataTable/interfaces.d.ts +56 -1
  236. package/lib/src/Table/DataTable/interfaces.d.ts.map +1 -1
  237. package/lib/src/utils/types.d.ts +4 -3
  238. package/lib/src/utils/types.d.ts.map +1 -1
  239. package/lib/tsconfig.tsbuildinfo +1 -1
  240. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"Steps.js","sources":["../../src/Steps/Steps.tsx"],"sourcesContent":["import React, { Children, cloneElement } from 'react';\nimport cx from 'classnames';\nimport forwardRef from '../utils/forwardRef';\nimport { DefaultProps, KubedNumberSize, KubedSizes } from '../theme';\nimport { Step } from './Step/Step';\nimport { TabStep } from './TabStep/TabStep';\nimport { StepCompleted } from './StepCompleted/StepCompleted';\nimport { StepsRoot, StepsContent, StepsSeparator, StepsWrapper } from './Steps.styles';\n\nexport interface StepsProps extends DefaultProps {\n /** <Stepper.Step /> components only */\n children: React.ReactNode;\n\n /** Called when step is clicked */\n onStepClick?(stepIndex: number): void;\n\n /** Active step index */\n active: number;\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 /** Active and progress Step colors from theme.colors */\n color?: string | 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n\n /** Step icon size in px */\n iconSize?: number;\n\n /** Content padding-top from theme.spacing or number to set value in px */\n contentPadding?: KubedNumberSize;\n\n /** Component orientation */\n orientation?: 'vertical' | 'horizontal';\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 /** Breakpoint at which orientation will change from horizontal to vertical */\n breakpoint?: KubedNumberSize;\n\n variant?: 'default' | 'tab';\n}\n\nexport const Steps = forwardRef<StepsProps, 'div'>(\n (\n {\n className,\n children,\n onStepClick,\n active,\n completedIcon,\n progressIcon,\n color,\n iconSize,\n contentPadding,\n size,\n radius,\n orientation,\n breakpoint,\n iconPosition,\n classNames,\n variant = 'default',\n styles,\n ...rest\n },\n ref\n ) => {\n const convertedChildren = Children.toArray(children) as React.ReactElement[];\n const _children = convertedChildren.filter((child) => child.type !== StepCompleted);\n const completedStep = convertedChildren.find((item) => item.type === StepCompleted);\n\n const items = _children.reduce<React.ReactElement[]>((acc, item, index) => {\n const shouldAllowSelect =\n typeof item.props.allowStepSelect === 'boolean'\n ? item.props.allowStepSelect\n : typeof onStepClick === 'function';\n\n const itemState =\n item.props.state ||\n (active === index ? 'stepProgress' : active > index ? 'stepCompleted' : 'stepInactive');\n\n acc.push(\n cloneElement(item, {\n __staticSelector: 'Stepper',\n icon: item.props.icon || index + 1,\n key: index,\n state: itemState,\n onClick: () =>\n shouldAllowSelect && typeof onStepClick === 'function' && onStepClick(index),\n allowStepClick: shouldAllowSelect && typeof onStepClick === 'function',\n completedIcon: item.props.completedIcon || completedIcon,\n progressIcon: item.props.progressIcon || progressIcon,\n color: item.props.color || color,\n iconSize,\n size,\n radius,\n classNames,\n styles,\n iconPosition: item.props.iconPosition || iconPosition,\n orientation,\n variant,\n })\n );\n\n if (index !== _children.length - 1 && variant === 'default') {\n acc.push(\n <StepsSeparator\n className={cx('step-separator', { 'is-active': index < active })}\n $active={index < active}\n $vertical={orientation === 'vertical'}\n key={`separator-${index}`}\n />\n );\n }\n\n return acc;\n }, []);\n\n const stepContent = _children[active]?.props?.children;\n const completedContent = completedStep?.props?.children;\n const content = active > _children.length - 1 ? completedContent : stepContent;\n\n return (\n <StepsRoot\n ref={ref}\n className={cx('steps-root', className, { 'steps-vertical': orientation === 'vertical' })}\n {...rest}\n >\n <StepsWrapper className={cx('steps-wrapper', { 'steps-tab': variant === 'tab' })}>\n {items}\n </StepsWrapper>\n {content && <StepsContent className=\"steps-content\">{content}</StepsContent>}\n </StepsRoot>\n );\n }\n);\n\nexport { Step, StepCompleted, TabStep };\n\n// Steps.Step = Step;\n// Steps.Completed = StepCompleted;\nSteps.displayName = '@kubed/components/Steps';\n"],"names":["M","o","J","u","L","l","X","S","U","Y","V"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,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AAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACA,GAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAACA,GAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAOI,UAAC,CAAC,aAAa,CAACG,sBAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAACD,UAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACF,UAAC,CAAC,aAAa,CAACI,yBAAC,CAAC,CAAC,SAAS,CAACF,UAAC,CAAC,eAAe,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEF,UAAC,CAAC,aAAa,CAACK,yBAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAoD,KAAK,CAAC,WAAW,CAAC,yBAAyB;;;;;"}
1
+ {"version":3,"file":"Steps.js","sources":["../../src/Steps/Steps.tsx"],"sourcesContent":["import React, { Children, cloneElement } from 'react';\nimport cx from 'classnames';\nimport forwardRef from '../utils/forwardRef';\nimport { DefaultProps, KubedNumberSize, KubedSizes } from '../theme';\nimport { Step } from './Step/Step';\nimport { TabStep } from './TabStep/TabStep';\nimport { StepCompleted } from './StepCompleted/StepCompleted';\nimport { StepsRoot, StepsContent, StepsSeparator, StepsWrapper } from './Steps.styles';\n\nexport interface StepsProps extends DefaultProps {\n /** <Stepper.Step /> components only */\n children: React.ReactNode;\n\n /** Called when step is clicked */\n onStepClick?(stepIndex: number): void;\n\n /** Active step index */\n active: number;\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 /** Active and progress Step colors from theme.colors */\n color?: string | 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n\n /** Step icon size in px */\n iconSize?: number;\n\n /** Content padding-top from theme.spacing or number to set value in px */\n contentPadding?: KubedNumberSize;\n\n /** Component orientation */\n orientation?: 'vertical' | 'horizontal';\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 /** Breakpoint at which orientation will change from horizontal to vertical */\n breakpoint?: KubedNumberSize;\n\n variant?: 'default' | 'tab';\n}\n\nfunction getElementChildren(children: React.ReactNode): React.ReactElement<any>[] {\n const elements: React.ReactElement<any>[] = [];\n\n Children.forEach(children, (child) => {\n if (!React.isValidElement(child)) {\n return;\n }\n\n if (child.type === React.Fragment) {\n elements.push(\n ...getElementChildren((child.props as { children?: React.ReactNode }).children)\n );\n return;\n }\n\n elements.push(child);\n });\n\n return elements;\n}\n\nexport const Steps = forwardRef<StepsProps, 'div'>(\n (\n {\n className,\n children,\n onStepClick,\n active,\n completedIcon,\n progressIcon,\n color,\n iconSize,\n contentPadding,\n size,\n radius,\n orientation,\n breakpoint,\n iconPosition,\n classNames,\n variant = 'default',\n styles,\n ...rest\n },\n ref\n ) => {\n const convertedChildren = getElementChildren(children);\n const _children = convertedChildren.filter((child) => child.type !== StepCompleted);\n const completedStep = convertedChildren.find((item) => item.type === StepCompleted);\n\n const items = _children.reduce<React.ReactElement[]>(\n (acc, item: React.ReactElement<any>, index) => {\n const shouldAllowSelect =\n typeof item.props.allowStepSelect === 'boolean'\n ? item.props.allowStepSelect\n : typeof onStepClick === 'function';\n\n const itemState =\n item.props.state ||\n (active === index ? 'stepProgress' : active > index ? 'stepCompleted' : 'stepInactive');\n\n acc.push(\n cloneElement(item, {\n __staticSelector: 'Stepper',\n icon: item.props.icon || index + 1,\n key: index,\n state: itemState,\n onClick: () =>\n shouldAllowSelect && typeof onStepClick === 'function' && onStepClick(index),\n allowStepClick: shouldAllowSelect && typeof onStepClick === 'function',\n completedIcon: item.props.completedIcon || completedIcon,\n progressIcon: item.props.progressIcon || progressIcon,\n color: item.props.color || color,\n iconSize,\n size,\n radius,\n classNames,\n styles,\n iconPosition: item.props.iconPosition || iconPosition,\n orientation,\n variant,\n })\n );\n\n if (index !== _children.length - 1 && variant === 'default') {\n acc.push(\n <StepsSeparator\n className={cx('step-separator', { 'is-active': index < active })}\n $active={index < active}\n $vertical={orientation === 'vertical'}\n key={`separator-${index}`}\n />\n );\n }\n\n return acc;\n },\n []\n );\n\n const stepContent = _children[active]?.props?.children;\n const completedContent = completedStep?.props?.children;\n const content = active > _children.length - 1 ? completedContent : stepContent;\n\n return (\n <StepsRoot\n ref={ref}\n className={cx('steps-root', className, { 'steps-vertical': orientation === 'vertical' })}\n {...rest}\n >\n <StepsWrapper className={cx('steps-wrapper', { 'steps-tab': variant === 'tab' })}>\n {items}\n </StepsWrapper>\n {content && <StepsContent className=\"steps-content\">{content}</StepsContent>}\n </StepsRoot>\n );\n }\n);\n\nexport { Step, StepCompleted, TabStep };\n\n// Steps.Step = Step;\n// Steps.Completed = StepCompleted;\nSteps.displayName = '@kubed/components/Steps';\n"],"names":["o","J","c","M","f","L","Y","u","U","Z","X"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,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CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAOL,UAAC,CAAC,aAAa,CAACM,sBAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAACD,UAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACL,UAAC,CAAC,aAAa,CAACO,yBAAC,CAAC,CAAC,SAAS,CAACF,UAAC,CAAC,eAAe,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEL,UAAC,CAAC,aAAa,CAACQ,yBAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAoD,KAAK,CAAC,WAAW,CAAC,yBAAyB;;;;;"}
@@ -1 +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":["e","p"],"mappings":";;;;;;;;;;AAAuD,MAAC,SAAS,CAACA,UAAC,CAAC,GAAG,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,YAAY,CAACA,UAAC,CAAC,GAAG,CAAC;AACrB;AACA;AACA;AACA;AACA,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACzD;AACA;AACA;AACA,CAAC,CAAC,YAAY,CAACA,UAAC,CAAC,GAAG,CAAC;AACrB;AACA,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAACC,KAAC,CAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,CAAC,CAACA,KAAC,CAAC;AACR;AACA;AACA;AACA,EAAE,CAAC,CAAa,MAAC,cAAc,CAACD,UAAC,CAAC,KAAK,CAAC,CAAC;AACzC,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AAC7E,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1B;;;;;;;"}
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":["e","t","p"],"mappings":";;;;;;;;;;AAAuD,MAAC,SAAS,CAACA,UAAC,CAAC,GAAG,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,YAAY,CAACA,UAAC,CAAC,GAAG,CAAC;AACrB;AACA;AACA;AACA;AACA,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACzD;AACA;AACA;AACA,CAAC,CAAC,YAAY,CAACA,UAAC,CAAC,GAAG,CAAC;AACrB;AACA,EAAE,MAAM,CAAC,CAACC,GAAC,EAAEA,GAAC,CAACC,KAAC,CAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,CAAC,CAACA,KAAC,CAAC;AACR;AACA;AACA;AACA,EAAE,CAAC,CAAa,MAAC,cAAc,CAACF,UAAC,CAAC,KAAK,CAAC,CAAC;AACzC,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AAC7E,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1B;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var T=require("react"),h=require("classnames"),k=require("@kubed/icons"),R=require("../../utils/forwardRef.js"),v=require("../../Loading/Loading.js"),s=require("./TabStep.styles.js");function S(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var a=S(T),W=S(h),M=Object.defineProperty,B=Object.defineProperties,K=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,w=(e,t,r)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,d=(e,t)=>{for(var r in t||(t={}))g.call(t,r)&&w(e,r,t[r]);if(c)for(var r of c(t))y.call(t,r)&&w(e,r,t[r]);return e},Q=(e,t)=>B(e,K(t)),A=(e,t)=>{var r={};for(var l in e)g.call(e,l)&&t.indexOf(l)<0&&(r[l]=e[l]);if(e!=null&&c)for(var l of c(e))t.indexOf(l)<0&&y.call(e,l)&&(r[l]=e[l]);return r};const F={xs:16,sm:18,md:20,lg:22,xl:24},O=R.default((e,t)=>{var r=e,{className:l,state:o,color:j,icon:n,completedIcon:E,progressIcon:I,label:p,description:i,completedDescription:C,progressDescription:P,withIcon:L=!0,iconSize:_,size:z="md",loading:m,allowStepClick:D=!0,allowStepSelect:G,classNames:N,styles:H}=r,q=A(r,["className","state","color","icon","completedIcon","progressIcon","label","description","completedDescription","progressDescription","withIcon","iconSize","size","loading","allowStepClick","allowStepSelect","classNames","styles"]);const x=o==="stepCompleted"?null:o==="stepProgress"?I:n,u=_||F[z],f={"data-progress":o==="stepProgress"||void 0,"data-completed":o==="stepCompleted"||void 0},b=o==="stepCompleted"?C||i:o==="stepProgress"&&P||i;return a.createElement(s.StepWrapper,d(Q(d({tabIndex:D?0:-1,ref:t},f),{className:W("step-item",N)}),q),L&&a.createElement(s.StepIconWrapper,null,a.createElement(s.StepIcon,d({},f),o==="stepCompleted"?a.createElement(s.StepCompletedIcon,null,m?a.createElement(v.Loading,{color:"#fff",size:u,className:"stepLoader"}):n||E||a.createElement(k.Check,{size:24,color:"#fff"})):null,o!=="stepCompleted"?m?a.createElement(v.Loading,{size:u,color:j}):x||n:null)),(p||i)&&a.createElement(s.StepBody,null,p&&a.createElement(s.StepLabel,null,p),b&&a.createElement(s.StepDescription,{color:"dimmed"},b)))});O.displayName="@kubed/components/TabStep",exports.TabStep=O;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var T=require("react"),h=require("classnames"),k=require("@kubed/icons"),R=require("../../utils/forwardRef.js"),v=require("../../Loading/Loading.js"),s=require("./TabStep.styles.js");function S(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var a=S(T),W=S(h),M=Object.defineProperty,B=Object.defineProperties,K=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,w=(e,t,r)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,d=(e,t)=>{for(var r in t||(t={}))g.call(t,r)&&w(e,r,t[r]);if(c)for(var r of c(t))y.call(t,r)&&w(e,r,t[r]);return e},Q=(e,t)=>B(e,K(t)),A=(e,t)=>{var r={};for(var l in e)g.call(e,l)&&t.indexOf(l)<0&&(r[l]=e[l]);if(e!=null&&c)for(var l of c(e))t.indexOf(l)<0&&y.call(e,l)&&(r[l]=e[l]);return r};const F={xs:16,sm:18,md:20,lg:22,xl:24},O=R.default((e,t)=>{var r=e,{className:l,state:o,color:P,icon:n,completedIcon:j,progressIcon:E,label:p,description:i,completedDescription:I,progressDescription:C,withIcon:L=!0,iconSize:_,size:z="md",loading:m,allowStepClick:D=!0,allowStepSelect:G,classNames:N,styles:H}=r,q=A(r,["className","state","color","icon","completedIcon","progressIcon","label","description","completedDescription","progressDescription","withIcon","iconSize","size","loading","allowStepClick","allowStepSelect","classNames","styles"]);const x=o==="stepCompleted"?null:o==="stepProgress"?E:n,u=_||F[z],f={"data-progress":o==="stepProgress"||void 0,"data-completed":o==="stepCompleted"||void 0},b=o==="stepCompleted"?I||i:o==="stepProgress"&&C||i;return a.createElement(s.StepWrapper,d(Q(d({tabIndex:D?0:-1,ref:t},f),{className:W("step-item",N)}),q),L&&a.createElement(s.StepIconWrapper,null,a.createElement(s.StepIcon,d({},f),o==="stepCompleted"?a.createElement(s.StepCompletedIcon,null,m?a.createElement(v.Loading,{color:"#fff",size:u,className:"stepLoader"}):n||j||a.createElement(k.Check,{size:24,color:"#fff"})):null,o!=="stepCompleted"?m?a.createElement(v.Loading,{size:u,color:P}):x||n:null)),(p||i)&&a.createElement(s.StepBody,null,p&&a.createElement(s.StepLabel,null,p),b&&a.createElement(s.StepDescription,{color:"dimmed"},b)))});O.displayName="@kubed/components/TabStep",exports.TabStep=O;
2
2
  //# sourceMappingURL=TabStep.js.map
@@ -1 +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":["t","o"],"mappings":";;;;;;;;;;;AAAsF,MAAC,WAAW,CAACA,UAAC,CAAC,GAAG,CAAC;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;AAC1D;AACA,CAAC,CAAC,QAAQ,CAACA,UAAC,CAAC,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AAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACzD,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;AAC1D;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,eAAe,CAACD,UAAC,CAAC,GAAG,CAAC;AACxB;AACA;AACA;AACA,CAAC,CAAC,iBAAiB,CAACA,UAAC,CAAC,GAAG,CAAC;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;"}
1
+ {"version":3,"file":"TabStep.styles.js","sources":["../../../src/Steps/TabStep/TabStep.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { 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":["t","o"],"mappings":";;;;;;;;;;;AAAsF,MAAC,WAAW,CAACA,UAAC,CAAC,GAAG,CAAC;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;AAC1D;AACA,CAAC,CAAC,QAAQ,CAACA,UAAC,CAAC,GAAG,CAAC;AACjB;AACA;AACA;AACA,CAAC,CAAC,SAAS,CAACA,UAAC,CAAC,GAAG,CAAC;AAClB;AACA;AACA;AACA;AACA,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AAC5C,CAAC,CAAC,eAAe,CAACA,UAAC,CAAC,GAAG,CAAC;AACxB;AACA;AACA,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AAC5C,CAAC,CAAC,QAAQ,CAACA,UAAC,CAAC,GAAG,CAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACzD;AACA,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACzD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AAC5C;AACA;AACA,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAGC,gBAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAGA,gBAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;AACxD,wBAAwB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAGA,gBAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACzD,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;AAC1D;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,eAAe,CAACD,UAAC,CAAC,GAAG,CAAC;AACxB;AACA;AACA;AACA,CAAC,CAAC,iBAAiB,CAACA,UAAC,CAAC,GAAG,CAAC;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _=require("react"),q=require("classnames"),v=require("@kubed/hooks"),I=require("lodash"),T=require("../utils/forwardRef.js"),c=require("./Switch.styles.js");function p(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var n=p(_),P=p(q),W=Object.defineProperty,i=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,m=(e,r,t)=>r in e?W(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,B=(e,r)=>{for(var t in r||(r={}))k.call(r,t)&&m(e,t,r[t]);if(i)for(var t of i(r))y.call(r,t)&&m(e,t,r[t]);return e},F=(e,r)=>{var t={};for(var a in e)k.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&i)for(var a of i(e))r.indexOf(a)<0&&y.call(e,a)&&(t[a]=e[a]);return t};const w=T.default((e,r)=>{var t=e,{id:a,defaultChecked:S,checked:g,disabled:u,onChange:s,okText:x,offText:E,label:f,variant:C="default"}=t,O=F(t,["id","defaultChecked","checked","disabled","onChange","okText","offText","label","variant"]);const d=v.useId(a),[l,j]=v.useUncontrolled({value:g,defaultValue:S,finalValue:!1,rule:o=>!I.isUndefined(o),onChange:()=>{}}),h=o=>{if(u)return;const b=o.target.checked;j(b),s&&s(b,o)};return C==="button"?n.createElement(c.StyledButton,{radius:"xl",variant:"filled",forwardedAs:"label",color:l?"secondary":"default",htmlFor:d,rightIcon:n.createElement(c.ButtonControl,{checked:l,disabled:u},n.createElement(c.StyledInput,{id:d,type:"checkbox",onChange:h,checked:l})),className:P({"switch-button-checked":l,"switch-button":!l})},f):n.createElement(c.SwitchWrap,B({ref:r},O),n.createElement(c.SwitchControl,{checked:l,disabled:u},n.createElement(c.StyledInput,{id:d,type:"checkbox",onChange:h,checked:l}),n.createElement(c.TextWrap,{checked:l},l?x:E)),f&&n.createElement(c.LabelWrap,{htmlFor:d},f))});w.displayName="@kubed/components/Switch",exports.Switch=w;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _=require("react"),q=require("classnames"),v=require("@kubed/hooks"),P=require("lodash"),I=require("../utils/forwardRef.js"),c=require("./Switch.styles.js");function p(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var n=p(_),T=p(q),W=Object.defineProperty,i=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,m=(e,r,t)=>r in e?W(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,B=(e,r)=>{for(var t in r||(r={}))k.call(r,t)&&m(e,t,r[t]);if(i)for(var t of i(r))y.call(r,t)&&m(e,t,r[t]);return e},F=(e,r)=>{var t={};for(var a in e)k.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&i)for(var a of i(e))r.indexOf(a)<0&&y.call(e,a)&&(t[a]=e[a]);return t};const w=I.default((e,r)=>{var t=e,{id:a,defaultChecked:S,checked:g,disabled:u,onChange:s,okText:x,offText:E,label:f,variant:C="default"}=t,O=F(t,["id","defaultChecked","checked","disabled","onChange","okText","offText","label","variant"]);const d=v.useId(a),[l,j]=v.useUncontrolled({value:g,defaultValue:S,finalValue:!1,rule:o=>!P.isUndefined(o),onChange:()=>{}}),h=o=>{if(u)return;const b=o.target.checked;j(b),s&&s(b,o)};return C==="button"?n.createElement(c.StyledButton,{radius:"xl",variant:"filled",forwardedAs:"label",color:l?"secondary":"default",htmlFor:d,rightIcon:n.createElement(c.ButtonControl,{checked:l,disabled:u},n.createElement(c.StyledInput,{id:d,type:"checkbox",onChange:h,checked:l})),className:T({"switch-button-checked":l,"switch-button":!l})},f):n.createElement(c.SwitchWrap,B({ref:r},O),n.createElement(c.SwitchControl,{checked:l,disabled:u},n.createElement(c.StyledInput,{id:d,type:"checkbox",onChange:h,checked:l}),n.createElement(c.TextWrap,{checked:l},l?x:E)),f&&n.createElement(c.LabelWrap,{htmlFor:d},f))});w.displayName="@kubed/components/Switch",exports.Switch=w;
2
2
  //# sourceMappingURL=Switch.js.map
@@ -50,5 +50,5 @@
50
50
  width: 1px;
51
51
  height: 12px;
52
52
  background-color: ${({theme:e})=>e.palette.accents_2};
53
- `,W=10,X=({className:e,style:r,config:{isShowSetPageSize:l=!0,isShowDivider:x=!0,isShowTotalCount:E=!0,isShowPagination:h=!0}={},instance:y})=>{const{getCanNextPage:_,getCanPreviousPage:w,getState:P,getRowCount:C,getPageCount:S,nextPage:b,previousPage:B,setPageSize:I,setPageIndex:M}=y,{pageIndex:j,pageSize:k}=P(),c=C(),i=S(),{locales:q}=O.useLocales(),{Pagination:u}=q,D=()=>{if(i&&i>0){const o=Array.from({length:i},(n,L)=>L).map(n=>t.createElement(d.MenuItem,{key:n,onClick:()=>M(n)},n+1));return t.createElement(f,null,o)}return null},z=()=>{const o=[10,20,50,100].map(n=>t.createElement(d.MenuItem,{style:{alignItems:"center"},key:n.toString(),onClick:()=>{I(n)}},n));return t.createElement(f,null,o)};return t.createElement(U,{className:G(e,"table-pagination-wrapper"),style:r},t.createElement(J,null,l&&t.createElement(m.Dropdown,{trigger:"mouseenter click",interactive:!0,content:z()},t.createElement(K,null,t.createElement("span",null,u.limit),t.createElement("span",null,k),t.createElement(s.CaretDown,null))),x&&t.createElement(V,null),E&&t.createElement(R,{className:"total-count"},t.createElement("span",null,u.totalItems),t.createElement("span",null,c??0))),h&&t.createElement(H,null,t.createElement(g.Button,{variant:"text",radius:"sm",onClick:()=>B(),disabled:!w()},t.createElement(s.Previous,{size:20})),t.createElement(m.Dropdown,{trigger:"mouseenter click",content:D(),interactive:!0},t.createElement(Q,null,j+1," / ",i)),t.createElement(g.Button,{variant:"text",radius:"sm",onClick:()=>{b()},disabled:!_()},t.createElement(s.Next,{size:20}))))};exports.BasePagination=X,exports.DEFAULT_PAGE_SIZE=W;
53
+ `,W=10,X=({className:e,style:r,config:{isShowSetPageSize:l=!0,isShowDivider:x=!0,isShowTotalCount:E=!0,isShowPagination:h=!0}={},instance:y})=>{const{getCanNextPage:P,getCanPreviousPage:_,getState:w,getRowCount:C,getPageCount:b,nextPage:S,previousPage:B,setPageSize:I,setPageIndex:M}=y,{pageIndex:j,pageSize:k}=w(),c=C(),i=b(),{locales:q}=O.useLocales(),{Pagination:u}=q,D=()=>{if(i&&i>0){const o=Array.from({length:i},(n,L)=>L).map(n=>t.createElement(d.MenuItem,{key:n,onClick:()=>M(n)},n+1));return t.createElement(f,null,o)}return null},z=()=>{const o=[10,20,50,100].map(n=>t.createElement(d.MenuItem,{style:{alignItems:"center"},key:n.toString(),onClick:()=>{I(n)}},n));return t.createElement(f,null,o)};return t.createElement(U,{className:G(e,"table-pagination-wrapper"),style:r},t.createElement(J,null,l&&t.createElement(m.Dropdown,{trigger:"mouseenter click",interactive:!0,content:z()},t.createElement(K,null,t.createElement("span",null,u.limit),t.createElement("span",null,k),t.createElement(s.CaretDown,null))),x&&t.createElement(V,null),E&&t.createElement(R,{className:"total-count"},t.createElement("span",null,u.totalItems),t.createElement("span",null,c??0))),h&&t.createElement(H,null,t.createElement(g.Button,{variant:"text",radius:"sm",onClick:()=>B(),disabled:!_()},t.createElement(s.Previous,{size:20})),t.createElement(m.Dropdown,{trigger:"mouseenter click",content:D(),interactive:!0},t.createElement(Q,null,j+1," / ",i)),t.createElement(g.Button,{variant:"text",radius:"sm",onClick:()=>{S()},disabled:!P()},t.createElement(s.Next,{size:20}))))};exports.BasePagination=X,exports.DEFAULT_PAGE_SIZE=W;
54
54
  //# sourceMappingURL=BasePagination.js.map
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var P=require("classnames"),$=require("lodash"),H=require("react"),u=require("styled-components"),W=require("./context.js");function x(e){return e&&typeof e=="object"&&"default"in e?e.default:e}function q(e){if(e&&e.__esModule)return e;var t=Object.create(null);if(e)for(var r in e)t[r]=e[r];return t.default=e,Object.freeze(t)}var y=x(P),l=q(H),O=x(u),z=Object.defineProperty,L=Object.defineProperties,M=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,g=(e,t,r)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,f=(e,t)=>{for(var r in t||(t={}))h.call(t,r)&&g(e,r,t[r]);if(i)for(var r of i(t))w.call(t,r)&&g(e,r,t[r]);return e},R=(e,t)=>L(e,M(t)),T=(e,t)=>{var r={};for(var a in e)h.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&&w.call(e,a)&&(r[a]=e[a]);return r};const D=O("table")(({theme:e,$stickyHeader:t,$maxContext:r})=>f(f({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{textAlign:"left",padding:e.layout.spacing.md,color:e.palette.accents_5}},t&&{borderCollapse:"separate",width:"100%",minWidth:"100%"}),r&&{width:"max-content"})),A=O.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var N=require("classnames"),$=require("lodash"),H=require("react"),u=require("styled-components"),W=require("./context.js");function x(e){return e&&typeof e=="object"&&"default"in e?e.default:e}function q(e){if(e&&e.__esModule)return e;var t=Object.create(null);if(e)for(var r in e)t[r]=e[r];return t.default=e,Object.freeze(t)}var y=x(N),l=q(H),O=x(u),z=Object.defineProperty,L=Object.defineProperties,M=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,g=(e,t,r)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,f=(e,t)=>{for(var r in t||(t={}))h.call(t,r)&&g(e,r,t[r]);if(i)for(var r of i(t))w.call(t,r)&&g(e,r,t[r]);return e},R=(e,t)=>L(e,M(t)),T=(e,t)=>{var r={};for(var a in e)h.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&&w.call(e,a)&&(r[a]=e[a]);return r};const D=O("table")(({theme:e,$stickyHeader:t,$maxContext:r})=>f(f({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{textAlign:"left",padding:e.layout.spacing.md,color:e.palette.accents_5}},t&&{borderCollapse:"separate",width:"100%",minWidth:"100%"}),r&&{width:"max-content"})),A=O.div`
2
2
  ${({atStart:e})=>e&&u.css`
3
3
  .table-cell--fixed-last-left:after {
4
4
  box-shadow: unset;
@@ -9,5 +9,5 @@
9
9
  box-shadow: unset;
10
10
  }
11
11
  `}
12
- `,I=l.forwardRef((e,t)=>{const r=e,{padding:a="normal",size:p="medium",stickyHeader:d=!1,className:S,tableWrapperClassName:_,maxContext:b,wrapperStyle:m}=r,E=T(r,["padding","size","stickyHeader","className","tableWrapperClassName","maxContext","wrapperStyle"]),j=l.useMemo(()=>({padding:a,size:p,stickyHeader:d}),[a,p,d]),s=l.useRef(null),[v,C]=l.useState({atStart:!0,atEnd:!1});return l.useEffect(()=>{const o=$.throttle(()=>{if(s.current){const{scrollLeft:n,scrollWidth:k,clientWidth:N}=s.current;C({atStart:n===0,atEnd:n+N>=k})}},200),c=s.current;if(c){o(),c.addEventListener("scroll",o);const n=new ResizeObserver(o);return n.observe(c),()=>{c.removeEventListener("scroll",o),n.disconnect()}}return()=>{}},[]),l.createElement(W.TableContext.Provider,{value:j},l.createElement(A,{ref:s,className:y(_,"kube-table-wrapper"),atStart:v.atStart,atEnd:v.atEnd,style:m??{}},l.createElement(D,R(f({},E),{$stickyHeader:d,$maxContext:b,ref:t,className:y(S,"kube-table",{"kube-table--max-context":b})}))))});exports.Table=I;
12
+ `,I=l.forwardRef((e,t)=>{const r=e,{padding:a="normal",size:p="medium",stickyHeader:d=!1,className:_,tableWrapperClassName:E,maxContext:b,wrapperStyle:m}=r,j=T(r,["padding","size","stickyHeader","className","tableWrapperClassName","maxContext","wrapperStyle"]),S=l.useMemo(()=>({padding:a,size:p,stickyHeader:d}),[a,p,d]),s=l.useRef(null),[v,C]=l.useState({atStart:!0,atEnd:!1});return l.useEffect(()=>{const o=$.throttle(()=>{if(s.current){const{scrollLeft:n,scrollWidth:P,clientWidth:k}=s.current;C({atStart:n===0,atEnd:n+k>=P})}},200),c=s.current;if(c){o(),c.addEventListener("scroll",o);const n=new ResizeObserver(o);return n.observe(c),()=>{c.removeEventListener("scroll",o),n.disconnect()}}return()=>{}},[]),l.createElement(W.TableContext.Provider,{value:S},l.createElement(A,{ref:s,className:y(E,"kube-table-wrapper"),atStart:v.atStart,atEnd:v.atEnd,style:m??{}},l.createElement(D,R(f({},j),{$stickyHeader:d,$maxContext:b,ref:t,className:y(_,"kube-table",{"kube-table--max-context":b})}))))});exports.Table=I;
13
13
  //# sourceMappingURL=Table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sources":["../../../src/Table/BaseTable/Table.tsx"],"sourcesContent":["import cx from 'classnames';\nimport { throttle } from 'lodash';\nimport * as React from 'react';\nimport styled, { css } from 'styled-components';\nimport { TableContext } from './context';\n\nconst TableRoot = styled('table')<{\n $stickyHeader?: boolean;\n $maxContext?: boolean;\n}>(({ theme, $stickyHeader, $maxContext }) => ({\n display: 'table',\n width: '100%',\n borderCollapse: 'collapse',\n borderSpacing: 0,\n '& caption': {\n textAlign: 'left',\n padding: theme.layout.spacing.md,\n color: theme.palette.accents_5,\n },\n ...($stickyHeader && {\n borderCollapse: 'separate',\n width: '100%',\n minWidth: '100%',\n }),\n ...($maxContext && {\n width: 'max-content',\n }),\n}));\n\ninterface TableInnerProps {\n padding?: 'normal' | 'none';\n size?: 'small' | 'medium';\n stickyHeader?: boolean;\n className?: string;\n style?: React.CSSProperties;\n tableWrapperClassName?: string;\n maxContext?: boolean;\n wrapperStyle?: React.CSSProperties;\n}\n\nexport type { TableInnerProps as TableProps };\n\nconst TableWrapper = styled.div<{ atStart?: boolean; atEnd?: boolean }>`\n ${({ atStart }) =>\n atStart &&\n css`\n .table-cell--fixed-last-left:after {\n box-shadow: unset;\n }\n `}\n ${({ atEnd }) =>\n atEnd &&\n css`\n .table-cell--fixed-last-right:before {\n box-shadow: unset;\n }\n `}\n`;\n\nexport const Table = React.forwardRef<HTMLTableElement, React.PropsWithChildren<TableInnerProps>>(\n (props, ref) => {\n const {\n padding = 'normal',\n size = 'medium',\n stickyHeader = false,\n className,\n tableWrapperClassName,\n maxContext,\n wrapperStyle,\n ...other\n } = props;\n\n const table = React.useMemo(\n () => ({\n padding,\n size,\n stickyHeader,\n }),\n [padding, size, stickyHeader]\n );\n\n const wrapperRef = React.useRef<HTMLDivElement>(null);\n const [scrollStatus, setScrollStatus] = React.useState<{ atStart: boolean; atEnd: boolean }>({\n atStart: true,\n atEnd: false,\n });\n\n React.useEffect(() => {\n // const throttle = (func: () => void, limit: number) => {\n // let lastFunc: ReturnType<typeof setTimeout>;\n // let lastRan: number;\n // return () => {\n // const now = Date.now();\n // if (!lastRan) {\n // func();\n // lastRan = now;\n // } else {\n // clearTimeout(lastFunc);\n // lastFunc = setTimeout(() => {\n // if (Date.now() - lastRan >= limit) {\n // func();\n // lastRan = Date.now();\n // }\n // }, limit - (now - lastRan));\n // }\n // };\n // };\n\n const handleScroll = () => {\n if (wrapperRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = wrapperRef.current;\n setScrollStatus({\n atStart: scrollLeft === 0,\n atEnd: scrollLeft + clientWidth >= scrollWidth,\n });\n }\n };\n\n const throttledHandleScroll = throttle(handleScroll, 200);\n\n const wrapper = wrapperRef.current;\n if (wrapper) {\n throttledHandleScroll();\n wrapper.addEventListener('scroll', throttledHandleScroll);\n\n const resizeObserver = new ResizeObserver(throttledHandleScroll);\n resizeObserver.observe(wrapper);\n\n return () => {\n wrapper.removeEventListener('scroll', throttledHandleScroll);\n resizeObserver.disconnect();\n };\n }\n\n return () => {};\n }, []);\n\n return (\n <TableContext.Provider value={table}>\n <TableWrapper\n ref={wrapperRef}\n className={cx(tableWrapperClassName, 'kube-table-wrapper')}\n atStart={scrollStatus.atStart}\n atEnd={scrollStatus.atEnd}\n style={wrapperStyle ?? {}}\n >\n <TableRoot\n {...other}\n $stickyHeader={stickyHeader}\n $maxContext={maxContext}\n ref={ref}\n className={cx(className, 'kube-table', {\n 'kube-table--max-context': maxContext,\n })}\n />\n </TableWrapper>\n </T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AAyB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;"}
1
+ {"version":3,"file":"Table.js","sources":["../../../src/Table/BaseTable/Table.tsx"],"sourcesContent":["import cx from 'classnames';\nimport { throttle } from 'lodash';\nimport * as React from 'react';\nimport styled, { css } from 'styled-components';\nimport { TableContext } from './context';\n\nconst TableRoot = styled('table')<{\n $stickyHeader?: boolean;\n $maxContext?: boolean;\n}>(({ theme, $stickyHeader, $maxContext }) => ({\n display: 'table',\n width: '100%',\n borderCollapse: 'collapse',\n borderSpacing: 0,\n '& caption': {\n textAlign: 'left',\n padding: theme.layout.spacing.md,\n color: theme.palette.accents_5,\n },\n ...($stickyHeader && {\n borderCollapse: 'separate',\n width: '100%',\n minWidth: '100%',\n }),\n ...($maxContext && {\n width: 'max-content',\n }),\n}));\n\ninterface TableInnerProps {\n padding?: 'normal' | 'none';\n size?: 'small' | 'medium';\n stickyHeader?: boolean;\n className?: string;\n style?: React.CSSProperties;\n tableWrapperClassName?: string;\n maxContext?: boolean;\n wrapperStyle?: React.CSSProperties;\n}\n\nexport type { TableInnerProps as TableProps };\n\nconst TableWrapper = styled.div<{ atStart?: boolean; atEnd?: boolean }>`\n ${({ atStart }) =>\n atStart &&\n css`\n .table-cell--fixed-last-left:after {\n box-shadow: unset;\n }\n `}\n ${({ atEnd }) =>\n atEnd &&\n css`\n .table-cell--fixed-last-right:before {\n box-shadow: unset;\n }\n `}\n`;\n\nexport const Table = React.forwardRef<HTMLTableElement, React.PropsWithChildren<TableInnerProps>>(\n (props, ref) => {\n const {\n padding = 'normal',\n size = 'medium',\n stickyHeader = false,\n className,\n tableWrapperClassName,\n maxContext,\n wrapperStyle,\n ...other\n } = props;\n\n const table = React.useMemo(\n () => ({\n padding,\n size,\n stickyHeader,\n }),\n [padding, size, stickyHeader]\n );\n\n const wrapperRef = React.useRef<HTMLDivElement>(null);\n const [scrollStatus, setScrollStatus] = React.useState<{ atStart: boolean; atEnd: boolean }>({\n atStart: true,\n atEnd: false,\n });\n\n React.useEffect(() => {\n // const throttle = (func: () => void, limit: number) => {\n // let lastFunc: ReturnType<typeof setTimeout>;\n // let lastRan: number;\n // return () => {\n // const now = Date.now();\n // if (!lastRan) {\n // func();\n // lastRan = now;\n // } else {\n // clearTimeout(lastFunc);\n // lastFunc = setTimeout(() => {\n // if (Date.now() - lastRan >= limit) {\n // func();\n // lastRan = Date.now();\n // }\n // }, limit - (now - lastRan));\n // }\n // };\n // };\n\n const handleScroll = () => {\n if (wrapperRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = wrapperRef.current;\n setScrollStatus({\n atStart: scrollLeft === 0,\n atEnd: scrollLeft + clientWidth >= scrollWidth,\n });\n }\n };\n\n const throttledHandleScroll = throttle(handleScroll, 200);\n\n const wrapper = wrapperRef.current;\n if (wrapper) {\n throttledHandleScroll();\n wrapper.addEventListener('scroll', throttledHandleScroll);\n\n const resizeObserver = new ResizeObserver(throttledHandleScroll);\n resizeObserver.observe(wrapper);\n\n return () => {\n wrapper.removeEventListener('scroll', throttledHandleScroll);\n resizeObserver.disconnect();\n };\n }\n\n return () => {};\n }, []);\n\n return (\n <TableContext.Provider value={table}>\n <TableWrapper\n ref={wrapperRef}\n className={cx(tableWrapperClassName, 'kube-table-wrapper')}\n atStart={scrollStatus.atStart}\n atEnd={scrollStatus.atEnd}\n style={wrapperStyle ?? {}}\n >\n <TableRoot\n {...other}\n $stickyHeader={stickyHeader}\n $maxContext={maxContext}\n ref={ref}\n className={cx(className, 'kube-table', {\n 'kube-table--max-context': maxContext,\n })}\n />\n </TableWrapper>\n </TableContext.Provider>\n );\n }\n);\n"],"names":["y","E","o","z","I","v"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,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AC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,GAAE,CAAC,CAAC,OAAM,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAACD,YAAC,CAAC,aAAa,CAACE,oBAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAACF,YAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAACG,UAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAACH,YAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAACG,UAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var p=require("styled-components"),y=require("react"),m=require("classnames"),O=require("./context.js");function c(e){return e&&typeof e=="object"&&"default"in e?e.default:e}function _(e){if(e&&e.__esModule)return e;var r=Object.create(null);if(e)for(var a in e)r[a]=e[a];return r.default=e,Object.freeze(r)}var j=c(p),o=_(y),B=c(m),P=Object.defineProperty,h=Object.defineProperties,w=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,f=(e,r,a)=>r in e?P(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,i=(e,r)=>{for(var a in r||(r={}))s.call(r,a)&&f(e,a,r[a]);if(n)for(var a of n(r))u.call(r,a)&&f(e,a,r[a]);return e},x=(e,r)=>h(e,w(r)),g=(e,r)=>{var a={};for(var t in e)s.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&n)for(var t of n(e))r.indexOf(t)<0&&u.call(e,t)&&(a[t]=e[t]);return a};const q=j("tbody").attrs(({className:e})=>B(e,"kube-table-body"))(()=>({display:"table-row-group"})),v={variant:"body",hasBorder:!1},N=o.forwardRef((e,r)=>{var a=e,{className:t,hasBorder:l=v.hasBorder}=a,d=g(a,["className","hasBorder"]);const b=o.useMemo(()=>x(i({},v),{hasBorder:l}),[l]);return o.createElement(O.TableLvContext.Provider,{value:b},o.createElement(q,i({ref:r},d)))});exports.TableBody=N;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var p=require("styled-components"),y=require("react"),m=require("classnames"),O=require("./context.js");function c(e){return e&&typeof e=="object"&&"default"in e?e.default:e}function _(e){if(e&&e.__esModule)return e;var r=Object.create(null);if(e)for(var a in e)r[a]=e[a];return r.default=e,Object.freeze(r)}var j=c(p),o=_(y),P=c(m),B=Object.defineProperty,h=Object.defineProperties,w=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,f=(e,r,a)=>r in e?B(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,i=(e,r)=>{for(var a in r||(r={}))s.call(r,a)&&f(e,a,r[a]);if(n)for(var a of n(r))u.call(r,a)&&f(e,a,r[a]);return e},x=(e,r)=>h(e,w(r)),g=(e,r)=>{var a={};for(var t in e)s.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&n)for(var t of n(e))r.indexOf(t)<0&&u.call(e,t)&&(a[t]=e[t]);return a};const q=j("tbody").attrs(({className:e})=>P(e,"kube-table-body"))(()=>({display:"table-row-group"})),v={variant:"body",hasBorder:!1},N=o.forwardRef((e,r)=>{var a=e,{className:t,hasBorder:l=v.hasBorder}=a,d=g(a,["className","hasBorder"]);const b=o.useMemo(()=>x(i({},v),{hasBorder:l}),[l]);return o.createElement(O.TableLvContext.Provider,{value:b},o.createElement(q,i({ref:r},d)))});exports.TableBody=N;
2
2
  //# sourceMappingURL=TableBody.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var C=require("styled-components"),P=require("react"),R=require("classnames"),w=require("./context.js");function L(e){return e&&typeof e=="object"&&"default"in e?e.default:e}function B(e){if(e&&e.__esModule)return e;var t=Object.create(null);if(e)for(var a in e)t[a]=e[a];return t.default=e,Object.freeze(t)}var H=L(C),_=B(P),W=L(R),I=Object.defineProperty,T=Object.defineProperties,q=Object.getOwnPropertyDescriptors,x=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,z=(e,t,a)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,i=(e,t)=>{for(var a in t||(t={}))S.call(t,a)&&z(e,a,t[a]);if(x)for(var a of x(t))O.call(t,a)&&z(e,a,t[a]);return e},k=(e,t)=>T(e,q(t)),E=(e,t)=>{var a={};for(var r in e)S.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&x)for(var r of x(e))t.indexOf(r)<0&&O.call(e,r)&&(a[r]=e[r]);return a};const N=H.td(({theme:e,$ownerState:{ariaSort:t,variant:a="body",padding:r="normal",size:s="medium",align:f="left",stickyHeader:h=!1,fixed:d,fixedWidth:u,fixedLastLeft:b,fixedLastRight:m,hasBorder:v=!1,width:n}})=>{const c=r==="none"?"0px":{"head-small":"8px 12px","head-medium":"16px 12px","body-small":"4px 8px","body-medium":"8px 12px"}[`${a}-${s}`],p={textAlign:f,flexDirection:{right:"row-reverse"}[f]};return i(i(i(k(i(i(k(i(i(i(i(i(i({display:"table-cell",verticalAlign:"inherit"},n&&{width:typeof n=="number"?`${n}px`:n,minWidth:typeof n=="number"?`${n}px`:n}),s&&{height:{"body-medium":"56px"}[`${a}-${s}`]}),v&&{borderLeft:`1px solid ${e.palette.accents_1}`,"&:last-child":{borderRight:`1px solid ${e.palette.accents_1}`}}),t&&{ariaSort:t==="asc"?"ascending":"descending"}),a==="head"&&{color:e.palette.accents_5,fontWeight:600,fontSize:e.font.fontSizeBase,fontFamily:e.font.mono,lineHeight:1.67}),a==="body"&&{color:e.palette.accents_8}),{padding:c}),p),d&&{position:"sticky",[d]:u,zIndex:1,backgroundColor:e.palette.background}),{"&.with-sticky":{position:"sticky",top:0,zIndex:d?3:2,backgroundColor:"white"}}),h&&{position:"sticky",top:0,zIndex:d?3:2}),b&&{"&:after":{content:'""',position:"absolute",top:0,right:0,bottom:0,width:30,transform:"translateX(100%)",pointerEvents:"none",boxShadow:"inset 10px 0 8px -8px #0505050f"}}),m&&{"&:before":{content:'""',position:"absolute",top:0,left:0,bottom:0,width:30,transform:"translateX(-100%)",pointerEvents:"none",boxShadow:"inset -10px 0 8px -8px #0505050f"}})}),D=_.forwardRef((e,t)=>{var a=e,{className:r,children:s,ariaSort:f,variant:h,padding:d="normal",size:u="medium",align:b="left",fixed:m,fixedWidth:v,fixedLastLeft:n,fixedLastRight:c,hasBorder:p}=a,y=E(a,["className","children","ariaSort","variant","padding","size","align","fixed","fixedWidth","fixedLastLeft","fixedLastRight","hasBorder"]);const o=w.useTableContext(),l=w.useTableLvContext(),g=h||l&&l.variant,j={ariaSort:f,variant:g,padding:d||(o&&o.padding?o.padding:"normal"),size:u||(o&&o.size?o.size:"medium"),align:b,stickyHeader:g==="head"&&o&&o.stickyHeader,fixed:m,fixedWidth:v,fixedLastLeft:n,fixedLastRight:c,hasBorder:p??(l&&l.hasBorder),width:y.width},$=l&&l.variant==="head"?"th":"td";return _.createElement(N,i({as:$,className:W("table-cell",{"with-sticky":!!(g==="head"&&o&&o.stickyHeader),"table-cell--fixed-last-left":n,"table-cell--fixed-last-right":c},r),$ownerState:j,ref:t},y),s)});exports.TableCell=D;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var P=require("styled-components"),C=require("react"),R=require("classnames"),w=require("./context.js");function L(e){return e&&typeof e=="object"&&"default"in e?e.default:e}function B(e){if(e&&e.__esModule)return e;var t=Object.create(null);if(e)for(var a in e)t[a]=e[a];return t.default=e,Object.freeze(t)}var H=L(P),_=B(C),W=L(R),I=Object.defineProperty,T=Object.defineProperties,q=Object.getOwnPropertyDescriptors,x=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,S=(e,t,a)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,i=(e,t)=>{for(var a in t||(t={}))O.call(t,a)&&S(e,a,t[a]);if(x)for(var a of x(t))z.call(t,a)&&S(e,a,t[a]);return e},k=(e,t)=>T(e,q(t)),E=(e,t)=>{var a={};for(var r in e)O.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&x)for(var r of x(e))t.indexOf(r)<0&&z.call(e,r)&&(a[r]=e[r]);return a};const N=H.td(({theme:e,$ownerState:{ariaSort:t,variant:a="body",padding:r="normal",size:s="medium",align:f="left",stickyHeader:h=!1,fixed:d,fixedWidth:u,fixedLastLeft:b,fixedLastRight:m,hasBorder:v=!1,width:n}})=>{const c=r==="none"?"0px":{"head-small":"8px 12px","head-medium":"16px 12px","body-small":"4px 8px","body-medium":"8px 12px"}[`${a}-${s}`],p={textAlign:f,flexDirection:{right:"row-reverse"}[f]};return i(i(i(k(i(i(k(i(i(i(i(i(i({display:"table-cell",verticalAlign:"inherit"},n&&{width:typeof n=="number"?`${n}px`:n,minWidth:typeof n=="number"?`${n}px`:n}),s&&{height:{"body-medium":"56px"}[`${a}-${s}`]}),v&&{borderLeft:`1px solid ${e.palette.accents_1}`,"&:last-child":{borderRight:`1px solid ${e.palette.accents_1}`}}),t&&{ariaSort:t==="asc"?"ascending":"descending"}),a==="head"&&{color:e.palette.accents_5,fontWeight:600,fontSize:e.font.fontSizeBase,fontFamily:e.font.mono,lineHeight:1.67}),a==="body"&&{color:e.palette.accents_8}),{padding:c}),p),d&&{position:"sticky",[d]:u,zIndex:1,backgroundColor:e.palette.background}),{"&.with-sticky":{position:"sticky",top:0,zIndex:d?3:2,backgroundColor:"white"}}),h&&{position:"sticky",top:0,zIndex:d?3:2}),b&&{"&:after":{content:'""',position:"absolute",top:0,right:0,bottom:0,width:30,transform:"translateX(100%)",pointerEvents:"none",boxShadow:"inset 10px 0 8px -8px #0505050f"}}),m&&{"&:before":{content:'""',position:"absolute",top:0,left:0,bottom:0,width:30,transform:"translateX(-100%)",pointerEvents:"none",boxShadow:"inset -10px 0 8px -8px #0505050f"}})}),D=_.forwardRef((e,t)=>{var a=e,{className:r,children:s,ariaSort:f,variant:h,padding:d="normal",size:u="medium",align:b="left",fixed:m,fixedWidth:v,fixedLastLeft:n,fixedLastRight:c,hasBorder:p}=a,y=E(a,["className","children","ariaSort","variant","padding","size","align","fixed","fixedWidth","fixedLastLeft","fixedLastRight","hasBorder"]);const o=w.useTableContext(),l=w.useTableLvContext(),g=h||l&&l.variant,j={ariaSort:f,variant:g,padding:d||(o&&o.padding?o.padding:"normal"),size:u||(o&&o.size?o.size:"medium"),align:b,stickyHeader:g==="head"&&o&&o.stickyHeader,fixed:m,fixedWidth:v,fixedLastLeft:n,fixedLastRight:c,hasBorder:p??(l&&l.hasBorder),width:y.width},$=l&&l.variant==="head"?"th":"td";return _.createElement(N,i({as:$,className:W("table-cell",{"with-sticky":!!(g==="head"&&o&&o.stickyHeader),"table-cell--fixed-last-left":n,"table-cell--fixed-last-right":c},r),$ownerState:j,ref:t},y),s)});exports.TableCell=D;
2
2
  //# sourceMappingURL=TableCell.js.map
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("styled-components"),r=require("../../../theme/utils.js");function u(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var o=u(t);const n=o.span`
2
- color: ${({theme:e})=>r.default.getColor("blue",e)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../../theme/utils.js");function u(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var o=u(e);const n=o.span`
2
+ color: ${({theme:t})=>r.default.getColor("blue",t)};
3
3
  padding: 0 4px;
4
4
  cursor: pointer;
5
5
  font-weight: 600;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var O=require("classnames"),_=require("react"),j=require("styled-components"),d=require("./context.js");function u(e){return e&&typeof e=="object"&&"default"in e?e.default:e}function k(e){if(e&&e.__esModule)return e;var r=Object.create(null);if(e)for(var a in e)r[a]=e[a];return r.default=e,Object.freeze(r)}var x=u(O),n=k(_),w=u(j),B=Object.defineProperty,T=Object.defineProperties,g=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,v=(e,r,a)=>r in e?B(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,l=(e,r)=>{for(var a in r||(r={}))p.call(r,a)&&v(e,a,r[a]);if(s)for(var a of s(r))f.call(r,a)&&v(e,a,r[a]);return e},c=(e,r)=>T(e,g(r)),P=(e,r)=>{var a={};for(var t in e)p.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&s)for(var t of s(e))r.indexOf(t)<0&&f.call(e,t)&&(a[t]=e[t]);return a};const b={variant:"head",hasBorder:!1},H=w.thead(({$ownerState:{stickyHeader:e,hasBorderTop:r},theme:a})=>c(l(l({display:"table-header-group",backgroundColor:a.palette.background},e&&{position:"sticky",top:0,zIndex:2}),r&&{borderTop:`1px solid ${a.palette.accents_1}`}),{"&.with-sticky":{position:"sticky",top:0,zIndex:2}})),S=n.forwardRef((e,r)=>{var a=e,{className:t,hasBorderTop:y,hasBorder:i=b.hasBorder}=a,h=P(a,["className","hasBorderTop","hasBorder"]);const m=n.useMemo(()=>c(l({},b),{hasBorder:i}),[i]),o=d.useTableContext();return n.createElement(d.TableLvContext.Provider,{value:m},n.createElement(H,c(l({},h),{$ownerState:{stickyHeader:o==null?void 0:o.stickyHeader,hasBorderTop:y},ref:r,className:x("kube-table-head",{"with-sticky":o==null?void 0:o.stickyHeader},t)})))});exports.TableHead=S;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var O=require("classnames"),_=require("react"),j=require("styled-components"),d=require("./context.js");function u(e){return e&&typeof e=="object"&&"default"in e?e.default:e}function k(e){if(e&&e.__esModule)return e;var r=Object.create(null);if(e)for(var a in e)r[a]=e[a];return r.default=e,Object.freeze(r)}var x=u(O),n=k(_),w=u(j),B=Object.defineProperty,P=Object.defineProperties,T=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,v=(e,r,a)=>r in e?B(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,l=(e,r)=>{for(var a in r||(r={}))p.call(r,a)&&v(e,a,r[a]);if(s)for(var a of s(r))f.call(r,a)&&v(e,a,r[a]);return e},c=(e,r)=>P(e,T(r)),g=(e,r)=>{var a={};for(var t in e)p.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&s)for(var t of s(e))r.indexOf(t)<0&&f.call(e,t)&&(a[t]=e[t]);return a};const b={variant:"head",hasBorder:!1},H=w.thead(({$ownerState:{stickyHeader:e,hasBorderTop:r},theme:a})=>c(l(l({display:"table-header-group",backgroundColor:a.palette.background},e&&{position:"sticky",top:0,zIndex:2}),r&&{borderTop:`1px solid ${a.palette.accents_1}`}),{"&.with-sticky":{position:"sticky",top:0,zIndex:2}})),q=n.forwardRef((e,r)=>{var a=e,{className:t,hasBorderTop:y,hasBorder:i=b.hasBorder}=a,h=g(a,["className","hasBorderTop","hasBorder"]);const m=n.useMemo(()=>c(l({},b),{hasBorder:i}),[i]),o=d.useTableContext();return n.createElement(d.TableLvContext.Provider,{value:m},n.createElement(H,c(l({},h),{$ownerState:{stickyHeader:o==null?void 0:o.stickyHeader,hasBorderTop:y},ref:r,className:x("kube-table-head",{"with-sticky":o==null?void 0:o.stickyHeader},t)})))});exports.TableHead=q;
2
2
  //# sourceMappingURL=TableHead.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sources":["../../../src/Table/DataTable/Table.tsx"],"sourcesContent":["import type { Header, Row, RowData, Table, TableState } from '@tanstack/react-table';\nimport cx from 'classnames';\nimport * as React from 'react';\nimport * as BaseTable from '../BaseTable';\nimport { BaseDataTable } from './BaseTable';\nimport { Pagination, TableFooter } from './Pagination';\nimport { Toolbar } from './Toolbar';\nimport {\n DataTableRootProps,\n DefaultOptionsResolved,\n FeaturesHandlersOptions,\n StateHandler,\n StorageStateOptions,\n} from './interfaces';\n\ndeclare module '@tanstack/react-table' {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n interface TableOptionsResolved<TData extends RowData>\n extends StorageStateOptions,\n FeaturesHandlersOptions {\n loading?: boolean;\n autoResetFiltersWhenPageChange?: boolean;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n interface ColumnMeta<TData extends RowData, TValue = unknown> {\n description?: Record<string, any>;\n // filterOptions?: { key: string; label: React.ReactNode }[];\n selectType?: 'single' | 'multiple';\n sortable?: boolean;\n searchKey?: string;\n th?: Omit<BaseTable.TableCellProps, 'ref'>;\n td?: Omit<BaseTable.TableCellProps, 'ref'>;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n interface TableOptions<TData extends RowData> {\n onParamsChange?: (params: Partial<TableState>, key: keyof TableState) => void;\n loading?: boolean;\n }\n\n interface TableFeature<TData extends RowData = any> extends DefaultOptionsResolved<TData> {}\n interface TableMeta<TData extends RowData> {\n tableName: string;\n refetch?: () => void;\n storageStateKeys?: (keyof TableState)[] | '*';\n _defaultConfig?: {\n selectColumnId?: string;\n };\n manual?: boolean;\n enable?: {\n pagination?: boolean;\n toolbar?: boolean;\n visible?: boolean;\n filters?: boolean;\n };\n enableDefault?: {\n toolbar?: boolean;\n th?: boolean;\n td?: boolean;\n tr?: boolean;\n };\n getProps?: {\n filters?: (table: Table<TData>) => BaseTable.ToolbarProps['filterProps'];\n toolbar?: (\n table: Table<TData>\n ) => Partial<Omit<BaseTable.ToolbarProps, 'filtersProps' | 'enableFilters'>>;\n table?: (table: Table<TData>) => Partial<BaseTable.TableProps>;\n th?: (\n table: Table<TData>,\n header: Header<TData, unknown>\n ) => Omit<BaseTable.TableCellProps, 'ref'>;\n pagination?: (table: Table<TData>) => Partial<BaseTable.BaseTablePaginationProps> & {\n total?: number;\n };\n tr?: (table: Table<TData>, row: Row<TData>) => Partial<BaseTable.TableRowProps>;\n td?: (\n table: Table<TData>,\n props: Record<string, any>\n ) => Omit<BaseTable.TableCellProps, 'ref'>;\n empty?: () => Partial<BaseTable.TableFilteredEmptyProps>;\n };\n\n registerHandlers?: StateHandler[];\n }\n}\n\nexport function DataTable<T>({ className, table }: DataTableRootProps<T>) {\n const { options: { meta: { enable: { pagination, toolbar } = {} } = {} } = {} } = table;\n return (\n <div className={cx('table-container', className)}>\n {!!toolbar && <Toolbar table={table} />}\n <BaseDataTable table={table} />\n {!!pagination && (\n <TableFooter>\n <Pagination table={table} />\n </TableFooter>\n )}\n </div>\n );\n}\n"],"names":["a","r","i","n","b","s"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAoM,SAAS,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAOA,YAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,SAAS,CAACC,UAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAED,YAAC,CAAC,aAAa,CAACE,eAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAACF,YAAC,CAAC,aAAa,CAACG,uBAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEH,YAAC,CAAC,aAAa,CAACI,sBAAC,CAAC,IAAI,CAACJ,YAAC,CAAC,aAAa,CAACK,qBAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;"}
1
+ {"version":3,"file":"Table.js","sources":["../../../src/Table/DataTable/Table.tsx"],"sourcesContent":["import cx from 'classnames';\nimport * as React from 'react';\nimport { BaseDataTable } from './BaseTable';\nimport { Pagination, TableFooter } from './Pagination';\nimport { Toolbar } from './Toolbar';\nimport { DataTableRootProps } from './interfaces';\n\nexport function DataTable<T>({ className, table }: DataTableRootProps<T>) {\n const { options: { meta: { enable: { pagination, toolbar } = {} } = {} } = {} } = table;\n return (\n <div className={cx('table-container', className)}>\n {!!toolbar && <Toolbar table={table} />}\n <BaseDataTable table={table} />\n {!!pagination && (\n <TableFooter>\n <Pagination table={table} />\n </TableFooter>\n )}\n </div>\n );\n}\n"],"names":["o","i","s","n","l","m"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAoM,SAAS,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAOA,YAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,SAAS,CAACC,UAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAED,YAAC,CAAC,aAAa,CAACE,eAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAACF,YAAC,CAAC,aAAa,CAACG,uBAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEH,YAAC,CAAC,aAAa,CAACI,sBAAC,CAAC,IAAI,CAACJ,YAAC,CAAC,aAAa,CAACK,qBAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var O=require("react"),P=require("classnames"),j=require("./utils/index.js"),m=require("../../ConfigProvider/LocaleProvider/LocaleContext.js"),x=require("../BaseTable/Toolbar/index.js");function g(e){return e&&typeof e=="object"&&"default"in e?e.default:e}function y(e){if(e&&e.__esModule)return e;var r=Object.create(null);if(e)for(var t in e)r[t]=e[t];return r.default=e,Object.freeze(r)}var T=y(O),_=g(P),q=Object.defineProperty,L=Object.defineProperties,M=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,c=(e,r,t)=>r in e?q(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,n=(e,r)=>{for(var t in r||(r={}))s.call(r,t)&&c(e,t,r[t]);if(o)for(var t of o(r))u.call(r,t)&&c(e,t,r[t]);return e},f=(e,r)=>L(e,M(r)),w=(e,r)=>{var t={};for(var a in e)s.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&o)for(var a of o(e))r.indexOf(a)<0&&u.call(e,a)&&(t[a]=e[a]);return t};function D({table:e,className:r}){const{options:{meta:{enableDefault:{toolbar:t=!0}={},getProps:{toolbar:a}={}}={}}={}}=e,{locales:b}=m.useLocales(),l=a?a(e):{},i=l,{filterProps:p}=i,v=w(i,["filterProps"]),d=t?j.getDefaultToolbarProps(e,f(n({},l),{settingMenuText:(l==null?void 0:l.settingMenuText)||b.Table.settingMenuText})):{filterProps:p};return T.createElement(x.Toolbar,f(n(n({},d),v),{className:_("table-toolbar",r,l.className||"")}))}exports.Toolbar=D;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var P=require("react"),O=require("classnames"),j=require("./utils/index.js"),m=require("../../ConfigProvider/LocaleProvider/LocaleContext.js"),x=require("../BaseTable/Toolbar/index.js");function g(e){return e&&typeof e=="object"&&"default"in e?e.default:e}function y(e){if(e&&e.__esModule)return e;var r=Object.create(null);if(e)for(var t in e)r[t]=e[t];return r.default=e,Object.freeze(r)}var T=y(P),_=g(O),q=Object.defineProperty,L=Object.defineProperties,M=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,c=(e,r,t)=>r in e?q(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,n=(e,r)=>{for(var t in r||(r={}))s.call(r,t)&&c(e,t,r[t]);if(o)for(var t of o(r))u.call(r,t)&&c(e,t,r[t]);return e},f=(e,r)=>L(e,M(r)),w=(e,r)=>{var t={};for(var a in e)s.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&o)for(var a of o(e))r.indexOf(a)<0&&u.call(e,a)&&(t[a]=e[a]);return t};function D({table:e,className:r}){const{options:{meta:{enableDefault:{toolbar:t=!0}={},getProps:{toolbar:a}={}}={}}={}}=e,{locales:b}=m.useLocales(),l=a?a(e):{},i=l,{filterProps:p}=i,v=w(i,["filterProps"]),d=t?j.getDefaultToolbarProps(e,f(n({},l),{settingMenuText:(l==null?void 0:l.settingMenuText)||b.Table.settingMenuText})):{filterProps:p};return T.createElement(x.Toolbar,f(n(n({},d),v),{className:_("table-toolbar",r,l.className||"")}))}exports.Toolbar=D;
2
2
  //# sourceMappingURL=Toolbar.js.map
package/cjs/Tabs/Tabs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var f=require("react"),V=require("classnames"),T=require("@kubed/hooks"),$=require("../Group/Group.js"),U=require("../utils/toArray.js"),o=require("./Tabs.styles.js");function C(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var l=C(f),H=C(V),J=Object.defineProperty,Q=Object.defineProperties,X=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,j=(e,t,r)=>t in e?J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,D=(e,t)=>{for(var r in t||(t={}))_.call(t,r)&&j(e,r,t[r]);if(g)for(var r of g(t))R.call(t,r)&&j(e,r,t[r]);return e},Z=(e,t)=>Q(e,X(t)),ee=(e,t)=>{var r={};for(var n in e)_.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&g)for(var n of g(e))t.indexOf(n)<0&&R.call(e,n)&&(r[n]=e[n]);return r};const te={horizontal:"row",vertical:"column"},re=e=>{for(let t=0;t<e.length;t+=1)if(!e[t].disabled)return e[t].key;return-1},ne=e=>U.default(e).map(t=>{if(l.isValidElement(t)){const r=t.key!==void 0?String(t.key):void 0;return Z(D({key:r},t.props),{node:t})}return null});function A(e){var t=e,{children:r,name:n,variant:s="pills",activeKey:z,defaultActiveKey:N,onTabChange:S,color:h,grow:E,radius:m="lg",size:O="sm",position:b="left",direction:v="horizontal",tabPadding:q="xs",transitionDuration:B=150,transitionTimingFunction:F}=t,G=ee(t,["children","name","variant","activeKey","defaultActiveKey","onTabChange","color","grow","radius","size","position","direction","tabPadding","transitionDuration","transitionTimingFunction"]);const[k,L]=f.useState(!1),y=ne(r),[u,x]=T.useUncontrolled({value:z,defaultValue:N,finalValue:re(y),onChange:S,rule:i=>!!i}),[c,I]=f.useState({width:0,height:0,translate:0,translateY:0}),W=T.useId(n),Y=T.useReducedMotion(),w=f.useRef({}),d=f.useRef(null);f.useEffect(()=>{if(s==="outline")return;const i=new ResizeObserver(()=>{if(u in w.current&&d.current){const a=w.current[u].getBoundingClientRect(),P=window.getComputedStyle(d.current),p=parseFloat(P.borderLeftWidth);I({width:a.width,height:a.height,translate:a.x-(d.current.getBoundingClientRect().x+p+1)-o.WRAPPER_PADDING,translateY:a.y-d.current.getBoundingClientRect().y-o.WRAPPER_PADDING}),k||setTimeout(()=>{L(!0)},4)}});return i.observe(d.current),()=>i.disconnect()},[u]);const K=y.map(i=>{const{key:a,label:P}=i,p=u===a;return l.createElement(o.TabControl,{key:a,active:p,radius:m,size:O,reduceMotion:Y||!k,transitionTimingFunction:F,transitionDuration:B,className:H("tab-item",{"tab-item__active":p})},l.createElement(o.TabControlLabel,{active:p,htmlFor:`${W}-${a}`,ref:M=>{w.current[a]=M},onClick:()=>x(a),className:"tab-label"},P))});return l.createElement(o.TabsContainer,D({variant:s,direction:v,position:b},G),l.createElement(o.TabControlList,{variant:s,fullWidth:E,radius:m,size:O,position:b,direction:v,color:h,ref:d},!!u&&s!=="outline"&&(s==="pills"?l.createElement(o.PillsBg,{variant:s,radius:m,color:h,width:c.width,transform:c.translate}):l.createElement(o.LineBg,{variant:s,radius:m,color:h,direction:v,position:b,width:c.width,height:c.height,transform:c.translate,translateY:c.translateY,className:"line-bg"})),l.createElement($.Group,{grow:E,spacing:0,position:b,direction:te[v],className:"tab-group"},K)),l.createElement(o.TabPanel,{direction:v,position:b,variant:s,tabPadding:q},y.map(i=>i.key===u?i.children:null)))}A.displayName="@kubed/components/Tabs",exports.Tabs=A;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var f=require("react"),V=require("classnames"),T=require("@kubed/hooks"),$=require("../Group/Group.js"),U=require("../utils/toArray.js"),o=require("./Tabs.styles.js");function C(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var l=C(f),H=C(V),J=Object.defineProperty,Q=Object.defineProperties,X=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,j=(e,t,r)=>t in e?J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,D=(e,t)=>{for(var r in t||(t={}))_.call(t,r)&&j(e,r,t[r]);if(g)for(var r of g(t))R.call(t,r)&&j(e,r,t[r]);return e},Z=(e,t)=>Q(e,X(t)),ee=(e,t)=>{var r={};for(var n in e)_.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&g)for(var n of g(e))t.indexOf(n)<0&&R.call(e,n)&&(r[n]=e[n]);return r};const te={horizontal:"row",vertical:"column"},re=e=>{for(let t=0;t<e.length;t+=1)if(!e[t].disabled)return e[t].key;return-1},ne=e=>U.default(e).map(t=>{if(l.isValidElement(t)){const r=t.key!==void 0?String(t.key):void 0;return Z(D({key:r},t.props),{node:t})}return null});function A(e){var t=e,{children:r,name:n,variant:s="pills",activeKey:z,defaultActiveKey:N,onTabChange:q,color:h,grow:E,radius:m="lg",size:O="sm",position:b="left",direction:v="horizontal",tabPadding:B="xs",transitionDuration:F=150,transitionTimingFunction:G}=t,L=ee(t,["children","name","variant","activeKey","defaultActiveKey","onTabChange","color","grow","radius","size","position","direction","tabPadding","transitionDuration","transitionTimingFunction"]);const[k,S]=f.useState(!1),y=ne(r),[u,x]=T.useUncontrolled({value:z,defaultValue:N,finalValue:re(y),onChange:q,rule:i=>!!i}),[c,I]=f.useState({width:0,height:0,translate:0,translateY:0}),W=T.useId(n),Y=T.useReducedMotion(),P=f.useRef({}),d=f.useRef(null);f.useEffect(()=>{if(s==="outline")return;const i=new ResizeObserver(()=>{if(u in P.current&&d.current){const a=P.current[u].getBoundingClientRect(),w=window.getComputedStyle(d.current),p=parseFloat(w.borderLeftWidth);I({width:a.width,height:a.height,translate:a.x-(d.current.getBoundingClientRect().x+p+1)-o.WRAPPER_PADDING,translateY:a.y-d.current.getBoundingClientRect().y-o.WRAPPER_PADDING}),k||setTimeout(()=>{S(!0)},4)}});return i.observe(d.current),()=>i.disconnect()},[u]);const K=y.map(i=>{const{key:a,label:w}=i,p=u===a;return l.createElement(o.TabControl,{key:a,active:p,radius:m,size:O,reduceMotion:Y||!k,transitionTimingFunction:G,transitionDuration:F,className:H("tab-item",{"tab-item__active":p})},l.createElement(o.TabControlLabel,{active:p,htmlFor:`${W}-${a}`,ref:M=>{P.current[a]=M},onClick:()=>x(a),className:"tab-label"},w))});return l.createElement(o.TabsContainer,D({variant:s,direction:v,position:b},L),l.createElement(o.TabControlList,{variant:s,fullWidth:E,radius:m,size:O,position:b,direction:v,color:h,ref:d},!!u&&s!=="outline"&&(s==="pills"?l.createElement(o.PillsBg,{variant:s,radius:m,color:h,width:c.width,transform:c.translate}):l.createElement(o.LineBg,{variant:s,radius:m,color:h,direction:v,position:b,width:c.width,height:c.height,transform:c.translate,translateY:c.translateY,className:"line-bg"})),l.createElement($.Group,{grow:E,spacing:0,position:b,direction:te[v],className:"tab-group"},K)),l.createElement(o.TabPanel,{direction:v,position:b,variant:s,tabPadding:B},y.map(i=>i.key===u?i.children:null)))}A.displayName="@kubed/components/Tabs",exports.Tabs=A;
2
2
  //# sourceMappingURL=Tabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.styles.js","sources":["../../src/Tabs/Tabs.styles.ts"],"sourcesContent":["import React from 'react';\nimport styled, { css } from 'styled-components';\nimport { KubedNumberSize, KubedSizes, KubedTheme, themeUtils } from '../theme';\n\nconst { getSizeValue } = themeUtils;\n\nexport const WRAPPER_PADDING = 0;\n\nconst sizes = {\n xs: {\n fontSize: '10px',\n height: '26px',\n },\n sm: {\n fontSize: '12px',\n height: '28px',\n },\n md: {\n fontSize: '14px',\n height: '36px',\n },\n lg: {\n fontSize: '16px',\n height: '48px',\n },\n xl: {\n fontSize: '18px',\n height: '56px',\n },\n};\n\nconst getColor = (color, theme: KubedTheme) => {\n const { palette } = theme;\n if (palette[color]) {\n return palette[color];\n }\n if (palette.colors[color]) {\n return palette.colors[color][2];\n }\n return palette.accents_7;\n};\n\nconst getOutlineControlBorder = (variant, theme: KubedTheme, direction, position) => {\n const border = `1px solid ${theme.palette.border}`;\n if (direction === 'vertical') {\n if (position === 'left') {\n return css`\n border-right: ${border};\n\n .tab-item {\n width: 100%;\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n border-width: 1px 0 1px 1px;\n }\n .tab-group {\n margin-right: -1px;\n }\n `;\n }\n if (position === 'right') {\n return css`\n border-left: ${border};\n .tab-item {\n width: 100%;\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n border-width: 1px 1px 1px 0;\n }\n .tab-group {\n margin-left: -1px;\n }\n `;\n }\n }\n return css`\n border-bottom: ${border};\n .tab-item {\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-width: 1px 1px 0;\n }\n .tab-group {\n width: 100%;\n margin-bottom: -1px;\n }\n `;\n};\n\nconst getLineControlBorder = (variant, theme: KubedTheme, direction, position) => {\n const border = `1px solid ${theme.palette.border}`;\n if (direction === 'vertical') {\n if (position === 'left') {\n return css`\n border-right: ${border};\n\n .tab-item {\n padding: 0 15px;\n width: 100%;\n }\n .tab-group {\n margin-right: -1px;\n }\n `;\n }\n if (position === 'right') {\n return css`\n border-left: ${border};\n .tab-item {\n padding: 0 15px;\n width: 100%;\n }\n .tab-group {\n margin-left: -1px;\n }\n `;\n }\n }\n return css`\n border-bottom: ${border};\n .tab-item {\n margin: 0 15px;\n }\n .tab-group {\n width: 100%;\n }\n `;\n};\n\nconst getContainerStyles = (variant, theme: KubedTheme, radius, direction, position, color) => {\n const { palette, layout } = theme;\n\n if (variant === 'pills') {\n return css`\n padding: 1px;\n border-radius: ${getSizeValue(radius, layout.radius)};\n background-color: ${palette.accents_0};\n border: 1px solid ${palette.border};\n\n .tab-item {\n font-weight: 500;\n min-width: 117px;\n }\n\n .tab-item__active {\n label {\n color: ${palette.background};\n }\n }\n `;\n }\n if (variant === 'outline') {\n return css`\n ${getOutlineControlBorder(variant, theme, direction, position)};\n\n .tab-item {\n padding: 0 15px;\n background-color: transparent;\n border-style: solid;\n border-color: transparent;\n &:first-of-type {\n margin-left: 0;\n }\n }\n\n .tab-item__active {\n background-color: ${palette.background};\n border-color: ${palette.border};\n label {\n color: ${palette.accents_8};\n }\n }\n `;\n }\n\n return css`\n ${getLineControlBorder(variant, theme, direction, position)};\n\n .tab-item {\n &:first-of-type {\n margin-left: 0;\n }\n }\n\n .tab-item__active {\n label {\n color: ${color ? themeUtils.getColor(color, theme) : palette.accents_7};\n }\n }\n `;\n};\n\ninterface TabsStyles extends React.ComponentPropsWithoutRef<any> {\n theme?: KubedTheme;\n fullWidth?: boolean;\n color?: string;\n radius?: KubedNumberSize;\n reduceMotion?: boolean;\n transitionDuration?: number;\n transitionTimingFunction?: string;\n size?: KubedSizes;\n direction?: 'horizontal' | 'vertical';\n variant?: 'pills' | 'line' | 'outline';\n active?: boolean;\n}\n\nconst getPanelPadding = (direction, position, tabPadding, theme) => {\n const padding = getSizeValue(tabPadding, theme.layout.spacing);\n if (direction === 'horizontal') {\n return css`\n padding-top: ${padding};\n `;\n }\n return css`\n padding-${position}: ${padding};\n `;\n};\n\nexport const TabControl = styled('div')<TabsStyles>`\n position: relative;\n box-sizing: border-box;\n flex: 1;\n z-index: 2;\n line-height: ${({ size }) => sizes[size].height};\n transition: ${({ reduceMotion, transitionDuration, transitionTimingFunction }) =>\n `border-left-color ${reduceMotion ? 0 : transitionDuration}ms ${\n transitionTimingFunction || 'cubic-bezier(.51,.3,0,1.21)'\n }`};\n`;\n\nexport const TabControlLabel = styled('label')<TabsStyles>`\n display: block;\n cursor: pointer;\n text-overflow: ellipsis;\n text-align: center;\n color: ${({ theme }) => theme.palette.accents_7};\n white-space: nowrap;\n -webkit-tap-highlight-color: transparent;\n transition: color 150ms ease 0s;\n`;\n\nexport const TabsContainer = styled('div')<TabsStyles>`\n position: relative;\n display: ${({ direction }) => (direction === 'vertical' ? 'flex' : 'block')};\n ${({ direction, position }) =>\n direction === 'vertical' && position === 'right' ? 'flex-direction: row-reverse' : null};\n`;\n\nexport const TabControlList = styled('div')<TabsStyles>`\n position: relative;\n display: ${({ fullWidth, variant }) =>\n fullWidth || variant !== 'pills' ? 'flex' : 'inline-flex'};\n font-size: ${({ size }) => sizes[size].fontSize};\n align-items: center;\n ${({ variant, theme, radius, direction, position, color }) =>\n getContainerStyles(variant, theme, radius, direction, position, color)};\n`;\n\nexport const TabPanel = styled('div')<TabsStyles>`\n display: block;\n ${({ direction, position, tabPadding, theme }) =>\n getPanelPadding(direction, position, tabPadding, theme)};\n`;\n\ninterface BgSpanStyles extends React.ComponentPropsWithoutRef<any> {}\n\nexport const PillsBg = styled('span')<BgSpanStyles>`\n border-radius: ${({ radius, theme }) => getSizeValue(radius, theme.layout.radius)};\n position: absolute;\n box-sizing: border-box;\n top: 1px;\n bottom: 1px;\n z-index: 1;\n background-color: ${({ theme, color }) => getColor(color, theme)};\n width: ${({ width }) => width}px;\n transform: translateX(${({ transform }) => transform}px);\n transition: transform 150ms ease 0s, width 100ms linear 0s;\n`;\n\nconst getLineBgStyles = (width, height, direction, position, translate, translateY) => {\n if (direction === 'vertical') {\n return css`\n width: 2px;\n height: ${height}px;\n transform: translateY(${translateY}px);\n top: 0;\n ${position === 'right' ? 'left: 0;\\nmargin-left: -1px;' : 'right: 0;\\nmargin-right: -1px;'};\n `;\n }\n\n return css`\n height: 2px;\n width: ${width}px;\n transform: translateX(${translate}px);\n bottom: 0;\n margin-bottom: -1px;\n `;\n};\n\nexport const LineBg = styled('span')<BgSpanStyles>`\n position: absolute;\n box-sizing: border-box;\n z-index: 1;\n background-color: ${({ theme, color }) =>\n color ? themeUtils.getColor(color, theme) : theme.palette.accents_7};\n transition: transform 150ms ease 0s, width 100ms linear 0s;\n ${({ width, height, direction, position, transform, translateY }) =>\n getLineBgStyles(width, height, direction, position, transform, translateY)};\n`;\n"],"names":["p","e","n","l"],"mappings":";;;;;;;;;;;AAAiF,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAACA,gBAAC,CAAa,MAAC,eAAe,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACC,GAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,EAAEA,GAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,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AC,CAAC,CAAC,GAAG,CAAC,GAAG,UAAU,CAACC,KAAC,CAAC;AAC1C;AACA,cAAc,EAAED,GAAC,CAAC;AAClB,4BAA4B,EAAE,CAAC,CAAC;AAChC;AACA,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC;AACrB,kBAAkB,CAAC,CAAC,CAAC;AACrB,mBAAmB,CAAC,CAAC;AACrB,IAAI,CAAC,CAACC,KAAC,CAAC;AACR;AACA,WAAW,EAAE,CAAC,CAAC;AACf,0BAA0B,EAAE,CAAC,CAAC;AAC9B;AACA;AACA,EAAE,CAAC,CAAa,MAAC,MAAM,CAACC,UAAC,CAAC,MAAM,CAAC,CAAC;AAClC;AACA;AACA;AACA,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAACH,gBAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACjF;AACA,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzF;;;;;;;;;;;"}
1
+ {"version":3,"file":"Tabs.styles.js","sources":["../../src/Tabs/Tabs.styles.ts"],"sourcesContent":["import React from 'react';\nimport styled, { css } from 'styled-components';\nimport { KubedNumberSize, KubedSizes, KubedTheme, themeUtils } from '../theme';\n\nconst { getSizeValue } = themeUtils;\n\nexport const WRAPPER_PADDING = 0;\n\nconst sizes = {\n xs: {\n fontSize: '10px',\n height: '26px',\n },\n sm: {\n fontSize: '12px',\n height: '28px',\n },\n md: {\n fontSize: '14px',\n height: '36px',\n },\n lg: {\n fontSize: '16px',\n height: '48px',\n },\n xl: {\n fontSize: '18px',\n height: '56px',\n },\n};\n\nconst getColor = (color, theme: KubedTheme) => {\n const { palette } = theme;\n if (palette[color]) {\n return palette[color];\n }\n if (palette.colors[color]) {\n return palette.colors[color][2];\n }\n return palette.accents_7;\n};\n\nconst getOutlineControlBorder = (variant, theme: KubedTheme, direction, position) => {\n const border = `1px solid ${theme.palette.border}`;\n if (direction === 'vertical') {\n if (position === 'left') {\n return css`\n border-right: ${border};\n\n .tab-item {\n width: 100%;\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n border-width: 1px 0 1px 1px;\n }\n .tab-group {\n margin-right: -1px;\n }\n `;\n }\n if (position === 'right') {\n return css`\n border-left: ${border};\n .tab-item {\n width: 100%;\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n border-width: 1px 1px 1px 0;\n }\n .tab-group {\n margin-left: -1px;\n }\n `;\n }\n }\n return css`\n border-bottom: ${border};\n .tab-item {\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-width: 1px 1px 0;\n }\n .tab-group {\n width: 100%;\n margin-bottom: -1px;\n }\n `;\n};\n\nconst getLineControlBorder = (variant, theme: KubedTheme, direction, position) => {\n const border = `1px solid ${theme.palette.border}`;\n if (direction === 'vertical') {\n if (position === 'left') {\n return css`\n border-right: ${border};\n\n .tab-item {\n padding: 0 15px;\n width: 100%;\n }\n .tab-group {\n margin-right: -1px;\n }\n `;\n }\n if (position === 'right') {\n return css`\n border-left: ${border};\n .tab-item {\n padding: 0 15px;\n width: 100%;\n }\n .tab-group {\n margin-left: -1px;\n }\n `;\n }\n }\n return css`\n border-bottom: ${border};\n .tab-item {\n margin: 0 15px;\n }\n .tab-group {\n width: 100%;\n }\n `;\n};\n\nconst getContainerStyles = (variant, theme: KubedTheme, radius, direction, position, color) => {\n const { palette, layout } = theme;\n\n if (variant === 'pills') {\n return css`\n padding: 1px;\n border-radius: ${getSizeValue(radius, layout.radius)};\n background-color: ${palette.accents_0};\n border: 1px solid ${palette.border};\n\n .tab-item {\n font-weight: 500;\n min-width: 117px;\n }\n\n .tab-item__active {\n label {\n color: ${palette.background};\n }\n }\n `;\n }\n if (variant === 'outline') {\n return css`\n ${getOutlineControlBorder(variant, theme, direction, position)};\n\n .tab-item {\n padding: 0 15px;\n background-color: transparent;\n border-style: solid;\n border-color: transparent;\n &:first-of-type {\n margin-left: 0;\n }\n }\n\n .tab-item__active {\n background-color: ${palette.background};\n border-color: ${palette.border};\n label {\n color: ${palette.accents_8};\n }\n }\n `;\n }\n\n return css`\n ${getLineControlBorder(variant, theme, direction, position)};\n\n .tab-item {\n &:first-of-type {\n margin-left: 0;\n }\n }\n\n .tab-item__active {\n label {\n color: ${color ? themeUtils.getColor(color, theme) : palette.accents_7};\n }\n }\n `;\n};\n\ninterface TabsStyles extends React.ComponentPropsWithoutRef<any> {\n theme?: KubedTheme;\n fullWidth?: boolean;\n color?: string;\n radius?: KubedNumberSize;\n reduceMotion?: boolean;\n transitionDuration?: number;\n transitionTimingFunction?: string;\n size?: KubedSizes;\n direction?: 'horizontal' | 'vertical';\n variant?: 'pills' | 'line' | 'outline';\n active?: boolean;\n}\n\nconst getPanelPadding = (direction, position, tabPadding, theme) => {\n const padding = getSizeValue(tabPadding, theme.layout.spacing);\n if (direction === 'horizontal') {\n return css`\n padding-top: ${padding};\n `;\n }\n return css`\n padding-${position}: ${padding};\n `;\n};\n\nexport const TabControl = styled('div')<TabsStyles>`\n position: relative;\n box-sizing: border-box;\n flex: 1;\n z-index: 2;\n line-height: ${({ size }) => sizes[size].height};\n transition: ${({ reduceMotion, transitionDuration, transitionTimingFunction }) =>\n `border-left-color ${reduceMotion ? 0 : transitionDuration}ms ${\n transitionTimingFunction || 'cubic-bezier(.51,.3,0,1.21)'\n }`};\n`;\n\nexport const TabControlLabel = styled('label')<TabsStyles>`\n display: block;\n cursor: pointer;\n text-overflow: ellipsis;\n text-align: center;\n color: ${({ theme }) => theme.palette.accents_7};\n white-space: nowrap;\n -webkit-tap-highlight-color: transparent;\n transition: color 150ms ease 0s;\n`;\n\nexport const TabsContainer = styled('div')<TabsStyles>`\n position: relative;\n display: ${({ direction }) => (direction === 'vertical' ? 'flex' : 'block')};\n ${({ direction, position }) =>\n direction === 'vertical' && position === 'right' ? 'flex-direction: row-reverse' : null};\n`;\n\nexport const TabControlList = styled('div')<TabsStyles>`\n position: relative;\n display: ${({ fullWidth, variant }) =>\n fullWidth || variant !== 'pills' ? 'flex' : 'inline-flex'};\n font-size: ${({ size }) => sizes[size].fontSize};\n align-items: center;\n ${({ variant, theme, radius, direction, position, color }) =>\n getContainerStyles(variant, theme, radius, direction, position, color)};\n`;\n\nexport const TabPanel = styled('div')<TabsStyles>`\n display: block;\n ${({ direction, position, tabPadding, theme }) =>\n getPanelPadding(direction, position, tabPadding, theme)};\n`;\n\ninterface BgSpanStyles extends React.ComponentPropsWithoutRef<any> {}\n\nexport const PillsBg = styled('span')<BgSpanStyles>`\n border-radius: ${({ radius, theme }) => getSizeValue(radius, theme.layout.radius)};\n position: absolute;\n box-sizing: border-box;\n top: 1px;\n bottom: 1px;\n z-index: 1;\n background-color: ${({ theme, color }) => getColor(color, theme)};\n width: ${({ width }) => width}px;\n transform: translateX(${({ transform }) => transform}px);\n transition: transform 150ms ease 0s, width 100ms linear 0s;\n`;\n\nconst getLineBgStyles = (width, height, direction, position, translate, translateY) => {\n if (direction === 'vertical') {\n return css`\n width: 2px;\n height: ${height}px;\n transform: translateY(${translateY}px);\n top: 0;\n ${position === 'right' ? 'left: 0;\\nmargin-left: -1px;' : 'right: 0;\\nmargin-right: -1px;'};\n `;\n }\n\n return css`\n height: 2px;\n width: ${width}px;\n transform: translateX(${translate}px);\n bottom: 0;\n margin-bottom: -1px;\n `;\n};\n\nexport const LineBg = styled('span')<BgSpanStyles>`\n position: absolute;\n box-sizing: border-box;\n z-index: 1;\n background-color: ${({ theme, color }) =>\n color ? themeUtils.getColor(color, theme) : theme.palette.accents_7};\n transition: transform 150ms ease 0s, width 100ms linear 0s;\n ${({ width, height, direction, position, transform, translateY }) =>\n getLineBgStyles(width, height, direction, position, transform, translateY)};\n`;\n"],"names":["p","t","n","l"],"mappings":";;;;;;;;;;;AAAiF,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAACA,gBAAC,CAAa,MAAC,eAAe,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAACC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,OAAOC,KAAC,CAAC;AACvf,sBAAsB,EAAE,CAAC,CAAC;AAC1B;AACA;AACA;AACA;AACA;A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AAM,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC;AACrB,kBAAkB,CAAC,CAAC,CAAC;AACrB,mBAAmB,CAAC,CAAC;AACrB,IAAI,CAAC,CAACA,KAAC,CAAC;AACR;AACA,WAAW,EAAED,GAAC,CAAC;AACf,0BAA0B,EAAE,CAAC,CAAC;AAC9B;AACA;AACA,EAAE,CAAC,CAAa,MAAC,MAAM,CAACE,UAAC,CAAC,MAAM,CAAC,CAAC;AAClC;AACA;AACA;AACA,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAACH,gBAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACjF;AACA,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzF;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.js","sources":["../../src/Tag/Tag.tsx"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport styled, { css } from 'styled-components';\nimport { Close } from '@kubed/icons';\nimport forwardRef from '../utils/forwardRef';\nimport { DefaultProps, KubedTheme, KubedNumberSize, themeUtils } from '../theme';\nimport { addColorAlpha } from '../utils/color';\n\nconst colorMap = {\n default: {\n color: 'background',\n background: 'accents_8',\n },\n primary: {\n color: 'green4',\n background: 'green0',\n },\n success: {\n color: 'green4',\n background: 'green0',\n },\n secondary: {\n color: 'accents_7',\n background: 'accents_2',\n },\n warning: {\n color: 'yellow4',\n background: 'yellow0',\n },\n error: {\n color: 'red4',\n background: 'red0',\n },\n info: {\n color: 'blue4',\n background: 'blue0',\n },\n};\n\nconst getColor = (color = 'default', theme: KubedTheme) => {\n const colorValue = themeUtils.getColor(colorMap[color].color, theme);\n const background = themeUtils.getColor(colorMap[color].background, theme);\n\n return css`\n background-color: ${background};\n color: ${colorValue};\n `;\n};\n\nconst TagWrapper = styled('div')<TagProps>`\n display: inline-flex;\n align-items: center;\n padding: ${({ title }) => (title ? '0 6px 0 2px' : '0 4px')};\n line-height: 20px;\n height: 20px;\n border-radius: ${({ title, radius, theme }) =>\n radius ? themeUtils.getSizeValue(radius, theme.layout.radius) : title ? '3px' : '2px'};\n word-break: break-all;\n white-space: nowrap;\n font-weight: 600;\n ${({ color, theme }) => getColor(color, theme)};\n\n .tag-content {\n white-space: nowrap;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .tag-close {\n margin-left: 6px;\n cursor: pointer;\n border-radius: 3px;\n &:hover {\n background-color: ${({ theme }) => addColorAlpha(theme.palette.accents_6, 0.6)};\n }\n }\n`;\n\nconst TagTitle = styled('span')`\n display: inline-flex;\n padding: 0 6px;\n margin: 2px 6px 2px 0;\n line-height: 16px;\n color: ${({ theme }) => theme.palette.background};\n background-color: ${({ theme }) => theme.palette.accents_7};\n border-radius: 1px;\n font-weight: 500;\n`;\n\nexport interface TagProps extends DefaultProps {\n /** Title of the tag */\n title?: React.ReactNode;\n\n /** Style of title */\n titleStyle?: React.CSSProperties;\n\n /** Tag color from theme */\n color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info' | string;\n\n /** Append element of the tag */\n append?: React.ReactNode;\n\n /** Prepend element of the tag */\n prepend?: React.ReactNode;\n\n /** Radius of the tag */\n radius?: KubedNumberSize;\n\n visible?: boolean;\n\n closable?: boolean;\n\n onClose?: (e: React.MouseEvent<SVGElement>) => void;\n}\n\nexport const Tag = forwardRef<TagProps, 'div'>(\n (\n { radius, title, titleStyle, color, onClose, children, prepend, append, closable, ...rest },\n ref\n ) => {\n const [visible, setVisible] = useState(true);\n\n useEffect(() => {\n if ('visible' in rest) {\n setVisible(rest.visible!);\n }\n }, [rest.visible]);\n\n const handleClose = (e: React.MouseEvent<SVGElement>) => {\n e.stopPropagation();\n onClose?.(e);\n\n if (e.defaultPrevented) {\n return;\n }\n if (!('visible' in rest)) {\n setVisible(false);\n }\n };\n\n if (!visible) return null;\n\n return (\n <TagWrapper ref={ref} radius={radius} title={title} color={color} {...rest}>\n {prepend}\n {title && <TagTitle style={titleStyle}>{title}</TagTitle>}\n <span className=\"tag-content\">{children}</span>\n {append}\n {closable && <Close variant=\"light\" className=\"tag-close\" onClick={handleClose} />}\n </TagWrapper>\n );\n }\n);\n\nTag.displayName = '@kubed/components/Tag';\n"],"names":["e","s","C","x","_","V","o","R","$","n","E"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAA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C,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,OAAO,CAAC,CAACC,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAACH,GAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACA,GAAC,EAAEG,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAACH,GAAC,CAAC,CAACG,UAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEA,UAAC,CAAC,aAAa,CAACC,WAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,uBAAuB;;;;"}
1
+ {"version":3,"file":"Tag.js","sources":["../../src/Tag/Tag.tsx"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport styled, { css } from 'styled-components';\nimport { Close } from '@kubed/icons';\nimport forwardRef from '../utils/forwardRef';\nimport { DefaultProps, KubedTheme, KubedNumberSize, themeUtils } from '../theme';\nimport { addColorAlpha } from '../utils/color';\n\nconst colorMap = {\n default: {\n color: 'background',\n background: 'accents_8',\n },\n primary: {\n color: 'green4',\n background: 'green0',\n },\n success: {\n color: 'green4',\n background: 'green0',\n },\n secondary: {\n color: 'accents_7',\n background: 'accents_2',\n },\n warning: {\n color: 'yellow4',\n background: 'yellow0',\n },\n error: {\n color: 'red4',\n background: 'red0',\n },\n info: {\n color: 'blue4',\n background: 'blue0',\n },\n};\n\nconst getColor = (color = 'default', theme: KubedTheme) => {\n const colorValue = themeUtils.getColor(colorMap[color].color, theme);\n const background = themeUtils.getColor(colorMap[color].background, theme);\n\n return css`\n background-color: ${background};\n color: ${colorValue};\n `;\n};\n\nconst TagWrapper = styled('div')<TagProps>`\n display: inline-flex;\n align-items: center;\n padding: ${({ title }) => (title ? '0 6px 0 2px' : '0 4px')};\n line-height: 20px;\n height: 20px;\n border-radius: ${({ title, radius, theme }) =>\n radius ? themeUtils.getSizeValue(radius, theme.layout.radius) : title ? '3px' : '2px'};\n word-break: break-all;\n white-space: nowrap;\n font-weight: 600;\n ${({ color, theme }) => getColor(color, theme)};\n\n .tag-content {\n white-space: nowrap;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .tag-close {\n margin-left: 6px;\n cursor: pointer;\n border-radius: 3px;\n &:hover {\n background-color: ${({ theme }) => addColorAlpha(theme.palette.accents_6, 0.6)};\n }\n }\n`;\n\nconst TagTitle = styled('span')`\n display: inline-flex;\n padding: 0 6px;\n margin: 2px 6px 2px 0;\n line-height: 16px;\n color: ${({ theme }) => theme.palette.background};\n background-color: ${({ theme }) => theme.palette.accents_7};\n border-radius: 1px;\n font-weight: 500;\n`;\n\nexport interface TagProps extends DefaultProps {\n /** Title of the tag */\n title?: React.ReactNode;\n\n /** Style of title */\n titleStyle?: React.CSSProperties;\n\n /** Tag color from theme */\n color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info' | string;\n\n /** Append element of the tag */\n append?: React.ReactNode;\n\n /** Prepend element of the tag */\n prepend?: React.ReactNode;\n\n /** Radius of the tag */\n radius?: KubedNumberSize;\n\n visible?: boolean;\n\n closable?: boolean;\n\n onClose?: (e: React.MouseEvent<SVGElement>) => void;\n}\n\nexport const Tag = forwardRef<TagProps, 'div'>(\n (\n { radius, title, titleStyle, color, onClose, children, prepend, append, closable, ...rest },\n ref\n ) => {\n const [visible, setVisible] = useState(true);\n\n useEffect(() => {\n if ('visible' in rest) {\n setVisible(rest.visible!);\n }\n }, [rest.visible]);\n\n const handleClose = (e: React.MouseEvent<SVGElement>) => {\n e.stopPropagation();\n onClose?.(e);\n\n if (e.defaultPrevented) {\n return;\n }\n if (!('visible' in rest)) {\n setVisible(false);\n }\n };\n\n if (!visible) return null;\n\n return (\n <TagWrapper ref={ref} radius={radius} title={title} color={color} {...rest}>\n {prepend}\n {title && <TagTitle style={titleStyle}>{title}</TagTitle>}\n <span className=\"tag-content\">{children}</span>\n {append}\n {closable && <Close variant=\"light\" className=\"tag-close\" onClick={handleClose} />}\n </TagWrapper>\n );\n }\n);\n\nTag.displayName = '@kubed/components/Tag';\n"],"names":["s","C","x","_","V","o","R","$","n","E"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE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,CAAC,CAAC,CAAC,KAAK,CAACH,GAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACA,GAAC,EAAEG,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAACH,GAAC,CAAC,CAACG,UAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEA,UAAC,CAAC,aAAa,CAACC,WAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,uBAAuB;;;;"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var l=require("react"),B=require("styled-components"),N=require("classnames"),T=require("@kubed/hooks"),V=require("../utils/color.js"),A=require("../utils/forwardRef.js");function u(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var w=u(l),L=u(B),D=u(N),G=Object.defineProperty,n=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,$=(e,r,t)=>r in e?G(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,k=(e,r)=>{for(var t in r||(r={}))y.call(r,t)&&$(e,t,r[t]);if(n)for(var t of n(r))_.call(r,t)&&$(e,t,r[t]);return e},I=(e,r)=>{var t={};for(var o in e)y.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&n)for(var o of n(e))r.indexOf(o)<0&&_.call(e,o)&&(t[o]=e[o]);return t};const J=L("div")`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var l=require("react"),B=require("styled-components"),N=require("classnames"),T=require("@kubed/hooks"),V=require("../utils/color.js"),A=require("../utils/forwardRef.js");function s(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var w=s(l),L=s(B),D=s(N),G=Object.defineProperty,n=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,$=(e,r,t)=>r in e?G(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,k=(e,r)=>{for(var t in r||(r={}))y.call(r,t)&&$(e,t,r[t]);if(n)for(var t of n(r))_.call(r,t)&&$(e,t,r[t]);return e},I=(e,r)=>{var t={};for(var o in e)y.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&n)for(var o of n(e))r.indexOf(o)<0&&_.call(e,o)&&(t[o]=e[o]);return t};const J=L("div")`
2
2
  display: inline-flex;
3
3
  border-radius: 3px;
4
4
  padding: 0 0 0 12px;
@@ -47,5 +47,5 @@
47
47
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
48
48
  }
49
49
  }
50
- `,K=A.default((e,r)=>{var t=e,{width:o,autosize:O,maxHeight:d,value:i,defaultValue:c,disabled:s,readOnly:p,onChange:f,onFocus:h,onBlur:b,className:j,placeholder:S}=t,q=I(t,["width","autosize","maxHeight","value","defaultValue","disabled","readOnly","onChange","onFocus","onBlur","className","placeholder"]);const v=l.useMemo(()=>i!==void 0,[i]),[z,g]=l.useState(c),[C,m]=l.useState(!1),x=l.useRef(),H=T.useMergedRef(r,x),P=()=>{if(!O)return;const a=x.current;a.style.height="",a.scrollHeight>d?(a.style.height=`${d}px`,a.style.overflow="auto"):(a.style.height=`${a.scrollHeight}px`,a.style.overflow="hidden")},E=a=>{s||p||(g(a.target.value),f&&f(a),P())},F=a=>{h&&h(a),m(!0)},M=a=>{m(!1),b&&b(a)};l.useEffect(()=>{v&&g(i)});const R=v?{value:z}:{defaultValue:c};return w.createElement(J,{className:D(j,"input-wrapper",{"input-focus":C,"input-disabled":s}),width:o},w.createElement("textarea",k(k({ref:H,disabled:s,readOnly:p,placeholder:S,onChange:E,onFocus:F,onBlur:M},R),q)))});exports.Textarea=K;
50
+ `,K=A.default((e,r)=>{var t=e,{width:o,autosize:O,maxHeight:d,value:u,defaultValue:c,disabled:i,readOnly:p,onChange:f,onFocus:h,onBlur:b,className:j,placeholder:P}=t,q=I(t,["width","autosize","maxHeight","value","defaultValue","disabled","readOnly","onChange","onFocus","onBlur","className","placeholder"]);const v=l.useMemo(()=>u!==void 0,[u]),[z,g]=l.useState(c),[C,m]=l.useState(!1),x=l.useRef(null),H=T.useMergedRef(r,x),S=()=>{if(!O)return;const a=x.current;a.style.height="",a.scrollHeight>d?(a.style.height=`${d}px`,a.style.overflow="auto"):(a.style.height=`${a.scrollHeight}px`,a.style.overflow="hidden")},E=a=>{i||p||(g(a.target.value),f&&f(a),S())},F=a=>{h&&h(a),m(!0)},M=a=>{m(!1),b&&b(a)};l.useEffect(()=>{v&&g(u)});const R=v?{value:z}:{defaultValue:c};return w.createElement(J,{className:D(j,"input-wrapper",{"input-focus":C,"input-disabled":i}),width:o},w.createElement("textarea",k(k({ref:H,disabled:i,readOnly:p,placeholder:P,onChange:E,onFocus:F,onBlur:M},R),q)))});exports.Textarea=K;
51
51
  //# sourceMappingURL=Textarea.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.js","sources":["../../src/Textarea/Textarea.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport cx from 'classnames';\nimport { useMergedRef } from '@kubed/hooks';\nimport { DefaultProps, KubedSizes } from '../theme';\nimport { addColorAlpha } from '../utils/color';\nimport forwardRef from '../utils/forwardRef';\n\nconst Wrapper = styled('div')<TextareaProps>`\n display: inline-flex;\n border-radius: 3px;\n padding: 0 0 0 12px;\n width: ${({ width }) => (width ? `${width}px` : '100%')};\n border: 1px solid ${({ theme }) => theme.palette.accents_4};\n outline: none;\n transition: all 0.3s ease-in-out;\n background-color: ${({ theme }) => theme.palette.background};\n\n &:hover {\n border-color: ${({ theme }) => theme.palette.accents_5};\n }\n\n &.input-focus {\n border-color: ${({ theme }) => theme.palette.colors.green[2]};\n box-shadow: 0 4px 8px 0 ${({ theme }) => addColorAlpha(theme.palette.colors.green[2], 0.2)};\n }\n\n &.input-disabled {\n cursor: not-allowed;\n background-color: ${({ theme }) => theme.palette.accents_1};\n border-color: ${({ theme }) => theme.palette.accents_4};\n }\n\n textarea {\n width: 100%;\n font-weight: 600;\n outline: none;\n border-radius: 3px;\n // height: ${({ size, theme }) => theme.layout.inputSizes[size]};\n padding: 6px 0;\n border: none;\n line-height: 1.67;\n color: ${({ theme }) => theme.palette.accents_7};\n transition: all 0.3s ease-in-out;\n background-color: transparent;\n resize: none;\n\n &[disabled] {\n cursor: not-allowed;\n background-color: ${({ theme }) => theme.palette.accents_1};\n }\n\n &:-webkit-autofill {\n background-color: #fff;\n -webkit-box-shadow: 0 0 0 1000px #fff inset;\n }\n }\n`;\n\nexport interface TextareaProps extends DefaultProps {\n /** width of textarea */\n width?: number;\n\n /** If true textarea will grow with content until maxRows are reached */\n autosize?: boolean;\n\n /** Defines maxRows in autosize variant, not applicable to regular variant */\n maxHeight?: number;\n\n /** Defined minRows in autosize variant and rows in regular variant */\n minRows?: number;\n\n /** Props passed to root element */\n wrapperProps?: Record<string, any>;\n\n /** Input size */\n size?: KubedSizes;\n\n // defaultValue?: string;\n}\n\nexport const Textarea = forwardRef<TextareaProps, 'textarea'>(\n (\n {\n width,\n autosize,\n maxHeight,\n value,\n defaultValue,\n disabled,\n readOnly,\n onChange,\n onFocus,\n onBlur,\n className,\n placeholder,\n ...rest\n },\n ref\n ) => {\n const isControlledComponent = useMemo(() => value !== undefined, [value]);\n const [selfValue, setSelfValue] = useState<string>(defaultValue as string);\n const [focused, setFocused] = useState(false);\n const textareaRef = useRef<HTMLTextAreaElement>();\n const mergedRef = useMergedRef(ref, textareaRef);\n\n const autoResize = () => {\n if (!autosize) return;\n\n const node = textareaRef.current;\n\n node.style.height = '';\n if (node.scrollHeight > maxHeight) {\n node.style.height = `${maxHeight}px`;\n node.style.overflow = 'auto';\n } else {\n node.style.height = `${node.scrollHeight}px`;\n node.style.overflow = 'hidden';\n }\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (disabled || readOnly) return;\n setSelfValue(e.target.value);\n onChange && onChange(e);\n autoResize();\n };\n\n const handleFocus = (e: React.FocusEvent<HTMLTextAreaElement>) => {\n onFocus && onFocus(e);\n setFocused(true);\n };\n\n const handleBlur = (e) => {\n setFocused(false);\n if (onBlur) {\n onBlur(e);\n }\n };\n\n useEffect(() => {\n if (isControlledComponent) {\n setSelfValue(value as string);\n }\n });\n\n const controlledValue = isControlledComponent ? { value: selfValue } : { defaultValue };\n\n return (\n <Wrapper\n className={cx(className, 'input-wrapper', {\n 'input-focus': focused,\n 'input-disabled': disabled,\n })}\n width={width}\n >\n <textarea\n ref={mergedRef}\n disabled={disabled}\n readOnly={readOnly}\n placeholder={placeholder}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...controlledValue}\n {...rest}\n />\n </Wrapper>\n );\n }\n);\n"],"names":["W","j","q","o","K","R","V","N","D","y","B"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAA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MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;"}
1
+ {"version":3,"file":"Textarea.js","sources":["../../src/Textarea/Textarea.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport cx from 'classnames';\nimport { useMergedRef } from '@kubed/hooks';\nimport { DefaultProps, KubedSizes } from '../theme';\nimport { addColorAlpha } from '../utils/color';\nimport forwardRef from '../utils/forwardRef';\n\nconst Wrapper = styled('div')<TextareaProps>`\n display: inline-flex;\n border-radius: 3px;\n padding: 0 0 0 12px;\n width: ${({ width }) => (width ? `${width}px` : '100%')};\n border: 1px solid ${({ theme }) => theme.palette.accents_4};\n outline: none;\n transition: all 0.3s ease-in-out;\n background-color: ${({ theme }) => theme.palette.background};\n\n &:hover {\n border-color: ${({ theme }) => theme.palette.accents_5};\n }\n\n &.input-focus {\n border-color: ${({ theme }) => theme.palette.colors.green[2]};\n box-shadow: 0 4px 8px 0 ${({ theme }) => addColorAlpha(theme.palette.colors.green[2], 0.2)};\n }\n\n &.input-disabled {\n cursor: not-allowed;\n background-color: ${({ theme }) => theme.palette.accents_1};\n border-color: ${({ theme }) => theme.palette.accents_4};\n }\n\n textarea {\n width: 100%;\n font-weight: 600;\n outline: none;\n border-radius: 3px;\n // height: ${({ size, theme }) => theme.layout.inputSizes[size]};\n padding: 6px 0;\n border: none;\n line-height: 1.67;\n color: ${({ theme }) => theme.palette.accents_7};\n transition: all 0.3s ease-in-out;\n background-color: transparent;\n resize: none;\n\n &[disabled] {\n cursor: not-allowed;\n background-color: ${({ theme }) => theme.palette.accents_1};\n }\n\n &:-webkit-autofill {\n background-color: #fff;\n -webkit-box-shadow: 0 0 0 1000px #fff inset;\n }\n }\n`;\n\nexport interface TextareaProps extends DefaultProps {\n /** width of textarea */\n width?: number;\n\n /** If true textarea will grow with content until maxRows are reached */\n autosize?: boolean;\n\n /** Defines maxRows in autosize variant, not applicable to regular variant */\n maxHeight?: number;\n\n /** Defined minRows in autosize variant and rows in regular variant */\n minRows?: number;\n\n /** Props passed to root element */\n wrapperProps?: Record<string, any>;\n\n /** Input size */\n size?: KubedSizes;\n\n // defaultValue?: string;\n}\n\nexport const Textarea = forwardRef<TextareaProps, 'textarea'>(\n (\n {\n width,\n autosize,\n maxHeight,\n value,\n defaultValue,\n disabled,\n readOnly,\n onChange,\n onFocus,\n onBlur,\n className,\n placeholder,\n ...rest\n },\n ref\n ) => {\n const isControlledComponent = useMemo(() => value !== undefined, [value]);\n const [selfValue, setSelfValue] = useState<string>(defaultValue as string);\n const [focused, setFocused] = useState(false);\n const textareaRef = useRef<HTMLTextAreaElement | null>(null);\n const mergedRef = useMergedRef(ref, textareaRef);\n\n const autoResize = () => {\n if (!autosize) return;\n\n const node = textareaRef.current;\n\n node.style.height = '';\n if (node.scrollHeight > maxHeight) {\n node.style.height = `${maxHeight}px`;\n node.style.overflow = 'auto';\n } else {\n node.style.height = `${node.scrollHeight}px`;\n node.style.overflow = 'hidden';\n }\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (disabled || readOnly) return;\n setSelfValue(e.target.value);\n onChange && onChange(e);\n autoResize();\n };\n\n const handleFocus = (e: React.FocusEvent<HTMLTextAreaElement>) => {\n onFocus && onFocus(e);\n setFocused(true);\n };\n\n const handleBlur = (e) => {\n setFocused(false);\n if (onBlur) {\n onBlur(e);\n }\n };\n\n useEffect(() => {\n if (isControlledComponent) {\n setSelfValue(value as string);\n }\n });\n\n const controlledValue = isControlledComponent ? { value: selfValue } : { defaultValue };\n\n return (\n <Wrapper\n className={cx(className, 'input-wrapper', {\n 'input-focus': focused,\n 'input-disabled': disabled,\n })}\n width={width}\n >\n <textarea\n ref={mergedRef}\n disabled={disabled}\n readOnly={readOnly}\n placeholder={placeholder}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...controlledValue}\n {...rest}\n />\n </Wrapper>\n );\n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AACK,WAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAOC,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAACC,UAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAACD,UAAC,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.styles.js","sources":["../../src/Tooltip/Tooltip.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport Tippy, { TippyProps } from '@tippyjs/react';\nimport { addColorAlpha } from '../utils/color';\n\nexport const StyledTippy = styled(Tippy)<TippyProps>`\n &.tippy-box {\n position: relative;\n background-color: ${({ theme }) => theme.palette.accents_8};\n color: ${({ theme }) => theme.palette.background};\n border-radius: 4px;\n font-size: 12px;\n line-height: 20px;\n outline: 0;\n transition-property: transform, visibility, opacity;\n box-shadow: 0 4px 8px ${({ theme }) => addColorAlpha(theme.palette.accents_8, 0.2)};\n\n &[data-animation='fade'][data-state='hidden'] {\n opacity: 0;\n }\n [data-tippy-root] {\n max-width: calc(100vw - 10px);\n }\n\n &[data-inertia][data-state='visible'] {\n transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);\n }\n\n &[data-placement^='top'] > .tippy-arrow {\n bottom: 0;\n &:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top;\n }\n }\n\n &[data-placement^='bottom'] > .tippy-arrow {\n top: 0;\n &:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom;\n }\n }\n\n &[data-placement^='left'] > .tippy-arrow {\n right: 0;\n &:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left;\n }\n }\n\n &[data-placement^='right'] > .tippy-arrow {\n left: 0;\n &:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right;\n }\n }\n\n .tippy-arrow {\n width: 14px;\n height: 14px;\n color: ${({ theme }) => theme.palette.accents_8};\n &:before {\n content: '';\n position: absolute;\n border-color: transparent;\n border-style: solid;\n }\n }\n\n .tippy-content {\n position: relative;\n //padding: 5px 9px;\n padding: 8px 12px;\n z-index: 1;\n }\n\n // animation\n &[data-animation='shift-toward-subtle'][data-state='hidden'] {\n opacity: 0;\n }\n &[data-animation='shift-toward-subtle'][data-state='hidden'][data-placement^='top'][data-state='hidden'] {\n transform: translateY(-5px);\n }\n &[data-animation='shift-toward-subtle'][data-state='hidden'][data-placement^='bottom'][data-state='hidden'] {\n transform: translateY(5px);\n }\n &[data-animation='shift-toward-subtle'][data-state='hidden'][data-placement^='left'][data-state='hidden'] {\n transform: translateX(-5px);\n }\n &[data-animation='shift-toward-subtle'][data-state='hidden'][data-placement^='right'][data-state='hidden'] {\n transform: translateX(5px);\n }\n\n &[data-animation='shift-away'][data-state='hidden'] {\n opacity: 0;\n }\n &[data-animation='shift-away'][data-state='hidden'][data-placement^='top'][data-state='hidden'] {\n transform: translateY(10px);\n }\n &[data-animation='shift-away'][data-state='hidden'][data-placement^='bottom'][data-state='hidden'] {\n transform: translateY(-15px);\n }\n &[data-animation='shift-away'][data-state='hidden'][data-placement^='left'][data-state='hidden'] {\n transform: translateX(10px);\n }\n &[data-animation='shift-away'][data-state='hidden'][data-placement^='right'][data-state='hidden'] {\n transform: translateX(-10px);\n }\n }\n`;\n"],"names":["a","e","i"],"mappings":";;;;;;;;;;;;;AAA0H,MAAC,WAAW,CAACA,UAAC,CAACC,YAAC,CAAC,CAAC;AAC5I;AACA;AACA,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACzD,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA,0BAA0B,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAGC,mBAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"Tooltip.styles.js","sources":["../../src/Tooltip/Tooltip.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport Tippy, { TippyProps } from '@tippyjs/react';\nimport { addColorAlpha } from '../utils/color';\n\nexport const StyledTippy = styled(Tippy)<TippyProps>`\n &.tippy-box {\n position: relative;\n background-color: ${({ theme }) => theme.palette.accents_8};\n color: ${({ theme }) => theme.palette.background};\n border-radius: 4px;\n font-size: 12px;\n line-height: 20px;\n outline: 0;\n transition-property: transform, visibility, opacity;\n box-shadow: 0 4px 8px ${({ theme }) => addColorAlpha(theme.palette.accents_8, 0.2)};\n\n &[data-animation='fade'][data-state='hidden'] {\n opacity: 0;\n }\n [data-tippy-root] {\n max-width: calc(100vw - 10px);\n }\n\n &[data-inertia][data-state='visible'] {\n transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);\n }\n\n &[data-placement^='top'] > .tippy-arrow {\n bottom: 0;\n &:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top;\n }\n }\n\n &[data-placement^='bottom'] > .tippy-arrow {\n top: 0;\n &:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom;\n }\n }\n\n &[data-placement^='left'] > .tippy-arrow {\n right: 0;\n &:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left;\n }\n }\n\n &[data-placement^='right'] > .tippy-arrow {\n left: 0;\n &:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right;\n }\n }\n\n .tippy-arrow {\n width: 14px;\n height: 14px;\n color: ${({ theme }) => theme.palette.accents_8};\n &:before {\n content: '';\n position: absolute;\n border-color: transparent;\n border-style: solid;\n }\n }\n\n .tippy-content {\n position: relative;\n //padding: 5px 9px;\n padding: 8px 12px;\n z-index: 1;\n }\n\n // animation\n &[data-animation='shift-toward-subtle'][data-state='hidden'] {\n opacity: 0;\n }\n &[data-animation='shift-toward-subtle'][data-state='hidden'][data-placement^='top'][data-state='hidden'] {\n transform: translateY(-5px);\n }\n &[data-animation='shift-toward-subtle'][data-state='hidden'][data-placement^='bottom'][data-state='hidden'] {\n transform: translateY(5px);\n }\n &[data-animation='shift-toward-subtle'][data-state='hidden'][data-placement^='left'][data-state='hidden'] {\n transform: translateX(-5px);\n }\n &[data-animation='shift-toward-subtle'][data-state='hidden'][data-placement^='right'][data-state='hidden'] {\n transform: translateX(5px);\n }\n\n &[data-animation='shift-away'][data-state='hidden'] {\n opacity: 0;\n }\n &[data-animation='shift-away'][data-state='hidden'][data-placement^='top'][data-state='hidden'] {\n transform: translateY(10px);\n }\n &[data-animation='shift-away'][data-state='hidden'][data-placement^='bottom'][data-state='hidden'] {\n transform: translateY(-15px);\n }\n &[data-animation='shift-away'][data-state='hidden'][data-placement^='left'][data-state='hidden'] {\n transform: translateX(10px);\n }\n &[data-animation='shift-away'][data-state='hidden'][data-placement^='right'][data-state='hidden'] {\n transform: translateX(-10px);\n }\n }\n`;\n"],"names":["a","e","i"],"mappings":";;;;;;;;;;;;;AAA0H,MAAC,WAAW,CAACA,UAAC,CAACC,UAAC,CAAC,CAAC;AAC5I;AACA;AACA,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACzD,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA,0BAA0B,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAGC,mBAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("react"),$=require("lodash"),O=require("classnames"),R=require("@kubed/icons"),k=require("@kubed/hooks"),M=require("../utils/forwardRef.js"),q=require("../Entity/Field.js"),t=require("./TypeSelect.styles.js"),P=require("../Input/Input.js");function C(r){return r&&typeof r=="object"&&"default"in r?r.default:r}var a=C(i),U=C(O);const g=M.default(({options:r,value:n,defaultValue:b,disabled:d,className:_,onChange:y,searchable:u=!1},w)=>{const[s,o]=i.useState(!1),[c,T]=i.useState(""),j=k.useClickOutside(()=>{o(!1)}),F=k.useMergedRef(w,j),p=e=>$.isUndefined(e)?!1:r.some(l=>l.value===e),I=()=>{var e;return p(n)?n:p(b)?b:(e=r[0])==null?void 0:e.value},[E,h]=i.useState(I());i.useEffect(()=>{p(n)&&h(n)},[n]);const W=()=>!s||!u?null:a.createElement(t.InputWrapper,null,a.createElement(P.Input,{allowClear:!0,value:c,onChange:e=>{T(e.target.value)}})),D=()=>{const e=r.find(m=>m.value===E);if(!e)return a.createElement(t.ControlWrapper,{$searchable:u,$disabled:!0,$expanded:!1});const{label:l,description:v,icon:f}=e;return a.createElement(a.Fragment,null,a.createElement(t.ControlWrapper,{$searchable:u,$disabled:d,$expanded:s},W(),a.createElement(t.FieldWrapper,{onClick:()=>{d||o(!s)}},a.createElement(q.Field,{label:v,value:l,avatar:f}))))},x=e=>{$.isUndefined(n)&&h(e.value),o(!1),y&&y(e.value,e)},N=()=>r.filter(e=>!u||!c?!0:[e.label,e.description,e.value].some(l=>typeof l=="string"&&(l==null?void 0:l.includes(c)))).filter(e=>e.value!==E).map(e=>{const{label:l,description:v,icon:f,value:m,disabled:S}=e;return a.createElement(t.DropdownOption,{key:m,onClick:()=>{!d&&!S&&x(e)},$disabled:S},a.createElement(q.Field,{label:v,value:l,avatar:f}))});return a.createElement(t.TypeSelectWrapper,{ref:F,className:U(_,{"is-expand":s}),$disabled:d,$searchable:u},D(),s&&a.createElement(t.DropdownWrapper,{$searchable:u},N()),!s&&a.createElement(t.DropdownArrow,null,a.createElement(R.ChevronDown,null)))});g.displayName="@kubed/components/TypeSelect",exports.TypeSelect=g;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("react"),$=require("lodash"),O=require("classnames"),P=require("@kubed/icons"),k=require("@kubed/hooks"),R=require("../utils/forwardRef.js"),q=require("../Entity/Field.js"),t=require("./TypeSelect.styles.js"),M=require("../Input/Input.js");function C(r){return r&&typeof r=="object"&&"default"in r?r.default:r}var a=C(i),U=C(O);const g=R.default(({options:r,value:n,defaultValue:b,disabled:d,className:_,onChange:y,searchable:u=!1},w)=>{const[s,o]=i.useState(!1),[c,T]=i.useState(""),j=k.useClickOutside(()=>{o(!1)}),F=k.useMergedRef(w,j),p=e=>$.isUndefined(e)?!1:r.some(l=>l.value===e),I=()=>{var e;return p(n)?n:p(b)?b:(e=r[0])==null?void 0:e.value},[E,h]=i.useState(I());i.useEffect(()=>{p(n)&&h(n)},[n]);const W=()=>!s||!u?null:a.createElement(t.InputWrapper,null,a.createElement(M.Input,{allowClear:!0,value:c,onChange:e=>{T(e.target.value)}})),D=()=>{const e=r.find(m=>m.value===E);if(!e)return a.createElement(t.ControlWrapper,{$searchable:u,$disabled:!0,$expanded:!1});const{label:l,description:v,icon:f}=e;return a.createElement(a.Fragment,null,a.createElement(t.ControlWrapper,{$searchable:u,$disabled:d,$expanded:s},W(),a.createElement(t.FieldWrapper,{onClick:()=>{d||o(!s)}},a.createElement(q.Field,{label:v,value:l,avatar:f}))))},x=e=>{$.isUndefined(n)&&h(e.value),o(!1),y&&y(e.value,e)},N=()=>r.filter(e=>!u||!c?!0:[e.label,e.description,e.value].some(l=>typeof l=="string"&&(l==null?void 0:l.includes(c)))).filter(e=>e.value!==E).map(e=>{const{label:l,description:v,icon:f,value:m,disabled:S}=e;return a.createElement(t.DropdownOption,{key:m,onClick:()=>{!d&&!S&&x(e)},$disabled:S},a.createElement(q.Field,{label:v,value:l,avatar:f}))});return a.createElement(t.TypeSelectWrapper,{ref:F,className:U(_,{"is-expand":s}),$disabled:d,$searchable:u},D(),s&&a.createElement(t.DropdownWrapper,{$searchable:u},N()),!s&&a.createElement(t.DropdownArrow,null,a.createElement(P.ChevronDown,null)))});g.displayName="@kubed/components/TypeSelect",exports.TypeSelect=g;
2
2
  //# sourceMappingURL=TypeSelect.js.map