@kubed/components 0.2.36 → 0.2.37

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 (124) 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/Button/Button.styles.js +9 -9
  7. package/cjs/Button/Button.styles.js.map +1 -1
  8. package/cjs/Checkbox/Checkbox.js +1 -1
  9. package/cjs/Checkbox/Checkbox.js.map +1 -1
  10. package/cjs/Descriptions/Description.js.map +1 -1
  11. package/cjs/Drawer/Drawer.styles.js.map +1 -1
  12. package/cjs/Dropdown/Dropdown.js +1 -1
  13. package/cjs/Entity/Entity.js.map +1 -1
  14. package/cjs/Grid/Row.js +3 -3
  15. package/cjs/Grid/Row.js.map +1 -1
  16. package/cjs/Group/Group.js +11 -11
  17. package/cjs/Group/Group.js.map +1 -1
  18. package/cjs/InputNumber/InputNumber.js +2 -2
  19. package/cjs/Menu/MenuButton/MenuButton.styles.js.map +1 -1
  20. package/cjs/Modal/Modal.styles.js.map +1 -1
  21. package/cjs/Navs/Navs.styles.js.map +1 -1
  22. package/cjs/Progress/Progress.styles.js.map +1 -1
  23. package/cjs/Radio/Radio.js +1 -1
  24. package/cjs/Radio/Radio.js.map +1 -1
  25. package/cjs/Skeleton/Skeleton.styles.js.map +1 -1
  26. package/cjs/Slider/SliderRoot/SliderRoot.styles.js +1 -1
  27. package/cjs/Slider/Track/Track.styles.js +7 -7
  28. package/cjs/StatusDot/StatusDot.js.map +1 -1
  29. package/cjs/Steps/Steps.styles.js.map +1 -1
  30. package/cjs/Table/BaseTable/BasePagination.js +11 -11
  31. package/cjs/Table/BaseTable/BasePagination.js.map +1 -1
  32. package/cjs/Table/BaseTable/PageNumberMenu.js +14 -0
  33. package/cjs/Table/BaseTable/PageNumberMenu.js.map +1 -0
  34. package/cjs/Table/BaseTable/Table.js.map +1 -1
  35. package/cjs/Table/BaseTable/TableFilteredEmpty/Description.styles.js +2 -2
  36. package/cjs/Tabs/Tabs.styles.js.map +1 -1
  37. package/cjs/Tag/Tag.js.map +1 -1
  38. package/cjs/Tooltip/Tooltip.styles.js.map +1 -1
  39. package/cjs/TypeSelect/TypeSelect.styles.js.map +1 -1
  40. package/cjs/theme/ThemeProvider.js.map +1 -1
  41. package/cjs/theme/presets/dark.js.map +1 -1
  42. package/esm/ActionConfirm/ActionConfirm.js.map +1 -1
  43. package/esm/Alert/Alert.js +4 -4
  44. package/esm/Alert/Alert.js.map +1 -1
  45. package/esm/Badge/Badge.js.map +1 -1
  46. package/esm/Badge/BadgeAnchor.js +8 -8
  47. package/esm/Badge/BadgeAnchor.js.map +1 -1
  48. package/esm/Banner/Banner.js +5 -5
  49. package/esm/Banner/Banner.js.map +1 -1
  50. package/esm/Card/Card.js +3 -3
  51. package/esm/Card/Card.js.map +1 -1
  52. package/esm/Center/Center.js +2 -2
  53. package/esm/Center/Center.js.map +1 -1
  54. package/esm/Checkbox/Checkbox.js.map +1 -1
  55. package/esm/Container/Container.js +4 -4
  56. package/esm/Container/Container.js.map +1 -1
  57. package/esm/Descriptions/Description.js.map +1 -1
  58. package/esm/Drawer/Drawer.styles.js.map +1 -1
  59. package/esm/Dropdown/Dropdown.js +2 -2
  60. package/esm/Dropdown/Dropdown.js.map +1 -1
  61. package/esm/Dropzone/Dropzone.styles.js.map +1 -1
  62. package/esm/Empty/Empty.js +1 -1
  63. package/esm/Empty/Empty.js.map +1 -1
  64. package/esm/Entity/Entity.js.map +1 -1
  65. package/esm/Entity/Field.js.map +1 -1
  66. package/esm/FilterInput/FilterInput.styles.js +3 -3
  67. package/esm/FilterInput/FilterInput.styles.js.map +1 -1
  68. package/esm/Form/Form.js +3 -3
  69. package/esm/Form/Form.js.map +1 -1
  70. package/esm/Form/FormItem/FormItem.js +3 -3
  71. package/esm/Form/FormItem/FormItem.js.map +1 -1
  72. package/esm/Grid/Col.js +5 -5
  73. package/esm/Grid/Col.js.map +1 -1
  74. package/esm/Grid/Row.js +4 -4
  75. package/esm/Grid/Row.js.map +1 -1
  76. package/esm/Group/Group.js +3 -3
  77. package/esm/Group/Group.js.map +1 -1
  78. package/esm/InputNumber/InputNumber.js.map +1 -1
  79. package/esm/Loading/loaders/Circle.js +2 -2
  80. package/esm/Loading/loaders/Circle.js.map +1 -1
  81. package/esm/Modal/ConfirmDialog/ConfirmDialog.js.map +1 -1
  82. package/esm/Modal/Modal.styles.js.map +1 -1
  83. package/esm/Navs/Navs.styles.js.map +1 -1
  84. package/esm/Progress/Progress.styles.js +8 -8
  85. package/esm/Progress/Progress.styles.js.map +1 -1
  86. package/esm/Radio/Radio.js.map +1 -1
  87. package/esm/Select/Select.styles.js.map +1 -1
  88. package/esm/Sheet/Sheet.styles.js.map +1 -1
  89. package/esm/ShowMore/ShowMore.js +2 -2
  90. package/esm/ShowMore/ShowMore.js.map +1 -1
  91. package/esm/Slider/Marks/Marks.style.js +3 -3
  92. package/esm/Slider/Marks/Marks.style.js.map +1 -1
  93. package/esm/Slider/SliderRoot/SliderRoot.styles.js.map +1 -1
  94. package/esm/Slider/Thumb/Thumb.styles.js.map +1 -1
  95. package/esm/SliderConfirm/SliderConfirm.styles.js.map +1 -1
  96. package/esm/Snippet/Snippet.js.map +1 -1
  97. package/esm/StatusDot/StatusDot.js +6 -6
  98. package/esm/StatusDot/StatusDot.js.map +1 -1
  99. package/esm/Steps/Step/Step.styles.js.map +1 -1
  100. package/esm/Steps/Steps.styles.js.map +1 -1
  101. package/esm/Steps/TabStep/TabStep.styles.js.map +1 -1
  102. package/esm/Switch/Switch.styles.js.map +1 -1
  103. package/esm/Table/BaseTable/BasePagination.js +12 -12
  104. package/esm/Table/BaseTable/BasePagination.js.map +1 -1
  105. package/esm/Table/BaseTable/PageNumberMenu.js +14 -0
  106. package/esm/Table/BaseTable/PageNumberMenu.js.map +1 -0
  107. package/esm/Table/BaseTable/TableEmpty/CreateButton.styles.js.map +1 -1
  108. package/esm/Table/BaseTable/TableEmpty/index.styles.js +2 -2
  109. package/esm/Table/BaseTable/TableEmpty/index.styles.js.map +1 -1
  110. package/esm/Table/BaseTable/TableFilteredEmpty/Description.styles.js.map +1 -1
  111. package/esm/Table/BaseTable/Toolbar/index.styles.js.map +1 -1
  112. package/esm/Tabs/Tabs.styles.js.map +1 -1
  113. package/esm/Tag/Tag.js +1 -1
  114. package/esm/Tag/Tag.js.map +1 -1
  115. package/esm/Text/Text.js +2 -2
  116. package/esm/Text/Text.js.map +1 -1
  117. package/esm/Textarea/Textarea.js.map +1 -1
  118. package/esm/Tooltip/Tooltip.styles.js.map +1 -1
  119. package/esm/TypeSelect/TypeSelect.styles.js.map +1 -1
  120. package/lib/src/Table/BaseTable/BasePagination.d.ts.map +1 -1
  121. package/lib/src/Table/BaseTable/PageNumberMenu.d.ts +13 -0
  122. package/lib/src/Table/BaseTable/PageNumberMenu.d.ts.map +1 -0
  123. package/lib/tsconfig.tsbuildinfo +1 -1
  124. package/package.json +8 -7
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.styles.js","sources":["../../src/Drawer/Drawer.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport RcDrawer from 'rc-drawer';\n\nexport const StyledDrawer = styled(RcDrawer)`\n position: fixed;\n z-index: 999;\n //overflow: hidden;\n\n &.drawer-left {\n left: 0;\n }\n\n &.drawer-right {\n right: 0;\n .drawer-content-wrapper {\n right: 0;\n }\n }\n\n &.drawer-left,\n &.drawer-right {\n top: 0;\n width: 0;\n height: 100%;\n }\n\n .drawer-mask {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 998;\n height: 0;\n background-color: rgba(35, 45, 65, 0.7);\n opacity: 0;\n transition: opacity 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);\n }\n\n .drawer-content-wrapper {\n position: absolute;\n z-index: 999;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #fff;\n inset: unset;\n transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);\n overflow: hidden;\n }\n\n &.drawer-open {\n width: 100%;\n .drawer-mask {\n opacity: 1;\n height: 100%;\n }\n\n &.drawer-left {\n .drawer-content-wrapper {\n height: 100%;\n }\n }\n\n &.drawer-right .drawer-content-wrapper {\n height: 100%;\n }\n }\n`;\n"],"names":["r","e"],"mappings":";;;AAAsE,MAAC,YAAY,CAACA,CAAC,CAACC,GAAC,CAAC,CAAC;AACzF;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"Drawer.styles.js","sources":["../../src/Drawer/Drawer.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport RcDrawer from 'rc-drawer';\n\nexport const StyledDrawer = styled(RcDrawer)`\n position: fixed;\n z-index: 999;\n //overflow: hidden;\n\n &.drawer-left {\n left: 0;\n }\n\n &.drawer-right {\n right: 0;\n .drawer-content-wrapper {\n right: 0;\n }\n }\n\n &.drawer-left,\n &.drawer-right {\n top: 0;\n width: 0;\n height: 100%;\n }\n\n .drawer-mask {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 998;\n height: 0;\n background-color: rgba(35, 45, 65, 0.7);\n opacity: 0;\n transition: opacity 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);\n }\n\n .drawer-content-wrapper {\n position: absolute;\n z-index: 999;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #fff;\n inset: unset;\n transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);\n overflow: hidden;\n }\n\n &.drawer-open {\n width: 100%;\n .drawer-mask {\n opacity: 1;\n height: 100%;\n }\n\n &.drawer-left {\n .drawer-content-wrapper {\n height: 100%;\n }\n }\n\n &.drawer-right .drawer-content-wrapper {\n height: 100%;\n }\n }\n`;\n"],"names":["r"],"mappings":";;;AAAsE,MAAC,YAAY,CAACA,CAAC,CAAC,CAAC,CAAC,CAAC;AACzF;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
@@ -1,4 +1,4 @@
1
- import p,{useState as W}from"react";import d from"styled-components";import{isUndefined as E}from"lodash";import{Tooltip as S}from"../Tooltip/Tooltip.js";var I=Object.defineProperty,N=Object.defineProperties,U=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,b=(e,r,t)=>r in e?I(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,s=(e,r)=>{for(var t in r||(r={}))m.call(r,t)&&b(e,t,r[t]);if(o)for(var t of o(r))f.call(r,t)&&b(e,t,r[t]);return e},_=(e,r)=>N(e,U(r)),z=(e,r)=>{var t={};for(var i in e)m.call(e,i)&&r.indexOf(i)<0&&(t[i]=e[i]);if(e!=null&&o)for(var i of o(e))r.indexOf(i)<0&&f.call(e,i)&&(t[i]=e[i]);return t};const A=d(S)`
1
+ import p,{useState as $}from"react";import d from"styled-components";import{isUndefined as E}from"lodash";import{Tooltip as S}from"../Tooltip/Tooltip.js";var I=Object.defineProperty,N=Object.defineProperties,U=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,b=(e,r,t)=>r in e?I(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,s=(e,r)=>{for(var t in r||(r={}))m.call(r,t)&&b(e,t,r[t]);if(o)for(var t of o(r))f.call(r,t)&&b(e,t,r[t]);return e},_=(e,r)=>N(e,U(r)),z=(e,r)=>{var t={};for(var i in e)m.call(e,i)&&r.indexOf(i)<0&&(t[i]=e[i]);if(e!=null&&o)for(var i of o(e))r.indexOf(i)<0&&f.call(e,i)&&(t[i]=e[i]);return t};const A=d(S)`
2
2
  &.tippy-box {
3
3
  background-color: ${({theme:e})=>e.palette.background};
4
4
 
@@ -14,5 +14,5 @@ import p,{useState as W}from"react";import d from"styled-components";import{isUn
14
14
  `,M=d.div`
15
15
  display: flex;
16
16
  flex-direction: column;
17
- `;function v(e){var r=e,{title:t,children:i,placement:u="bottom",interactive:y=!0,trigger:h="click",hideOnClick:l=!0,arrow:g=!1,maxWidth:O=210,animation:w="shift-away",content:k,visible:n}=r,x=z(r,["title","children","placement","interactive","trigger","hideOnClick","arrow","maxWidth","animation","content","visible"]);const[a,c]=W(!1),j=()=>{l&&a&&!n&&a.hide()},P=T=>{c(T)},C=()=>{a&&c(!1)},$=p.createElement(M,{onClick:j},k),D=E(n)?{trigger:h,hideOnClick:l}:{visible:n};return p.createElement(A,_(s(s({placement:u,arrow:g,interactive:y,maxWidth:O,animation:w,onMount:P,onDestroy:C},D),x),{content:$}),i)}v.displayName="@kubed/components/Dropdown";export{v as Dropdown};
17
+ `;function v(e){var r=e,{title:t,children:i,placement:u="bottom",interactive:y=!0,trigger:h="click",hideOnClick:l=!0,arrow:g=!1,maxWidth:O=210,animation:w="shift-away",content:k,visible:n}=r,x=z(r,["title","children","placement","interactive","trigger","hideOnClick","arrow","maxWidth","animation","content","visible"]);const[a,c]=$(!1),j=()=>{l&&a&&!n&&a.hide()},P=W=>{c(W)},C=()=>{a&&c(!1)},D=p.createElement(M,{onClick:j},k),T=E(n)?{trigger:h,hideOnClick:l}:{visible:n};return p.createElement(A,_(s(s({placement:u,arrow:g,interactive:y,maxWidth:O,animation:w,onMount:P,onDestroy:C},T),x),{content:D}),i)}v.displayName="@kubed/components/Dropdown";export{v as Dropdown};
18
18
  //# sourceMappingURL=Dropdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.js","sources":["../../src/Dropdown/Dropdown.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { isUndefined } from 'lodash';\nimport { Tooltip, TooltipProps } from '../Tooltip/Tooltip';\n\nconst StyledTooltip = styled(Tooltip)<TooltipProps>`\n &.tippy-box {\n background-color: ${({ theme }) => theme.palette.background};\n\n .tippy-content {\n padding: 0;\n }\n\n .tippy-arrow {\n color: ${({ theme }) => theme.palette.background};\n border-color: ${({ theme }) => theme.palette.border};\n }\n }\n`;\n\nconst DropdownWrapper = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nexport interface DropdownProps extends TooltipProps {\n title?: string;\n}\n\nexport function Dropdown({\n title,\n children,\n placement = 'bottom',\n interactive = true,\n trigger = 'click',\n hideOnClick = true,\n arrow = false,\n maxWidth = 210,\n animation = 'shift-away',\n content,\n visible,\n ...rest\n}: DropdownProps) {\n const [instance, setInstance] = useState(false);\n const onDropdownClick = () => {\n if (hideOnClick && instance && !visible) {\n // @ts-ignore\n instance.hide();\n }\n };\n\n const onMount = (i) => {\n setInstance(i);\n };\n\n const onDestroy = () => {\n instance && setInstance(false);\n };\n\n const popContent = <DropdownWrapper onClick={onDropdownClick}>{content}</DropdownWrapper>;\n const triggerProps = isUndefined(visible) ? { trigger, hideOnClick } : { visible };\n\n return (\n // @ts-ignore\n <StyledTooltip\n placement={placement}\n arrow={arrow}\n interactive={interactive}\n maxWidth={maxWidth}\n animation={animation}\n onMount={onMount}\n onDestroy={onDestroy}\n {...triggerProps}\n {...rest}\n content={popContent}\n >\n {children}\n </StyledTooltip>\n );\n}\n\nDropdown.displayName = '@kubed/components/Dropdown';\n"],"names":["D","v","j","w","q"],"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,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,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,G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AC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,4BAA4B;;;;"}
1
+ {"version":3,"file":"Dropdown.js","sources":["../../src/Dropdown/Dropdown.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { isUndefined } from 'lodash';\nimport { Tooltip, TooltipProps } from '../Tooltip/Tooltip';\n\nconst StyledTooltip = styled(Tooltip)<TooltipProps>`\n &.tippy-box {\n background-color: ${({ theme }) => theme.palette.background};\n\n .tippy-content {\n padding: 0;\n }\n\n .tippy-arrow {\n color: ${({ theme }) => theme.palette.background};\n border-color: ${({ theme }) => theme.palette.border};\n }\n }\n`;\n\nconst DropdownWrapper = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nexport interface DropdownProps extends TooltipProps {\n title?: string;\n}\n\nexport function Dropdown({\n title,\n children,\n placement = 'bottom',\n interactive = true,\n trigger = 'click',\n hideOnClick = true,\n arrow = false,\n maxWidth = 210,\n animation = 'shift-away',\n content,\n visible,\n ...rest\n}: DropdownProps) {\n const [instance, setInstance] = useState(false);\n const onDropdownClick = () => {\n if (hideOnClick && instance && !visible) {\n // @ts-ignore\n instance.hide();\n }\n };\n\n const onMount = (i) => {\n setInstance(i);\n };\n\n const onDestroy = () => {\n instance && setInstance(false);\n };\n\n const popContent = <DropdownWrapper onClick={onDropdownClick}>{content}</DropdownWrapper>;\n const triggerProps = isUndefined(visible) ? { trigger, hideOnClick } : { visible };\n\n return (\n // @ts-ignore\n <StyledTooltip\n placement={placement}\n arrow={arrow}\n interactive={interactive}\n maxWidth={maxWidth}\n animation={animation}\n onMount={onMount}\n onDestroy={onDestroy}\n {...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,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,4BAA4B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Dropzone.styles.js","sources":["../../src/Dropzone/Dropzone.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const DropzoneWrapper = styled.div`\n box-sizing: border-box;\n cursor: pointer;\n user-select: none;\n position: relative;\n transition: background-color 150ms ease;\n border: 2px dashed ${({ theme }) => theme.palette.border};\n border-radius: 4px;\n padding: 16px;\n`;\n\nexport const DropzoneInner = styled.div`\n pointer-events: none;\n user-select: none;\n`;\n"],"names":[],"mappings":";;AAA6C,MAAC,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC;AACpE;AACA;AACA;AACA;AACA;AACA,qBAAqB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;AACrD;AACA;AACA,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC;AACtB;AACA;AACA;;;;"}
1
+ {"version":3,"file":"Dropzone.styles.js","sources":["../../src/Dropzone/Dropzone.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const DropzoneWrapper = styled.div`\n box-sizing: border-box;\n cursor: pointer;\n user-select: none;\n position: relative;\n transition: background-color 150ms ease;\n border: 2px dashed ${({ theme }) => theme.palette.border};\n border-radius: 4px;\n padding: 16px;\n`;\n\nexport const DropzoneInner = styled.div`\n pointer-events: none;\n user-select: none;\n`;\n"],"names":["e"],"mappings":";;AAA6C,MAAC,eAAe,CAACA,CAAC,CAAC,GAAG,CAAC;AACpE;AACA;AACA;AACA;AACA;AACA,qBAAqB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;AACrD;AACA;AACA,CAAC,CAAC,aAAa,CAACA,CAAC,CAAC,GAAG,CAAC;AACtB;AACA;AACA;;;;"}
@@ -24,5 +24,5 @@ import i from"react";import l from"styled-components";import{isNull as x}from"lo
24
24
  margin-top: 4px;
25
25
  line-height: 1.67;
26
26
  color: ${({theme:e})=>e.palette.accents_5};
27
- `,L=l.div``,f=E((e,r)=>{var t=e,{title:a,description:o,image:c=i.createElement(h,{size:48}),imageClassName:y,imageStyle:u,children:m}=t,v=w(t,["title","description","image","imageClassName","imageStyle","children"]);const{locales:g}=j(),b=a||g.Empty.noData;return i.createElement(k,O({ref:r},v),c&&i.createElement(C,{className:y,style:u},c),!x(a)&&i.createElement(P,{className:"empty-title"},b),o&&i.createElement(_,{className:"empty-desc"},o),m&&i.createElement(L,null,m))});f.displayName="@kubed/components/Empty";export{f as Empty};
27
+ `,$=l.div``,f=E((e,r)=>{var t=e,{title:a,description:o,image:c=i.createElement(h,{size:48}),imageClassName:y,imageStyle:u,children:m}=t,v=w(t,["title","description","image","imageClassName","imageStyle","children"]);const{locales:g}=j(),b=a||g.Empty.noData;return i.createElement(k,O({ref:r},v),c&&i.createElement(C,{className:y,style:u},c),!x(a)&&i.createElement(P,{className:"empty-title"},b),o&&i.createElement(_,{className:"empty-desc"},o),m&&i.createElement($,null,m))});f.displayName="@kubed/components/Empty";export{f as Empty};
28
28
  //# sourceMappingURL=Empty.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Empty.js","sources":["../../src/Empty/Empty.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { isNull } from 'lodash';\nimport { Exclamation } from '@kubed/icons';\nimport forwardRef from '../utils/forwardRef';\nimport { DefaultProps } from '../theme';\nimport { useLocales } from '../ConfigProvider/LocaleProvider/LocaleContext';\n\nconst EmptyWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n`;\n\nconst Image = styled.div`\n width: 60px;\n height: 60px;\n border-radius: 50% 0 50% 50%;\n background: ${({ theme }) => theme.palette.accents_1};\n margin-bottom: 20px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n .kubed-icon {\n margin-bottom: 8px;\n }\n`;\n\nconst Title = styled.div`\n font-size: 14px;\n font-weight: 700;\n color: ${({ theme }) => theme.palette.accents_7};\n`;\n\nconst Description = styled.div`\n margin-top: 4px;\n line-height: 1.67;\n color: ${({ theme }) => theme.palette.accents_5};\n`;\n\nconst Footer = styled.div``;\n\nexport interface EmptyProps extends DefaultProps {\n /** title of Empty */\n title?: React.ReactNode | string;\n\n /** description of Empty */\n description?: React.ReactNode | string;\n\n /** icon element of Empty */\n image?: React.ReactNode;\n\n /** className of image */\n imageClassName?: string;\n\n /** style of image */\n imageStyle?: React.CSSProperties;\n}\n\nexport const Empty = forwardRef<EmptyProps, 'div'>(\n (\n {\n title,\n description,\n image = <Exclamation size={48} />,\n imageClassName,\n imageStyle,\n children,\n ...rest\n },\n ref\n ) => {\n const { locales } = useLocales();\n const defaultTitle = title || locales.Empty.noData;\n return (\n <EmptyWrapper ref={ref} {...rest}>\n {image && (\n <Image className={imageClassName} style={imageStyle}>\n {image}\n </Image>\n )}\n {!isNull(title) && <Title className=\"empty-title\">{defaultTitle}</Title>}\n {description && <Description className=\"empty-desc\">{description}</Description>}\n {children && <Footer>{children}</Footer>}\n </EmptyWrapper>\n );\n }\n);\n\nEmpty.displayName = '@kubed/components/Empty';\n"],"names":["s","h","r","b","P","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,C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C,UAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAOF,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACG,MAAC,CAAC,CAAC,CAAC,EAAEH,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,yBAAyB;;;;"}
1
+ {"version":3,"file":"Empty.js","sources":["../../src/Empty/Empty.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { isNull } from 'lodash';\nimport { Exclamation } from '@kubed/icons';\nimport forwardRef from '../utils/forwardRef';\nimport { DefaultProps } from '../theme';\nimport { useLocales } from '../ConfigProvider/LocaleProvider/LocaleContext';\n\nconst EmptyWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n`;\n\nconst Image = styled.div`\n width: 60px;\n height: 60px;\n border-radius: 50% 0 50% 50%;\n background: ${({ theme }) => theme.palette.accents_1};\n margin-bottom: 20px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n .kubed-icon {\n margin-bottom: 8px;\n }\n`;\n\nconst Title = styled.div`\n font-size: 14px;\n font-weight: 700;\n color: ${({ theme }) => theme.palette.accents_7};\n`;\n\nconst Description = styled.div`\n margin-top: 4px;\n line-height: 1.67;\n color: ${({ theme }) => theme.palette.accents_5};\n`;\n\nconst Footer = styled.div``;\n\nexport interface EmptyProps extends DefaultProps {\n /** title of Empty */\n title?: React.ReactNode | string;\n\n /** description of Empty */\n description?: React.ReactNode | string;\n\n /** icon element of Empty */\n image?: React.ReactNode;\n\n /** className of image */\n imageClassName?: string;\n\n /** style of image */\n imageStyle?: React.CSSProperties;\n}\n\nexport const Empty = forwardRef<EmptyProps, 'div'>(\n (\n {\n title,\n description,\n image = <Exclamation size={48} />,\n imageClassName,\n imageStyle,\n children,\n ...rest\n },\n ref\n ) => {\n const { locales } = useLocales();\n const defaultTitle = title || locales.Empty.noData;\n return (\n <EmptyWrapper ref={ref} {...rest}>\n {image && (\n <Image className={imageClassName} style={imageStyle}>\n {image}\n </Image>\n )}\n {!isNull(title) && <Title className=\"empty-title\">{defaultTitle}</Title>}\n {description && <Description className=\"empty-desc\">{description}</Description>}\n {children && <Footer>{children}</Footer>}\n </EmptyWrapper>\n );\n }\n);\n\nEmpty.displayName = '@kubed/components/Empty';\n"],"names":["s","h","r","b","P","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,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AAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACG,MAAC,CAAC,CAAC,CAAC,EAAEH,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,yBAAyB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Entity.js","sources":["../../src/Entity/Entity.tsx"],"sourcesContent":["import React from 'react';\nimport styled, { css } from 'styled-components';\nimport { Dropdown, DropdownProps } from '../Dropdown/Dropdown';\nimport { Field } from './Field';\nimport { DefaultProps, KubedTheme } from '../theme';\nimport forwardRef from '../utils/forwardRef';\nimport { addColorAlpha } from '../utils/color';\n\nexport { Field };\n\nconst getHoverStyle = (hoverable, theme: KubedTheme) => {\n const { palette } = theme;\n if (hoverable) {\n return css`\n border-color: ${palette.accents_5};\n box-shadow: 0 4px 8px 0 ${addColorAlpha(palette.accents_8, 0.2)};\n `;\n }\n return null;\n};\n\nconst Wrapper = styled.div`\n position: relative;\n\n & > div:nth-child(2) {\n width: 100%;\n }\n`;\n\nconst EntityWrapper = styled('div')<EntityProps>`\n display: flex;\n flex-direction: column;\n position: relative;\n padding: 12px;\n background-color: ${({ theme }) => theme.palette.background};\n border: ${({ bordered, theme }) => (bordered ? `1px solid ${theme.palette.border}` : null)};\n border-radius: 4px;\n transition: all 0.3s ease-in-out;\n cursor: ${({ expandable }) => (expandable ? 'pointer' : null)};\n\n &:hover,\n &[aria-expanded='true'] {\n ${({ hoverable, theme }) => getHoverStyle(hoverable, theme)};\n }\n`;\n\nconst EntityContainer = styled('div')<{ $gap: number }>`\n display: flex;\n flex-grow: 1;\n flex-shrink: 1;\n ${({ $gap }) => ($gap ? `gap: ${$gap}px` : null)};\n`;\n\nconst EntityFooter = styled('div')`\n display: flex;\n border-radius: 4px;\n padding: 8px;\n margin-top: 12px;\n background-color: ${({ theme }) => theme.palette.accents_1};\n`;\n\nconst ExpandContainer = styled('div')`\n padding: 12px;\n z-index: 1;\n border: 1px solid ${({ theme }) => theme.palette.accents_5};\n border-top: 0;\n border-radius: 0 0 4px 4px;\n`;\n\nexport interface EntityProps extends DefaultProps {\n /** Add effect on hover\t */\n hoverable?: boolean;\n\n /** Whether Entity can expand */\n expandable?: boolean;\n\n /** Render function of expand */\n expandContent?: React.ReactNode;\n\n /** Whether Entity has border\t*/\n bordered?: boolean;\n\n /** Add effect on hover\t */\n footer?: React.ReactNode;\n\n /** Gap between children */\n gap?: number;\n\n /** Props of expand */\n expandProps?: Omit<DropdownProps, 'children'>;\n}\n\nexport const Entity = forwardRef<EntityProps, 'div'>(\n (\n {\n children,\n footer,\n gap = 20,\n bordered = true,\n expandable = false,\n expandContent,\n expandProps,\n ...rest\n },\n ref\n ) => {\n if (expandable) {\n return (\n <Wrapper>\n <Dropdown\n content={\n <ExpandContainer className=\"expand-container\">{expandContent}</ExpandContainer>\n }\n appendTo=\"parent\"\n className=\"entity-dropdown\"\n maxWidth=\"100%\"\n offset={[0, -3]}\n placement=\"bottom\"\n {...expandProps}\n >\n <EntityWrapper ref={ref} bordered={bordered} expandable={expandable} {...rest}>\n <EntityContainer $gap={gap} className=\"entity-main\">\n {children}\n </EntityContainer>\n {footer && <EntityFooter className=\"entity-footer\">{footer}</EntityFooter>}\n </EntityWrapper>\n </Dropdown>\n </Wrapper>\n );\n }\n\n return (\n <EntityWrapper ref={ref} bordered={bordered} expandable={expandable} {...rest}>\n <EntityContainer $gap={gap} className=\"entity-main\">\n {children}\n </EntityContainer>\n {footer && <EntityFooter className=\"entity-footer\">{footer}</EntityFooter>}\n </EntityWrapper>\n );\n }\n);\n\nEntity.displayName = '@kubed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import { Dropdown, DropdownProps } from '../Dropdown/Dropdown';\nimport { Field } from './Field';\nimport { DefaultProps, KubedTheme } from '../theme';\nimport forwardRef from '../utils/forwardRef';\nimport { addColorAlpha } from '../utils/color';\n\nexport { Field };\n\nconst getHoverStyle = (hoverable, theme: KubedTheme) => {\n const { palette } = theme;\n if (hoverable) {\n return css`\n border-color: ${palette.accents_5};\n box-shadow: 0 4px 8px 0 ${addColorAlpha(palette.accents_8, 0.2)};\n `;\n }\n return null;\n};\n\nconst Wrapper = styled.div`\n position: relative;\n\n & > div:nth-child(2) {\n width: 100%;\n }\n`;\n\nconst EntityWrapper = styled('div')<EntityProps>`\n display: flex;\n flex-direction: column;\n position: relative;\n padding: 12px;\n background-color: ${({ theme }) => theme.palette.background};\n border: ${({ bordered, theme }) => (bordered ? `1px solid ${theme.palette.border}` : null)};\n border-radius: 4px;\n transition: all 0.3s ease-in-out;\n cursor: ${({ expandable }) => (expandable ? 'pointer' : null)};\n\n &:hover,\n &[aria-expanded='true'] {\n ${({ hoverable, theme }) => getHoverStyle(hoverable, theme)};\n }\n`;\n\nconst EntityContainer = styled('div')<{ $gap: number }>`\n display: flex;\n flex-grow: 1;\n flex-shrink: 1;\n ${({ $gap }) => ($gap ? `gap: ${$gap}px` : null)};\n`;\n\nconst EntityFooter = styled('div')`\n display: flex;\n border-radius: 4px;\n padding: 8px;\n margin-top: 12px;\n background-color: ${({ theme }) => theme.palette.accents_1};\n`;\n\nconst ExpandContainer = styled('div')`\n padding: 12px;\n z-index: 1;\n border: 1px solid ${({ theme }) => theme.palette.accents_5};\n border-top: 0;\n border-radius: 0 0 4px 4px;\n`;\n\nexport interface EntityProps extends DefaultProps {\n /** Add effect on hover\t */\n hoverable?: boolean;\n\n /** Whether Entity can expand */\n expandable?: boolean;\n\n /** Render function of expand */\n expandContent?: React.ReactNode;\n\n /** Whether Entity has border\t*/\n bordered?: boolean;\n\n /** Add effect on hover\t */\n footer?: React.ReactNode;\n\n /** Gap between children */\n gap?: number;\n\n /** Props of expand */\n expandProps?: Omit<DropdownProps, 'children'>;\n}\n\nexport const Entity = forwardRef<EntityProps, 'div'>(\n (\n {\n children,\n footer,\n gap = 20,\n bordered = true,\n expandable = false,\n expandContent,\n expandProps,\n ...rest\n },\n ref\n ) => {\n if (expandable) {\n return (\n <Wrapper>\n <Dropdown\n content={\n <ExpandContainer className=\"expand-container\">{expandContent}</ExpandContainer>\n }\n appendTo=\"parent\"\n className=\"entity-dropdown\"\n maxWidth=\"100%\"\n offset={[0, -3]}\n placement=\"bottom\"\n {...expandProps}\n >\n <EntityWrapper ref={ref} bordered={bordered} expandable={expandable} {...rest}>\n <EntityContainer $gap={gap} className=\"entity-main\">\n {children}\n </EntityContainer>\n {footer && <EntityFooter className=\"entity-footer\">{footer}</EntityFooter>}\n </EntityWrapper>\n </Dropdown>\n </Wrapper>\n );\n }\n\n return (\n <EntityWrapper ref={ref} bordered={bordered} expandable={expandable} {...rest}>\n <EntityContainer $gap={gap} className=\"entity-main\">\n {children}\n </EntityContainer>\n {footer && <EntityFooter className=\"entity-footer\">{footer}</EntityFooter>}\n </EntityWrapper>\n );\n }\n);\n\nEntity.displayName = '@kubed/components/Entity';\n"],"names":["v","P","p","D","n","w"],"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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AC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,0BAA0B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","sources":["../../src/Entity/Field.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { isNumber } from 'lodash';\nimport { DefaultProps } from '../theme';\nimport forwardRef from '../utils/forwardRef';\n\nconst FieldWrapper = styled('div')<FieldProps>`\n font-family: Roboto, PingFang SC, Lantinghei SC, Helvetica Neue, Helvetica, Arial, Microsoft YaHei,\n 微软雅黑, STHeitiSC-Light, simsun, 宋体, WenQuanYi Zen Hei, WenQuanYi Micro Hei, sans-serif;\n line-height: 1.67;\n display: flex;\n flex-direction: row;\n align-items: center;\n flex-grow: 1;\n flex-shrink: 1;\n ${({ width }) => (width ? `width: ${isNumber(width) ? `${width}px` : width};` : null)};\n`;\n\nconst FieldAvatar = styled('div')`\n display: inline-flex;\n margin-right: 12px;\n`;\n\nconst FieldContent = styled('div')`\n overflow: hidden;\n`;\n\nconst FieldLabel = styled('div')`\n text-overflow: ellipsis;\n white-space: nowrap;\n word-wrap: normal;\n overflow: hidden;\n color: ${({ theme }) => theme.palette.accents_5};\n`;\n\nconst FieldValue = styled('div')`\n font-weight: 700;\n color: ${({ theme }) => theme.palette.accents_8};\n`;\n\nexport interface FieldProps extends DefaultProps {\n /** Field label */\n label?: React.ReactNode;\n\n /** Field value */\n value?: React.ReactNode;\n\n /** Field avatar */\n avatar?: React.ReactNode;\n\n /** Width of Field */\n width?: number | string;\n}\n\nexport const Field = forwardRef<FieldProps, 'div'>(({ label, value, avatar, ...rest }, ref) => {\n return (\n <FieldWrapper ref={ref} {...rest}>\n {avatar && <FieldAvatar className=\"field-avatar\">{avatar}</FieldAvatar>}\n <FieldContent className=\"field-content\">\n {value && <FieldValue className=\"field-value\">{value}</FieldValue>}\n {label && <FieldLabel className=\"field-label\">{label}</FieldLabel>}\n </FieldContent>\n </FieldWrapper>\n );\n});\n\nField.displayName = '@kubed/components/Field';\n"],"names":["a","u","v","t"],"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,CA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CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,yBAAyB;;;;"}
1
+ {"version":3,"file":"Field.js","sources":["../../src/Entity/Field.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { isNumber } from 'lodash';\nimport { DefaultProps } from '../theme';\nimport forwardRef from '../utils/forwardRef';\n\nconst FieldWrapper = styled('div')<FieldProps>`\n font-family: Roboto, PingFang SC, Lantinghei SC, Helvetica Neue, Helvetica, Arial, Microsoft YaHei,\n 微软雅黑, STHeitiSC-Light, simsun, 宋体, WenQuanYi Zen Hei, WenQuanYi Micro Hei, sans-serif;\n line-height: 1.67;\n display: flex;\n flex-direction: row;\n align-items: center;\n flex-grow: 1;\n flex-shrink: 1;\n ${({ width }) => (width ? `width: ${isNumber(width) ? `${width}px` : width};` : null)};\n`;\n\nconst FieldAvatar = styled('div')`\n display: inline-flex;\n margin-right: 12px;\n`;\n\nconst FieldContent = styled('div')`\n overflow: hidden;\n`;\n\nconst FieldLabel = styled('div')`\n text-overflow: ellipsis;\n white-space: nowrap;\n word-wrap: normal;\n overflow: hidden;\n color: ${({ theme }) => theme.palette.accents_5};\n`;\n\nconst FieldValue = styled('div')`\n font-weight: 700;\n color: ${({ theme }) => theme.palette.accents_8};\n`;\n\nexport interface FieldProps extends DefaultProps {\n /** Field label */\n label?: React.ReactNode;\n\n /** Field value */\n value?: React.ReactNode;\n\n /** Field avatar */\n avatar?: React.ReactNode;\n\n /** Width of Field */\n width?: number | string;\n}\n\nexport const Field = forwardRef<FieldProps, 'div'>(({ label, value, avatar, ...rest }, ref) => {\n return (\n <FieldWrapper ref={ref} {...rest}>\n {avatar && <FieldAvatar className=\"field-avatar\">{avatar}</FieldAvatar>}\n <FieldContent className=\"field-content\">\n {value && <FieldValue className=\"field-value\">{value}</FieldValue>}\n {label && <FieldLabel className=\"field-label\">{label}</FieldLabel>}\n </FieldContent>\n </FieldWrapper>\n );\n});\n\nField.displayName = '@kubed/components/Field';\n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K,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAOC,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAACA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,EAAEA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,yBAAyB;;;;"}
@@ -1,4 +1,4 @@
1
- import o from"styled-components";import{Menu as r}from"../Menu/Menu.js";import{addColorAlpha as t}from"../utils/color.js";const a=o.div`
1
+ import o from"styled-components";import{Menu as t}from"../Menu/Menu.js";import{addColorAlpha as r}from"../utils/color.js";const a=o.div`
2
2
  position: relative;
3
3
  width: 100%;
4
4
  height: 32px;
@@ -83,10 +83,10 @@ import o from"styled-components";import{Menu as r}from"../Menu/Menu.js";import{a
83
83
  cursor: pointer;
84
84
  border-radius: 4px;
85
85
  &:hover {
86
- background-color: ${({theme:e})=>t(e.palette.accents_6,.6)};
86
+ background-color: ${({theme:e})=>r(e.palette.accents_6,.6)};
87
87
  }
88
88
  }
89
- `,p=o(r)`
89
+ `,p=o(t)`
90
90
  background-color: ${({theme:e})=>e.palette.accents_8};
91
91
  padding: 0;
92
92
 
@@ -1 +1 @@
1
- {"version":3,"file":"FilterInput.styles.js","sources":["../../src/FilterInput/FilterInput.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Menu, MenuItem } from '../Menu/Menu';\nimport { addColorAlpha } from '../utils/color';\n\nexport const Wrapper = styled.div`\n position: relative;\n width: 100%;\n height: 32px;\n padding: 5px 40px;\n border-radius: 18px;\n border: solid 1px transparent;\n background-color: ${({ theme }) => theme.palette.accents_1};\n transition: all 0.3s ease-in-out;\n outline: none;\n\n &:hover {\n border-color: ${({ theme }) => theme.palette.border};\n }\n\n &.is-disabled {\n border: solid 1px transparent;\n opacity: 0.6;\n cursor: not-allowed;\n & > * {\n pointer-events: none;\n }\n }\n &.has-value,\n &.is-focused {\n background-color: ${({ theme }) => theme.palette.background};\n border-color: ${({ theme }) => theme.palette.accents_5};\n }\n\n .icon-search,\n .icon-clear {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n z-index: 4;\n }\n\n .icon-search {\n left: 12px;\n }\n\n .icon-clear {\n right: 12px;\n cursor: pointer;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_1};\n }\n }\n`;\n\nexport const InputWrapper = styled.div`\n display: flex;\n\n .filter-input {\n flex: 1;\n width: auto;\n height: 20px;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n background-color: transparent;\n box-shadow: none !important;\n color: ${({ theme }) => theme.palette.accents_8};\n font-weight: 600;\n }\n\n .filter-tag {\n border-radius: 12px;\n padding: 1px 6px 1px 12px;\n margin-top: -2px;\n height: 24px;\n margin-right: 4px;\n background-color: ${({ theme }) => theme.palette.accents_8};\n color: ${({ theme }) => theme.palette.background};\n\n & + .filter-input {\n margin: 0 0 0 6px;\n }\n }\n\n .icon-close-tag {\n margin-left: 6px;\n cursor: pointer;\n border-radius: 4px;\n &:hover {\n background-color: ${({ theme }) => addColorAlpha(theme.palette.accents_6, 0.6)};\n }\n }\n`;\n\nexport const StyledMenu = styled(Menu)`\n background-color: ${({ theme }) => theme.palette.accents_8};\n padding: 0;\n\n .menu-item {\n border-radius: 0;\n padding: 6px 19px 6px 12px;\n color: ${({ theme }) => theme.palette.background};\n\n &:first-child,\n &:last-child {\n border-radius: 4px;\n }\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_7};\n }\n }\n`;\n"],"names":["t","r"],"mappings":";;;;AAAgI,MAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AAC/I;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACvD;AACA;AACA;AACA;AACA,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;AAClD;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,UAAU,CAAC;AAC1D,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AAC3D;AACA;AACA,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AAC9C;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,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAGA,aAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AACjE;AACA;AACA,CAAC,CAAC,UAAU,CAAC,CAAC,CAACC,IAAC,CAAC,CAAC;AAClB,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACvD;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AAC3D;AACA;AACA;;;;"}
1
+ {"version":3,"file":"FilterInput.styles.js","sources":["../../src/FilterInput/FilterInput.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Menu, MenuItem } from '../Menu/Menu';\nimport { addColorAlpha } from '../utils/color';\n\nexport const Wrapper = styled.div`\n position: relative;\n width: 100%;\n height: 32px;\n padding: 5px 40px;\n border-radius: 18px;\n border: solid 1px transparent;\n background-color: ${({ theme }) => theme.palette.accents_1};\n transition: all 0.3s ease-in-out;\n outline: none;\n\n &:hover {\n border-color: ${({ theme }) => theme.palette.border};\n }\n\n &.is-disabled {\n border: solid 1px transparent;\n opacity: 0.6;\n cursor: not-allowed;\n & > * {\n pointer-events: none;\n }\n }\n &.has-value,\n &.is-focused {\n background-color: ${({ theme }) => theme.palette.background};\n border-color: ${({ theme }) => theme.palette.accents_5};\n }\n\n .icon-search,\n .icon-clear {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n z-index: 4;\n }\n\n .icon-search {\n left: 12px;\n }\n\n .icon-clear {\n right: 12px;\n cursor: pointer;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_1};\n }\n }\n`;\n\nexport const InputWrapper = styled.div`\n display: flex;\n\n .filter-input {\n flex: 1;\n width: auto;\n height: 20px;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n background-color: transparent;\n box-shadow: none !important;\n color: ${({ theme }) => theme.palette.accents_8};\n font-weight: 600;\n }\n\n .filter-tag {\n border-radius: 12px;\n padding: 1px 6px 1px 12px;\n margin-top: -2px;\n height: 24px;\n margin-right: 4px;\n background-color: ${({ theme }) => theme.palette.accents_8};\n color: ${({ theme }) => theme.palette.background};\n\n & + .filter-input {\n margin: 0 0 0 6px;\n }\n }\n\n .icon-close-tag {\n margin-left: 6px;\n cursor: pointer;\n border-radius: 4px;\n &:hover {\n background-color: ${({ theme }) => addColorAlpha(theme.palette.accents_6, 0.6)};\n }\n }\n`;\n\nexport const StyledMenu = styled(Menu)`\n background-color: ${({ theme }) => theme.palette.accents_8};\n padding: 0;\n\n .menu-item {\n border-radius: 0;\n padding: 6px 19px 6px 12px;\n color: ${({ theme }) => theme.palette.background};\n\n &:first-child,\n &:last-child {\n border-radius: 4px;\n }\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_7};\n }\n }\n`;\n"],"names":["e","t","r"],"mappings":";;;;AAAgI,MAAC,OAAO,CAACA,CAAC,CAAC,GAAG,CAAC;AAC/I;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACvD;AACA;AACA;AACA;AACA,kBAAkB,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AAC,CAAC;AAClB,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACvD;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AAC3D;AACA;AACA;;;;"}
package/esm/Form/Form.js CHANGED
@@ -1,4 +1,4 @@
1
- import n,{useMemo as E}from"react";import P from"classnames";import _ from"styled-components";import A from"rc-field-form";import{List as X,useWatch as Y}from"rc-field-form";import{FormContext as N}from"./context.js";import R from"../utils/forwardRef.js";import k from"./hooks/useForm.js";import{default as ee}from"./hooks/useForm.js";import{addColorAlpha as I}from"../utils/color.js";var L=Object.defineProperty,T=Object.defineProperties,$=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,h=(e,r,o)=>r in e?L(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,z=(e,r)=>{for(var o in r||(r={}))F.call(r,o)&&h(e,o,r[o]);if(a)for(var o of a(r))y.call(r,o)&&h(e,o,r[o]);return e},S=(e,r)=>T(e,$(r)),D=(e,r)=>{var o={};for(var t in e)F.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(e!=null&&a)for(var t of a(e))r.indexOf(t)<0&&y.call(e,t)&&(o[t]=e[t]);return o};const H=_(A)`
1
+ import n,{useMemo as E}from"react";import P from"classnames";import _ from"styled-components";import A from"rc-field-form";import{List as X,useWatch as Y}from"rc-field-form";import{FormContext as N}from"./context.js";import R from"../utils/forwardRef.js";import $ from"./hooks/useForm.js";import{default as ee}from"./hooks/useForm.js";import{addColorAlpha as k}from"../utils/color.js";var I=Object.defineProperty,L=Object.defineProperties,T=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,h=(e,r,o)=>r in e?I(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,z=(e,r)=>{for(var o in r||(r={}))F.call(r,o)&&h(e,o,r[o]);if(a)for(var o of a(r))y.call(r,o)&&h(e,o,r[o]);return e},S=(e,r)=>L(e,T(r)),D=(e,r)=>{var o={};for(var t in e)F.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(e!=null&&a)for(var t of a(e))r.indexOf(t)<0&&y.call(e,t)&&(o[t]=e[t]);return o};const H=_(A)`
2
2
  &.form-inline {
3
3
  display: flex;
4
4
  gap: 12px;
@@ -8,9 +8,9 @@ import n,{useMemo as E}from"react";import P from"classnames";import _ from"style
8
8
  .input-wrapper {
9
9
  border-color: ${({theme:e})=>e.palette.error};
10
10
  &.input-focus {
11
- box-shadow: 0 4px 8px 0 ${({theme:e})=>I(e.palette.error,.2)};
11
+ box-shadow: 0 4px 8px 0 ${({theme:e})=>k(e.palette.error,.2)};
12
12
  }
13
13
  }
14
14
  }
15
- `,j=R((e,r)=>{var o=e,{name:t,layout:s="vertical",labelAlign:p="right",labelCol:f={span:4},wrapperCol:c={span:14},onFinishFailed:u,scrollToFirstError:i,form:x,className:w,size:d="sm"}=o,O=D(o,["name","layout","labelAlign","labelCol","wrapperCol","onFinishFailed","scrollToFirstError","form","className","size"]);const[l]=k(x),{__INTERNAL__:b}=l;b.name=t;const g=E(()=>({name:t,labelAlign:p,labelCol:f,wrapperCol:c,layout:s,itemRef:b.itemRef,size:d}),[t,p,f,c,s,d]);n.useImperativeHandle(r,()=>l);const C=m=>{u==null||u(m);let v={block:"nearest"};i&&m.errorFields.length&&(typeof i=="object"&&(v=i),l.scrollToField(m.errorFields[0].name,v))};return n.createElement(N.Provider,{value:g},n.createElement(H,S(z({ref:r,id:t,form:l,className:P(w,{[`form-${s}`]:!0})},O),{onFinishFailed:C,name:t})))});j.displayName="@kubed/components/Form";export{j as Form,X as FormList,ee as useForm,Y as useWatch};
15
+ `,j=R((e,r)=>{var o=e,{name:t,layout:s="vertical",labelAlign:p="right",labelCol:f={span:4},wrapperCol:c={span:14},onFinishFailed:u,scrollToFirstError:i,form:x,className:w,size:d="sm"}=o,O=D(o,["name","layout","labelAlign","labelCol","wrapperCol","onFinishFailed","scrollToFirstError","form","className","size"]);const[l]=$(x),{__INTERNAL__:b}=l;b.name=t;const g=E(()=>({name:t,labelAlign:p,labelCol:f,wrapperCol:c,layout:s,itemRef:b.itemRef,size:d}),[t,p,f,c,s,d]);n.useImperativeHandle(r,()=>l);const C=m=>{u==null||u(m);let v={block:"nearest"};i&&m.errorFields.length&&(typeof i=="object"&&(v=i),l.scrollToField(m.errorFields[0].name,v))};return n.createElement(N.Provider,{value:g},n.createElement(H,S(z({ref:r,id:t,form:l,className:P(w,{[`form-${s}`]:!0})},O),{onFinishFailed:C,name:t})))});j.displayName="@kubed/components/Form";export{j as Form,X as FormList,ee as useForm,Y as useWatch};
16
16
  //# sourceMappingURL=Form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sources":["../../src/Form/Form.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport cx from 'classnames';\nimport styled from 'styled-components';\nimport FieldForm, { List as FormList, useWatch } from 'rc-field-form';\nimport { FormProps as RcFormProps } from 'rc-field-form/lib/Form';\nimport { Options } from 'scroll-into-view-if-needed';\nimport { ValidateErrorEntity } from 'rc-field-form/lib/interface';\nimport { ColProps } from '../Grid/Col';\nimport { FormContext, FormContextProps } from './context';\nimport { FormLabelAlign } from './types';\nimport forwardRef from '../utils/forwardRef';\nimport { DefaultProps, KubedSizes } from '../theme';\nimport { FormItem } from './FormItem/FormItem';\nimport type { FormItemProps } from './FormItem/FormItem';\nimport useForm, { FormInstance } from './hooks/useForm';\nimport { addColorAlpha } from '../utils/color';\n\nexport { FormList, FormItem, useForm, useWatch };\n\nexport type { FormItemProps, FormInstance };\n\nexport type FormLayout = 'horizontal' | 'inline' | 'vertical';\n\nconst StyledFieldForm = styled(FieldForm)`\n &.form-inline {\n display: flex;\n gap: 12px;\n }\n\n .form-item-status-error {\n .input-wrapper {\n border-color: ${({ theme }) => theme.palette.error};\n &.input-focus {\n box-shadow: 0 4px 8px 0 ${({ theme }) => addColorAlpha(theme.palette.error, 0.2)};\n }\n }\n }\n`;\n\nexport interface FormProps<Values = any> extends Omit<RcFormProps<Values>, 'form'>, DefaultProps {\n name?: string;\n layout?: FormLayout;\n labelAlign?: FormLabelAlign;\n labelCol?: ColProps;\n wrapperCol?: ColProps;\n form?: FormInstance<Values>;\n scrollToFirstError?: Options | boolean;\n size?: KubedSizes;\n}\n\nexport const Form = forwardRef<FormProps, null>(\n (\n {\n name,\n layout = 'vertical',\n labelAlign = 'right',\n labelCol = { span: 4 },\n wrapperCol = { span: 14 },\n onFinishFailed,\n scrollToFirstError,\n form,\n className,\n size = 'sm',\n ...rest\n },\n ref\n ) => {\n const [wrapForm] = useForm(form);\n const { __INTERNAL__ } = wrapForm;\n __INTERNAL__.name = name;\n\n const formContextValue = useMemo<FormContextProps>(\n () => ({\n name,\n labelAlign,\n labelCol,\n wrapperCol,\n layout,\n itemRef: __INTERNAL__.itemRef,\n size,\n }),\n [name, labelAlign, labelCol, wrapperCol, layout, size]\n );\n\n React.useImperativeHandle(ref, () => wrapForm);\n\n const onInternalFinishFailed = (errorInfo: ValidateErrorEntity) => {\n onFinishFailed?.(errorInfo);\n\n let defaultScrollToFirstError: Options = { block: 'nearest' };\n\n if (scrollToFirstError && errorInfo.errorFields.length) {\n if (typeof scrollToFirstError === 'object') {\n defaultScrollToFirstError = scrollToFirstError;\n }\n wrapForm.scrollToField(errorInfo.errorFields[0].name, defaultScrollToFirstError);\n }\n };\n\n return (\n <FormContext.Provider value={formContextValue}>\n <StyledFieldForm\n ref={ref}\n id={name}\n form={wrapForm}\n className={cx(className, { [`form-${layout}`]: true })}\n {...rest}\n onFinishFailed={onInternalFinishFailed}\n name={name}\n />\n </FormContext.Provider>\n );\n }\n);\n\nForm.displayName = '@kubed/components/Form';\n"],"names":["S","T","D","v","N","a","$","O"],"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,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,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,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,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,OAAOA,UAAC,CAAC,aAAa,CAACC,WAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAACD,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAACE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,wBAAwB;;;;"}
1
+ {"version":3,"file":"Form.js","sources":["../../src/Form/Form.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport cx from 'classnames';\nimport styled from 'styled-components';\nimport FieldForm, { List as FormList, useWatch } from 'rc-field-form';\nimport { FormProps as RcFormProps } from 'rc-field-form/lib/Form';\nimport { Options } from 'scroll-into-view-if-needed';\nimport { ValidateErrorEntity } from 'rc-field-form/lib/interface';\nimport { ColProps } from '../Grid/Col';\nimport { FormContext, FormContextProps } from './context';\nimport { FormLabelAlign } from './types';\nimport forwardRef from '../utils/forwardRef';\nimport { DefaultProps, KubedSizes } from '../theme';\nimport { FormItem } from './FormItem/FormItem';\nimport type { FormItemProps } from './FormItem/FormItem';\nimport useForm, { FormInstance } from './hooks/useForm';\nimport { addColorAlpha } from '../utils/color';\n\nexport { FormList, FormItem, useForm, useWatch };\n\nexport type { FormItemProps, FormInstance };\n\nexport type FormLayout = 'horizontal' | 'inline' | 'vertical';\n\nconst StyledFieldForm = styled(FieldForm)`\n &.form-inline {\n display: flex;\n gap: 12px;\n }\n\n .form-item-status-error {\n .input-wrapper {\n border-color: ${({ theme }) => theme.palette.error};\n &.input-focus {\n box-shadow: 0 4px 8px 0 ${({ theme }) => addColorAlpha(theme.palette.error, 0.2)};\n }\n }\n }\n`;\n\nexport interface FormProps<Values = any> extends Omit<RcFormProps<Values>, 'form'>, DefaultProps {\n name?: string;\n layout?: FormLayout;\n labelAlign?: FormLabelAlign;\n labelCol?: ColProps;\n wrapperCol?: ColProps;\n form?: FormInstance<Values>;\n scrollToFirstError?: Options | boolean;\n size?: KubedSizes;\n}\n\nexport const Form = forwardRef<FormProps, null>(\n (\n {\n name,\n layout = 'vertical',\n labelAlign = 'right',\n labelCol = { span: 4 },\n wrapperCol = { span: 14 },\n onFinishFailed,\n scrollToFirstError,\n form,\n className,\n size = 'sm',\n ...rest\n },\n ref\n ) => {\n const [wrapForm] = useForm(form);\n const { __INTERNAL__ } = wrapForm;\n __INTERNAL__.name = name;\n\n const formContextValue = useMemo<FormContextProps>(\n () => ({\n name,\n labelAlign,\n labelCol,\n wrapperCol,\n layout,\n itemRef: __INTERNAL__.itemRef,\n size,\n }),\n [name, labelAlign, labelCol, wrapperCol, layout, size]\n );\n\n React.useImperativeHandle(ref, () => wrapForm);\n\n const onInternalFinishFailed = (errorInfo: ValidateErrorEntity) => {\n onFinishFailed?.(errorInfo);\n\n let defaultScrollToFirstError: Options = { block: 'nearest' };\n\n if (scrollToFirstError && errorInfo.errorFields.length) {\n if (typeof scrollToFirstError === 'object') {\n defaultScrollToFirstError = scrollToFirstError;\n }\n wrapForm.scrollToField(errorInfo.errorFields[0].name, defaultScrollToFirstError);\n }\n };\n\n return (\n <FormContext.Provider value={formContextValue}>\n <StyledFieldForm\n ref={ref}\n id={name}\n form={wrapForm}\n className={cx(className, { [`form-${layout}`]: true })}\n {...rest}\n onFinishFailed={onInternalFinishFailed}\n name={name}\n />\n </FormContext.Provider>\n );\n }\n);\n\nForm.displayName = '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OA,UAAC,CAAC,aAAa,CAACC,WAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAACD,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAACE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,wBAAwB;;;;"}
@@ -1,6 +1,6 @@
1
- import o from"react";import{Field as _}from"rc-field-form";import m from"styled-components";import O from"classnames";import{Question as D}from"@kubed/icons";import{Row as K}from"../../Grid/Row.js";import{Tooltip as M}from"../../Tooltip/Tooltip.js";import Q from"../../utils/forwardRef.js";import{FormContext as U}from"../context.js";import{ErrorList as C}from"./ErrorList.js";import{Col as N}from"../../Grid/Col.js";var V=Object.defineProperty,X=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable,z=(e,r,t)=>r in e?V(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,f=(e,r)=>{for(var t in r||(r={}))R.call(r,t)&&z(e,t,r[t]);if(p)for(var t of p(r))$.call(r,t)&&z(e,t,r[t]);return e},Z=(e,r)=>X(e,Y(r)),B=(e,r)=>{var t={};for(var l in e)R.call(e,l)&&r.indexOf(l)<0&&(t[l]=e[l]);if(e!=null&&p)for(var l of p(e))r.indexOf(l)<0&&$.call(e,l)&&(t[l]=e[l]);return t};const H=m(K)`
1
+ import o from"react";import{Field as _}from"rc-field-form";import m from"styled-components";import O from"classnames";import{Question as D}from"@kubed/icons";import{Row as K}from"../../Grid/Row.js";import{Tooltip as M}from"../../Tooltip/Tooltip.js";import Q from"../../utils/forwardRef.js";import{FormContext as U}from"../context.js";import{ErrorList as $}from"./ErrorList.js";import{Col as C}from"../../Grid/Col.js";var V=Object.defineProperty,X=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,z=(e,r,t)=>r in e?V(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,f=(e,r)=>{for(var t in r||(r={}))N.call(r,t)&&z(e,t,r[t]);if(p)for(var t of p(r))R.call(r,t)&&z(e,t,r[t]);return e},Z=(e,r)=>X(e,Y(r)),B=(e,r)=>{var t={};for(var l in e)N.call(e,l)&&r.indexOf(l)<0&&(t[l]=e[l]);if(e!=null&&p)for(var l of p(e))r.indexOf(l)<0&&R.call(e,l)&&(t[l]=e[l]);return t};const H=m(K)`
2
2
  margin-bottom: 5px;
3
- `,J=m(N)`
3
+ `,J=m(C)`
4
4
  text-align: ${({labelAlign:e})=>e||"right"};
5
5
  overflow: hidden;
6
6
  white-space: nowrap;
@@ -28,5 +28,5 @@ import o from"react";import{Field as _}from"rc-field-form";import m from"styled-
28
28
  flex-direction: column;
29
29
  flex-grow: 1;
30
30
  margin-bottom: 12px;
31
- `,ee=m("div")``,re=m("div")``,P=Q((e,r)=>{var t=e,{name:l,label:c,formItemLayout:q,help:b,tooltip:g,rules:u,validateStatus:y,children:d}=t,F=B(t,["name","label","formItemLayout","help","tooltip","rules","validateStatus","children"]);const L=o.useContext(U),{labelCol:A,wrapperCol:S,labelAlign:T,layout:v,size:k}=L,G=i=>{var a;let n="";return y!==void 0?n=y:(i==null?void 0:i.validating)?n="validating":((a=i==null?void 0:i.errors)==null?void 0:a.length)?n="error":(i==null?void 0:i.touched)&&(n="success"),n};return o.createElement(_,f({name:l,rules:u},F),(i,a,n)=>{const h=typeof d=="function"?d(i,a,n):o.cloneElement(d,Z(f({},i),{size:k})),w=G(a),E=w&&`form-item-status-${w}`,x=!!(u&&u.some(s=>{if(s&&typeof s=="object"&&s.required)return!0;if(typeof s=="function"){const j=s(n);return j&&j.required}return!1}));return q==="horizontal"||v==="horizontal"?o.createElement(H,{columns:24,className:O(E,"form-item-wrapper")},c&&o.createElement(J,f({className:"label-col",labelAlign:T},A),o.createElement(I,{isRequired:x,layout:v},c)),o.createElement(N,f({},S),o.createElement("div",{className:"form-item"},h),o.createElement(C,{errors:a.errors,warnings:a.warnings,help:b}))):o.createElement(W,{className:O(E,"form-item-wrapper")},c&&o.createElement(ee,null,o.createElement(I,{isRequired:x,layout:v},c,g&&o.createElement(M,{content:g},o.createElement(D,{size:16})))),o.createElement(re,null,o.createElement("div",{className:"form-item"},h),o.createElement(C,{errors:a.errors,warnings:a.warnings,help:b})))})});P.displayName="@kubed/components/FormItem";export{P as FormItem};
31
+ `,ee=m("div")``,re=m("div")``,P=Q((e,r)=>{var t=e,{name:l,label:c,formItemLayout:q,help:b,tooltip:g,rules:u,validateStatus:y,children:d}=t,F=B(t,["name","label","formItemLayout","help","tooltip","rules","validateStatus","children"]);const L=o.useContext(U),{labelCol:A,wrapperCol:S,labelAlign:T,layout:v,size:k}=L,G=i=>{var a;let n="";return y!==void 0?n=y:(i==null?void 0:i.validating)?n="validating":((a=i==null?void 0:i.errors)==null?void 0:a.length)?n="error":(i==null?void 0:i.touched)&&(n="success"),n};return o.createElement(_,f({name:l,rules:u},F),(i,a,n)=>{const h=typeof d=="function"?d(i,a,n):o.cloneElement(d,Z(f({},i),{size:k})),w=G(a),E=w&&`form-item-status-${w}`,x=!!(u&&u.some(s=>{if(s&&typeof s=="object"&&s.required)return!0;if(typeof s=="function"){const j=s(n);return j&&j.required}return!1}));return q==="horizontal"||v==="horizontal"?o.createElement(H,{columns:24,className:O(E,"form-item-wrapper")},c&&o.createElement(J,f({className:"label-col",labelAlign:T},A),o.createElement(I,{isRequired:x,layout:v},c)),o.createElement(C,f({},S),o.createElement("div",{className:"form-item"},h),o.createElement($,{errors:a.errors,warnings:a.warnings,help:b}))):o.createElement(W,{className:O(E,"form-item-wrapper")},c&&o.createElement(ee,null,o.createElement(I,{isRequired:x,layout:v},c,g&&o.createElement(M,{content:g},o.createElement(D,{size:16})))),o.createElement(re,null,o.createElement("div",{className:"form-item"},h),o.createElement($,{errors:a.errors,warnings:a.warnings,help:b})))})});P.displayName="@kubed/components/FormItem";export{P as FormItem};
32
32
  //# sourceMappingURL=FormItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormItem.js","sources":["../../../src/Form/FormItem/FormItem.tsx"],"sourcesContent":["import React from 'react';\nimport { Field } from 'rc-field-form';\nimport { FieldProps } from 'rc-field-form/lib/Field';\nimport styled from 'styled-components';\nimport cx from 'classnames';\nimport { Meta } from 'rc-field-form/lib/interface';\nimport { Question } from '@kubed/icons';\nimport { Row, Col, ColProps } from '../../Grid/Row';\nimport { Tooltip } from '../../Tooltip/Tooltip';\nimport forwardRef from '../../utils/forwardRef';\nimport { FormContext } from '../context';\nimport { ErrorList } from './ErrorList';\n\nconst FieldRow = styled(Row)`\n margin-bottom: 5px;\n`;\n\nexport type ValidateStatus = 'success' | 'warning' | 'error' | 'validating' | '';\n\ninterface FieldColProps extends ColProps {\n labelAlign?: string;\n}\n\nconst FieldCol = styled(Col)<FieldColProps>`\n text-align: ${({ labelAlign }) => labelAlign || 'right'};\n overflow: hidden;\n white-space: nowrap;\n vertical-align: middle;\n`;\n\ninterface FieldLabelProps {\n isRequired?: boolean;\n layout?: string;\n}\n\nconst FieldLabel = styled('label')<FieldLabelProps>`\n position: relative;\n height: 32px;\n display: inline-flex;\n align-items: center;\n color: ${({ theme }) => theme.palette.accents_8};\n &:after {\n color: ${({ theme }) => theme.palette.error};\n }\n ${({ isRequired }) => `\n ${\n isRequired\n ? `\n &:after {\n font-weight: 400;\n content: '*';\n margin-left: 3px;\n }\n `\n : null\n };\n `}\n`;\n\nconst FieldWrapper = styled('div')`\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n margin-bottom: 12px;\n`;\n\nconst FieldLabelWrapper = styled('div')``;\n\nconst FieldItemWrapper = styled('div')``;\n\nexport interface FormItemProps extends FieldProps {\n /** Label element of FormItem */\n label?: React.ReactNode;\n\n /** Help content of FormItem */\n help?: React.ReactNode;\n\n /** Tooltip content of FormItem */\n tooltip?: React.ReactNode;\n\n /** The validation status. If not provided, it will be generated by validation rule. options: success warning error validating */\n validateStatus?: ValidateStatus;\n\n formItemLayout?: 'horizontal' | 'inline' | 'vertical';\n}\n\nexport const FormItem = forwardRef<FormItemProps, 'div'>(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n (\n { name, label, formItemLayout, help, tooltip, rules, validateStatus, children, ...rest },\n ref\n ) => {\n const formContext = React.useContext(FormContext);\n const { labelCol, wrapperCol, labelAlign, layout, size } = formContext;\n\n const getStatus = (meta?: Meta) => {\n let mergedValidateStatus: ValidateStatus = '';\n if (validateStatus !== undefined) {\n mergedValidateStatus = validateStatus;\n } else if (meta?.validating) {\n mergedValidateStatus = 'validating';\n } else if (meta?.errors?.length) {\n mergedValidateStatus = 'error';\n } else if (meta?.touched) {\n mergedValidateStatus = 'success';\n }\n\n return mergedValidateStatus;\n };\n\n return (\n <Field name={name} rules={rules} {...rest}>\n {(control, meta, form) => {\n const childNode =\n typeof children === 'function'\n ? children(control, meta, form)\n : React.cloneElement(children as React.ReactElement, { ...control, size });\n\n const formItemStatus = getStatus(meta);\n const wrapperClassName = formItemStatus && `form-item-status-${formItemStatus}`;\n\n const isRequired = !!(\n rules &&\n rules.some((rule) => {\n if (rule && typeof rule === 'object' && rule.required) {\n return true;\n }\n if (typeof rule === 'function') {\n const ruleEntity = rule(form);\n return ruleEntity && ruleEntity.required;\n }\n return false;\n })\n );\n\n if (formItemLayout === 'horizontal' || layout === 'horizontal') {\n return (\n <FieldRow columns={24} className={cx(wrapperClassName, 'form-item-wrapper')}>\n {label && (\n <FieldCol className=\"label-col\" labelAlign={labelAlign} {...labelCol}>\n <FieldLabel isRequired={isRequired} layout={layout}>\n {label}\n </FieldLabel>\n </FieldCol>\n )}\n <Col {...wrapperCol}>\n <div className=\"form-item\">{childNode}</div>\n <ErrorList errors={meta.errors} warnings={meta.warnings} help={help} />\n </Col>\n </FieldRow>\n );\n }\n\n return (\n <FieldWrapper className={cx(wrapperClassName, 'form-item-wrapper')}>\n {label && (\n <FieldLabelWrapper>\n <FieldLabel isRequired={isRequired} layout={layout}>\n {label}\n {tooltip && (\n <Tooltip content={tooltip}>\n <Question size={16} />\n </Tooltip>\n )}\n </FieldLabel>\n </FieldLabelWrapper>\n )}\n <FieldItemWrapper>\n <div className=\"form-item\">{childNode}</div>\n <ErrorList errors={meta.errors} warnings={meta.warnings} help={help} />\n </FieldItemWrapper>\n </FieldWrapper>\n );\n }}\n </Field>\n );\n }\n);\n\nFormItem.displayName = '@kubed/components/FormItem';\n"],"names":["n","B","S","H","o","J","Q","q","W","D","_"],"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,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,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CAAC,SAAS,CAACG,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAEH,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAACA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEA,UAAC,CAAC,aAAa,CAACK,OAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAACL,UAAC,CAAC,aAAa,CAACM,QAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAACN,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAACA,UAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAACA,UAAC,CAAC,aAAa,CAACI,SAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,4BAA4B;;;;"}
1
+ {"version":3,"file":"FormItem.js","sources":["../../../src/Form/FormItem/FormItem.tsx"],"sourcesContent":["import React from 'react';\nimport { Field } from 'rc-field-form';\nimport { FieldProps } from 'rc-field-form/lib/Field';\nimport styled from 'styled-components';\nimport cx from 'classnames';\nimport { Meta } from 'rc-field-form/lib/interface';\nimport { Question } from '@kubed/icons';\nimport { Row, Col, ColProps } from '../../Grid/Row';\nimport { Tooltip } from '../../Tooltip/Tooltip';\nimport forwardRef from '../../utils/forwardRef';\nimport { FormContext } from '../context';\nimport { ErrorList } from './ErrorList';\n\nconst FieldRow = styled(Row)`\n margin-bottom: 5px;\n`;\n\nexport type ValidateStatus = 'success' | 'warning' | 'error' | 'validating' | '';\n\ninterface FieldColProps extends ColProps {\n labelAlign?: string;\n}\n\nconst FieldCol = styled(Col)<FieldColProps>`\n text-align: ${({ labelAlign }) => labelAlign || 'right'};\n overflow: hidden;\n white-space: nowrap;\n vertical-align: middle;\n`;\n\ninterface FieldLabelProps {\n isRequired?: boolean;\n layout?: string;\n}\n\nconst FieldLabel = styled('label')<FieldLabelProps>`\n position: relative;\n height: 32px;\n display: inline-flex;\n align-items: center;\n color: ${({ theme }) => theme.palette.accents_8};\n &:after {\n color: ${({ theme }) => theme.palette.error};\n }\n ${({ isRequired }) => `\n ${\n isRequired\n ? `\n &:after {\n font-weight: 400;\n content: '*';\n margin-left: 3px;\n }\n `\n : null\n };\n `}\n`;\n\nconst FieldWrapper = styled('div')`\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n margin-bottom: 12px;\n`;\n\nconst FieldLabelWrapper = styled('div')``;\n\nconst FieldItemWrapper = styled('div')``;\n\nexport interface FormItemProps extends FieldProps {\n /** Label element of FormItem */\n label?: React.ReactNode;\n\n /** Help content of FormItem */\n help?: React.ReactNode;\n\n /** Tooltip content of FormItem */\n tooltip?: React.ReactNode;\n\n /** The validation status. If not provided, it will be generated by validation rule. options: success warning error validating */\n validateStatus?: ValidateStatus;\n\n formItemLayout?: 'horizontal' | 'inline' | 'vertical';\n}\n\nexport const FormItem = forwardRef<FormItemProps, 'div'>(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n (\n { name, label, formItemLayout, help, tooltip, rules, validateStatus, children, ...rest },\n ref\n ) => {\n const formContext = React.useContext(FormContext);\n const { labelCol, wrapperCol, labelAlign, layout, size } = formContext;\n\n const getStatus = (meta?: Meta) => {\n let mergedValidateStatus: ValidateStatus = '';\n if (validateStatus !== undefined) {\n mergedValidateStatus = validateStatus;\n } else if (meta?.validating) {\n mergedValidateStatus = 'validating';\n } else if (meta?.errors?.length) {\n mergedValidateStatus = 'error';\n } else if (meta?.touched) {\n mergedValidateStatus = 'success';\n }\n\n return mergedValidateStatus;\n };\n\n return (\n <Field name={name} rules={rules} {...rest}>\n {(control, meta, form) => {\n const childNode =\n typeof children === 'function'\n ? children(control, meta, form)\n : React.cloneElement(children as React.ReactElement, { ...control, size });\n\n const formItemStatus = getStatus(meta);\n const wrapperClassName = formItemStatus && `form-item-status-${formItemStatus}`;\n\n const isRequired = !!(\n rules &&\n rules.some((rule) => {\n if (rule && typeof rule === 'object' && rule.required) {\n return true;\n }\n if (typeof rule === 'function') {\n const ruleEntity = rule(form);\n return ruleEntity && ruleEntity.required;\n }\n return false;\n })\n );\n\n if (formItemLayout === 'horizontal' || layout === 'horizontal') {\n return (\n <FieldRow columns={24} className={cx(wrapperClassName, 'form-item-wrapper')}>\n {label && (\n <FieldCol className=\"label-col\" labelAlign={labelAlign} {...labelCol}>\n <FieldLabel isRequired={isRequired} layout={layout}>\n {label}\n </FieldLabel>\n </FieldCol>\n )}\n <Col {...wrapperCol}>\n <div className=\"form-item\">{childNode}</div>\n <ErrorList errors={meta.errors} warnings={meta.warnings} help={help} />\n </Col>\n </FieldRow>\n );\n }\n\n return (\n <FieldWrapper className={cx(wrapperClassName, 'form-item-wrapper')}>\n {label && (\n <FieldLabelWrapper>\n <FieldLabel isRequired={isRequired} layout={layout}>\n {label}\n {tooltip && (\n <Tooltip content={tooltip}>\n <Question size={16} />\n </Tooltip>\n )}\n </FieldLabel>\n </FieldLabelWrapper>\n )}\n <FieldItemWrapper>\n <div className=\"form-item\">{childNode}</div>\n <ErrorList errors={meta.errors} warnings={meta.warnings} help={help} />\n </FieldItemWrapper>\n </FieldWrapper>\n );\n }}\n </Field>\n );\n }\n);\n\nFormItem.displayName = '@kubed/components/FormItem';\n"],"names":["n","B","S","H","o","J","Q","q","W","D","_"],"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,MAAM,CA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GED
@@ -1,7 +1,7 @@
1
- import h from"react";import w from"styled-components";import{useTheme as z}from"../theme/ThemeContext.js";import f from"../theme/utils.js";var S=Object.defineProperty,l=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,p=(e,t,r)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,V=(e,t)=>{for(var r in t||(t={}))m.call(t,r)&&p(e,r,t[r]);if(l)for(var r of l(t))s.call(t,r)&&p(e,r,t[r]);return e},C=(e,t)=>{var r={};for(var o in e)m.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&l)for(var o of l(e))t.indexOf(o)<0&&s.call(e,o)&&(r[o]=e[o]);return r};const P=w("div")`
1
+ import h from"react";import w from"styled-components";import{useTheme as z}from"../theme/ThemeContext.js";import f from"../theme/utils.js";var S=Object.defineProperty,l=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,p=(t,e,r)=>e in t?S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,V=(t,e)=>{for(var r in e||(e={}))m.call(e,r)&&p(t,r,e[r]);if(l)for(var r of l(e))s.call(e,r)&&p(t,r,e[r]);return t},C=(t,e)=>{var r={};for(var o in t)m.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&l)for(var o of l(t))e.indexOf(o)<0&&s.call(t,o)&&(r[o]=t[o]);return r};const P=w("div")`
2
2
  box-sizing: border-box;
3
- flex: ${e=>e.flex};
4
- margin: ${e=>e.margin};
5
- margin-left: ${e=>e.marginLeft||null};
6
- `;function u(e){return typeof e=="number"&&e>0&&e%1==0}function g(e,t){const[r,o]=e;if(o){const i=f.getSizeValue(r,t.layout.spacing),a=f.getSizeValue(o,t.layout.spacing);return[i,a]}const n=f.getSizeValue(r,t.layout.spacing);return[n,n]}function b(e){var t=e,{span:r,gutter:o,offset:n=0,grow:i,columns:a}=t,y=C(t,["span","gutter","offset","grow","columns"]);if(!u(r)||r>a)return null;const v=z(),[$,c]=g(o,v),d=`${i?"1":"0"} 0 calc(${100/(a/r)}% - ${c})`,x=`calc(${$} / 2) calc(${c} / 2)`,O=`calc(${c} / 2)`,j=u(n)?`calc(${100/(a/n)}% + ${O})`:null;return h.createElement(P,V({flex:d,margin:x,marginLeft:j},y))}b.displayName="@kubed/components/Col";export{b as Col,g as getGutter,u as isValidSpan};
3
+ flex: ${t=>t.flex};
4
+ margin: ${t=>t.margin};
5
+ margin-left: ${t=>t.marginLeft||null};
6
+ `;function u(t){return typeof t=="number"&&t>0&&t%1==0}function g(t,e){const[r,o]=t;if(o){const i=f.getSizeValue(r,e.layout.spacing),a=f.getSizeValue(o,e.layout.spacing);return[i,a]}const n=f.getSizeValue(r,e.layout.spacing);return[n,n]}function b(t){var e=t,{span:r,gutter:o,offset:n=0,grow:i,columns:a}=e,y=C(e,["span","gutter","offset","grow","columns"]);if(!u(r)||r>a)return null;const v=z(),[$,c]=g(o,v),d=`${i?"1":"0"} 0 calc(${100/(a/r)}% - ${c})`,x=`calc(${$} / 2) calc(${c} / 2)`,O=`calc(${c} / 2)`,j=u(n)?`calc(${100/(a/n)}% + ${O})`:null;return h.createElement(P,V({flex:d,margin:x,marginLeft:j},y))}b.displayName="@kubed/components/Col";export{b as Col,g as getGutter,u as isValidSpan};
7
7
  //# sourceMappingURL=Col.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Col.js","sources":["../../src/Grid/Col.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { KubedNumberSize, useTheme, themeUtils } from '../theme';\n\ninterface ColDivProps {\n flex: string;\n margin: string;\n marginLeft: string;\n}\n\nexport type GutterType = [KubedNumberSize, KubedNumberSize?];\n\nconst ColDiv = styled('div')<ColDivProps>`\n box-sizing: border-box;\n flex: ${(props) => props.flex};\n margin: ${(props) => props.margin};\n margin-left: ${(props) => props.marginLeft || null};\n`;\n\nexport interface ColProps extends React.ComponentPropsWithoutRef<'div'> {\n span: number;\n columns?: number;\n offset?: number;\n gutter?: GutterType;\n grow?: boolean;\n children?: React.ReactNode;\n}\n\nexport function isValidSpan(span: number) {\n return typeof span === 'number' && span > 0 && span % 1 === 0;\n}\n\nexport function getGutter(gutter: GutterType, theme) {\n const [gutterV, gutterH] = gutter;\n if (gutterH) {\n const spacingV = themeUtils.getSizeValue(gutterV, theme.layout.spacing);\n const spacingH = themeUtils.getSizeValue(gutterH, theme.layout.spacing);\n return [spacingV, spacingH];\n }\n\n const spacing = themeUtils.getSizeValue(gutterV, theme.layout.spacing);\n return [spacing, spacing];\n}\n\nexport function Col({ span, gutter, offset = 0, grow, columns, ...others }: ColProps) {\n if (!isValidSpan(span) || span > columns) {\n return null;\n }\n\n const theme = useTheme();\n const [spacingV, spacingH] = getGutter(gutter, theme);\n\n const flex = `${grow ? '1' : '0'} 0 calc(${100 / (columns / span)}% - ${spacingH})`;\n const margin = `calc(${spacingV} / 2) calc(${spacingH} / 2)`;\n const marginV = `calc(${spacingH} / 2)`;\n const marginLeft = isValidSpan(offset) ? `calc(${100 / (columns / offset)}% + ${marginV})` : null;\n\n return <ColDiv flex={flex} margin={margin} marginLeft={marginLeft} {...others} />;\n}\n\nCol.displayName = '@kubed/components/Col';\n"],"names":["v","u","N","S"],"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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,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAOC,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,uBAAuB;;;;"}
1
+ {"version":3,"file":"Col.js","sources":["../../src/Grid/Col.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { KubedNumberSize, useTheme, themeUtils } from '../theme';\n\ninterface ColDivProps {\n flex: string;\n margin: string;\n marginLeft: string;\n}\n\nexport type GutterType = [KubedNumberSize, KubedNumberSize?];\n\nconst ColDiv = styled('div')<ColDivProps>`\n box-sizing: border-box;\n flex: ${(props) => props.flex};\n margin: ${(props) => props.margin};\n margin-left: ${(props) => props.marginLeft || null};\n`;\n\nexport interface ColProps extends React.ComponentPropsWithoutRef<'div'> {\n span: number;\n columns?: number;\n offset?: number;\n gutter?: GutterType;\n grow?: boolean;\n children?: React.ReactNode;\n}\n\nexport function isValidSpan(span: number) {\n return typeof span === 'number' && span > 0 && span % 1 === 0;\n}\n\nexport function getGutter(gutter: GutterType, theme) {\n const [gutterV, gutterH] = gutter;\n if (gutterH) {\n const spacingV = themeUtils.getSizeValue(gutterV, theme.layout.spacing);\n const spacingH = themeUtils.getSizeValue(gutterH, theme.layout.spacing);\n return [spacingV, spacingH];\n }\n\n const spacing = themeUtils.getSizeValue(gutterV, theme.layout.spacing);\n return [spacing, spacing];\n}\n\nexport function Col({ span, gutter, offset = 0, grow, columns, ...others }: ColProps) {\n if (!isValidSpan(span) || span > columns) {\n return null;\n }\n\n const theme = useTheme();\n const [spacingV, spacingH] = getGutter(gutter, theme);\n\n const flex = `${grow ? '1' : '0'} 0 calc(${100 / (columns / span)}% - ${spacingH})`;\n const margin = `calc(${spacingV} / 2) calc(${spacingH} / 2)`;\n const marginV = `calc(${spacingH} / 2)`;\n const marginLeft = isValidSpan(offset) ? `calc(${100 / (columns / offset)}% + ${marginV})` : null;\n\n return <ColDiv flex={flex} margin={margin} marginLeft={marginLeft} {...others} />;\n}\n\nCol.displayName = '@kubed/components/Col';\n"],"names":["v","e","u","N","S"],"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,I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AAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAOC,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,uBAAuB;;;;"}
package/esm/Grid/Row.js CHANGED
@@ -1,12 +1,12 @@
1
- import u,{Children as w}from"react";import h,{css as s}from"styled-components";import c from"../theme/utils.js";var O=Object.defineProperty,n=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,g=(r,e,t)=>e in r?O(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$=(r,e)=>{for(var t in e||(e={}))f.call(e,t)&&g(r,t,e[t]);if(n)for(var t of n(e))m.call(e,t)&&g(r,t,e[t]);return r},x=(r,e)=>{var t={};for(var a in r)f.call(r,a)&&e.indexOf(a)<0&&(t[a]=r[a]);if(r!=null&&n)for(var a of n(r))e.indexOf(a)<0&&m.call(r,a)&&(t[a]=r[a]);return t};const P=(r,e)=>{const[t,a]=r;if(a){const l=c.getSizeValue(t,e.layout.spacing)/-2,i=c.getSizeValue(a,e.layout.spacing)/-2;return s`
1
+ import u,{Children as w}from"react";import h,{css as s}from"styled-components";import c from"../theme/utils.js";var O=Object.defineProperty,n=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,g=(r,e,t)=>e in r?O(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,x=(r,e)=>{for(var t in e||(e={}))f.call(e,t)&&g(r,t,e[t]);if(n)for(var t of n(e))m.call(e,t)&&g(r,t,e[t]);return r},P=(r,e)=>{var t={};for(var a in r)f.call(r,a)&&e.indexOf(a)<0&&(t[a]=r[a]);if(r!=null&&n)for(var a of n(r))e.indexOf(a)<0&&m.call(r,a)&&(t[a]=r[a]);return t};const S=(r,e)=>{const[t,a]=r;if(a){const l=c.getSizeValue(t,e.layout.spacing)/-2,i=c.getSizeValue(a,e.layout.spacing)/-2;return s`
2
2
  margin: calc(${l}) calc(${i});
3
3
  `}const o=c.getSizeValue(a,e.layout.spacing)/-2;return s`
4
4
  margin: calc(${o});
5
- `},S=h("div")`
5
+ `},$=h("div")`
6
6
  display: flex;
7
7
  flex-wrap: wrap;
8
8
  justify-content: ${r=>r.justify};
9
9
  align-items: ${r=>r.align};
10
- ${({gutter:r,theme:e})=>P(r,e)};
11
- `;function p(r){var e=r,{gutter:t=["md"],children:a,grow:o=!1,justify:l="flex-start",align:i="stretch",columns:y=12}=e,d=x(e,["gutter","children","grow","justify","align","columns"]);const v=w.toArray(a).map((j,b)=>u.cloneElement(j,{gutter:t,grow:o,columns:y,key:b}));return u.createElement(S,$({gutter:t,align:i,justify:l},d),v)}p.displayName="@kubed/components/Row";export{p as Row};
10
+ ${({gutter:r,theme:e})=>S(r,e)};
11
+ `;function p(r){var e=r,{gutter:t=["md"],children:a,grow:o=!1,justify:l="flex-start",align:i="stretch",columns:y=12}=e,d=P(e,["gutter","children","grow","justify","align","columns"]);const v=w.toArray(a).map((j,b)=>u.cloneElement(j,{gutter:t,grow:o,columns:y,key:b}));return u.createElement($,x({gutter:t,align:i,justify:l},d),v)}p.displayName="@kubed/components/Row";export{p as Row};
12
12
  //# sourceMappingURL=Row.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Row.js","sources":["../../src/Grid/Row.tsx"],"sourcesContent":["import React, { Children, ComponentPropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\nimport { Col, ColProps, GutterType } from './Col';\nimport { themeUtils } from '../theme';\n\nexport { Col };\nexport type { ColProps };\n\nconst getGutter = (gutter: GutterType, theme) => {\n const [gutterVertical, gutterHorizontal] = gutter;\n if (gutterHorizontal) {\n const marginV = themeUtils.getSizeValue(gutterVertical, theme.layout.spacing) / -2;\n const marginH = themeUtils.getSizeValue(gutterHorizontal, theme.layout.spacing) / -2;\n return css`\n margin: calc(${marginV}) calc(${marginH});\n `;\n }\n const margin = themeUtils.getSizeValue(gutterHorizontal, theme.layout.spacing) / -2;\n return css`\n margin: calc(${margin});\n `;\n};\n\nconst RowElement = styled('div')<RowProps>`\n display: flex;\n flex-wrap: wrap;\n justify-content: ${(props) => props.justify};\n align-items: ${(props) => props.align};\n ${({ gutter, theme }) => getGutter(gutter, theme)};\n`;\n\nexport interface RowProps extends ComponentPropsWithoutRef<'div'> {\n /** <Col /> components only */\n children: React.ReactNode;\n\n /** Spacing between columns predefined value from theme.spacing or number for gutter in px */\n gutter?: GutterType;\n\n /** Should columns in the last row take 100% of grid width */\n grow?: boolean;\n\n /** Set grid justify-content property */\n justify?: React.CSSProperties['justifyContent'];\n\n /** Set grid align-content property */\n align?: React.CSSProperties['alignContent'];\n\n /** Amount of columns in each row */\n columns?: number;\n}\n\nexport function Row({\n gutter = ['md'],\n children,\n grow = false,\n justify = 'flex-start',\n align = 'stretch',\n columns = 12,\n ...others\n}: RowProps) {\n const cols = (Children.toArray(children) as React.ReactElement[]).map((col, index) =>\n React.cloneElement(col, { gutter, grow, columns, key: index })\n );\n\n return (\n <RowElement gutter={gutter} align={align} justify={justify} {...others}>\n {cols}\n </RowElement>\n );\n}\n\nRow.displayName = '@kubed/components/Row';\n"],"names":["l","R","S","x","y"],"mappings":";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,CAAC,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC,CAAQ,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAACC,QAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGC,UAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAOA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,uBAAuB;;;;"}
1
+ {"version":3,"file":"Row.js","sources":["../../src/Grid/Row.tsx"],"sourcesContent":["import React, { Children, ComponentPropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\nimport { Col, ColProps, GutterType } from './Col';\nimport { themeUtils } from '../theme';\n\nexport { Col };\nexport type { ColProps };\n\nconst getGutter = (gutter: GutterType, theme) => {\n const [gutterVertical, gutterHorizontal] = gutter;\n if (gutterHorizontal) {\n const marginV = themeUtils.getSizeValue(gutterVertical, theme.layout.spacing) / -2;\n const marginH = themeUtils.getSizeValue(gutterHorizontal, theme.layout.spacing) / -2;\n return css`\n margin: calc(${marginV}) calc(${marginH});\n `;\n }\n const margin = themeUtils.getSizeValue(gutterHorizontal, theme.layout.spacing) / -2;\n return css`\n margin: calc(${margin});\n `;\n};\n\nconst RowElement = styled('div')<RowProps>`\n display: flex;\n flex-wrap: wrap;\n justify-content: ${(props) => props.justify};\n align-items: ${(props) => props.align};\n ${({ gutter, theme }) => getGutter(gutter, theme)};\n`;\n\nexport interface RowProps extends ComponentPropsWithoutRef<'div'> {\n /** <Col /> components only */\n children: React.ReactNode;\n\n /** Spacing between columns predefined value from theme.spacing or number for gutter in px */\n gutter?: GutterType;\n\n /** Should columns in the last row take 100% of grid width */\n grow?: boolean;\n\n /** Set grid justify-content property */\n justify?: React.CSSProperties['justifyContent'];\n\n /** Set grid align-content property */\n align?: React.CSSProperties['alignContent'];\n\n /** Amount of columns in each row */\n columns?: number;\n}\n\nexport function Row({\n gutter = ['md'],\n children,\n grow = false,\n justify = 'flex-start',\n align = 'stretch',\n columns = 12,\n ...others\n}: RowProps) {\n const cols = (Children.toArray(children) as React.ReactElement[]).map((col, index) =>\n React.cloneElement(col, { gutter, grow, columns, key: index })\n );\n\n return (\n <RowElement gutter={gutter} align={align} justify={justify} {...others}>\n {cols}\n </RowElement>\n );\n}\n\nRow.displayName = '@kubed/components/Row';\n"],"names":["e","l","R","S","x","y"],"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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S,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAACC,QAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGC,UAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAOA,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,uBAAuB;;;;"}
@@ -1,11 +1,11 @@
1
- import b,{Children as h,cloneElement as $}from"react";import x,{css as t}from"styled-components";import O from"classnames";import j from"../theme/utils.js";var W=Object.defineProperty,a=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,s=(e,r,o)=>r in e?W(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,N=(e,r)=>{for(var o in r||(r={}))p.call(r,o)&&s(e,o,r[o]);if(a)for(var o of a(r))c.call(r,o)&&s(e,o,r[o]);return e},P=(e,r)=>{var o={};for(var n in e)p.call(e,n)&&r.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&a)for(var n of a(e))r.indexOf(n)<0&&c.call(e,n)&&(o[n]=e[n]);return o};const{getSizeValue:E}=j,f={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"},G=(e,r,o)=>e==="row"?t`
1
+ import b,{Children as h,cloneElement as x}from"react";import $,{css as t}from"styled-components";import O from"classnames";import j from"../theme/utils.js";var W=Object.defineProperty,a=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,s=(e,r,o)=>r in e?W(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,N=(e,r)=>{for(var o in r||(r={}))p.call(r,o)&&s(e,o,r[o]);if(a)for(var o of a(r))c.call(r,o)&&s(e,o,r[o]);return e},P=(e,r)=>{var o={};for(var n in e)p.call(e,n)&&r.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&a)for(var n of a(e))r.indexOf(n)<0&&c.call(e,n)&&(o[n]=e[n]);return o};const{getSizeValue:E}=j,f={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"},G=(e,r,o)=>e==="row"?t`
2
2
  align-items: center;
3
3
  justify-content: ${f[r]};
4
4
  `:t`
5
5
  align-items: ${o?"stretch":f[r]};
6
6
  `,S=(e,r)=>t`
7
7
  flex-grow: ${r?1:0};
8
- `,_=x("div")`
8
+ `,_=$("div")`
9
9
  display: flex;
10
10
  flex-flow: ${({direction:e,noWrap:r})=>`${e} ${r?"nowrap":"wrap"}`};
11
11
  ${({direction:e,position:r,grow:o})=>G(e,r,o)};
@@ -14,5 +14,5 @@ import b,{Children as h,cloneElement as $}from"react";import x,{css as t}from"st
14
14
  .group-child {
15
15
  ${({spacing:e,grow:r})=>S(e,r)};
16
16
  }
17
- `;function m(e){var r=e,{children:o,position:n="left",grow:d=!1,noWrap:g=!1,spacing:u="md",direction:v="row"}=r,w=P(r,["children","position","grow","noWrap","spacing","direction"]);const y=h.toArray(o).map(i=>{var l;return $(i,{className:O("group-child",(l=i.props)==null?void 0:l.className)})});return b.createElement(_,N({direction:v,position:n,noWrap:g,spacing:u,grow:d},w),y)}m.displayName="@kubed/components/Group";export{m as Group};
17
+ `;function m(e){var r=e,{children:o,position:n="left",grow:d=!1,noWrap:g=!1,spacing:u="md",direction:v="row"}=r,w=P(r,["children","position","grow","noWrap","spacing","direction"]);const y=h.toArray(o).map(i=>{var l;return x(i,{className:O("group-child",(l=i.props)==null?void 0:l.className)})});return b.createElement(_,N({direction:v,position:n,noWrap:g,spacing:u,grow:d},w),y)}m.displayName="@kubed/components/Group";export{m as Group};
18
18
  //# sourceMappingURL=Group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Group.js","sources":["../../src/Group/Group.tsx"],"sourcesContent":["import React, { PropsWithChildren, CSSProperties, Children, cloneElement } from 'react';\nimport styled, { css } from 'styled-components';\nimport cx from 'classnames';\nimport { DefaultProps, KubedNumberSize, themeUtils } from '../theme';\n\nconst { getSizeValue } = themeUtils;\n\nexport type GroupPosition = 'right' | 'center' | 'left' | 'apart';\n\nexport type GroupDirection = 'row' | 'column';\n\nconst POSITIONS = {\n left: 'flex-start',\n center: 'center',\n right: 'flex-end',\n apart: 'space-between',\n};\n\nconst getAlign = (direction, position, grow) => {\n if (direction === 'row') {\n return css`\n align-items: center;\n justify-content: ${POSITIONS[position]};\n `;\n }\n return css`\n align-items: ${grow ? 'stretch' : POSITIONS[position]};\n `;\n};\n\nconst getChildStyles = (spacing, grow) => {\n return css`\n flex-grow: ${grow ? 1 : 0};\n `;\n};\n\nconst GroupContainer = styled('div')<GroupProps>`\n display: flex;\n flex-flow: ${({ direction, noWrap }) => `${direction} ${noWrap ? 'nowrap' : 'wrap'}`};\n ${({ direction, position, grow }) => getAlign(direction, position, grow)};\n gap: ${({ spacing, theme }) => getSizeValue(spacing, theme.layout.spacing)}};\n\n .group-child {\n ${({ spacing, grow }) => getChildStyles(spacing, grow)};\n }\n`;\n\nexport interface GroupProps extends DefaultProps, React.ComponentPropsWithoutRef<'div'> {\n /** Defines justify-content property */\n position?: GroupPosition;\n\n /** Defined flex-wrap property */\n noWrap?: boolean;\n\n /** Defines flex-grow property for each element, true -> 1, false -> 0 */\n grow?: boolean;\n\n /** Space between elements */\n spacing?: KubedNumberSize;\n\n /** Defines flex-direction property, row for horizontal, column for vertical */\n direction?: GroupDirection;\n\n /** Defines align-items css property */\n align?: CSSProperties['alignItems'];\n}\n\nexport function Group({\n children,\n position = 'left',\n grow = false,\n noWrap = false,\n spacing = 'md',\n direction = 'row',\n ...rest\n}: PropsWithChildren<GroupProps>) {\n const items = (Children.toArray(children) as React.ReactElement[]).map((child) =>\n cloneElement(child, {\n className: cx('group-child', child.props?.className),\n })\n );\n\n return (\n <GroupContainer\n direction={direction}\n position={position}\n noWrap={noWrap}\n spacing={spacing}\n grow={grow}\n {...rest}\n >\n {items}\n </GroupContainer>\n );\n}\n\nGroup.displayName = '@kubed/components/Group';\n"],"names":["b","i","C","y","S","$","w"],"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,CA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C,CAACC,QAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,OAAOC,YAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAACC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAOC,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,yBAAyB;;;;"}
1
+ {"version":3,"file":"Group.js","sources":["../../src/Group/Group.tsx"],"sourcesContent":["import React, { PropsWithChildren, CSSProperties, Children, cloneElement } from 'react';\nimport styled, { css } from 'styled-components';\nimport cx from 'classnames';\nimport { DefaultProps, KubedNumberSize, themeUtils } from '../theme';\n\nconst { getSizeValue } = themeUtils;\n\nexport type GroupPosition = 'right' | 'center' | 'left' | 'apart';\n\nexport type GroupDirection = 'row' | 'column';\n\nconst POSITIONS = {\n left: 'flex-start',\n center: 'center',\n right: 'flex-end',\n apart: 'space-between',\n};\n\nconst getAlign = (direction, position, grow) => {\n if (direction === 'row') {\n return css`\n align-items: center;\n justify-content: ${POSITIONS[position]};\n `;\n }\n return css`\n align-items: ${grow ? 'stretch' : POSITIONS[position]};\n `;\n};\n\nconst getChildStyles = (spacing, grow) => {\n return css`\n flex-grow: ${grow ? 1 : 0};\n `;\n};\n\nconst GroupContainer = styled('div')<GroupProps>`\n display: flex;\n flex-flow: ${({ direction, noWrap }) => `${direction} ${noWrap ? 'nowrap' : 'wrap'}`};\n ${({ direction, position, grow }) => getAlign(direction, position, grow)};\n gap: ${({ spacing, theme }) => getSizeValue(spacing, theme.layout.spacing)}};\n\n .group-child {\n ${({ spacing, grow }) => getChildStyles(spacing, grow)};\n }\n`;\n\nexport interface GroupProps extends DefaultProps, React.ComponentPropsWithoutRef<'div'> {\n /** Defines justify-content property */\n position?: GroupPosition;\n\n /** Defined flex-wrap property */\n noWrap?: boolean;\n\n /** Defines flex-grow property for each element, true -> 1, false -> 0 */\n grow?: boolean;\n\n /** Space between elements */\n spacing?: KubedNumberSize;\n\n /** Defines flex-direction property, row for horizontal, column for vertical */\n direction?: GroupDirection;\n\n /** Defines align-items css property */\n align?: CSSProperties['alignItems'];\n}\n\nexport function Group({\n children,\n position = 'left',\n grow = false,\n noWrap = false,\n spacing = 'md',\n direction = 'row',\n ...rest\n}: PropsWithChildren<GroupProps>) {\n const items = (Children.toArray(children) as React.ReactElement[]).map((child) =>\n cloneElement(child, {\n className: cx('group-child', child.props?.className),\n })\n );\n\n return (\n <GroupContainer\n direction={direction}\n position={position}\n noWrap={noWrap}\n spacing={spacing}\n grow={grow}\n {...rest}\n >\n {items}\n </GroupContainer>\n );\n}\n\nGroup.displayName = '@kubed/components/Group';\n"],"names":["b","i","C","y","S","$","w"],"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,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Q,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAACC,QAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,OAAOC,YAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAACC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAOC,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,yBAAyB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"InputNumber.js","sources":["../../src/InputNumber/InputNumber.tsx"],"sourcesContent":["import React from 'react';\nimport RcInputNumber, { InputNumberProps as RcInputNumberProps } from 'rc-input-number';\nimport styled from 'styled-components';\nimport { ChevronUp, ChevronDown } from '@kubed/icons';\nimport { DefaultProps } from '../theme';\nimport forwardRef from '../utils/forwardRef';\nimport { addColorAlpha } from '../utils/color';\n\nconst StyledInputNumber = styled(RcInputNumber)<RcInputNumberProps>`\n display: inline-flex;\n width: ${({ width }) => (width ? `${width}px` : '90px')};\n position: relative;\n border-radius: 3px;\n height: 32px;\n line-height: 1.67;\n padding: 6px 18px 6px 12px;\n border: 1px solid ${({ theme }) => theme.palette.accents_4};\n color: ${({ theme }) => theme.palette.accents_7};\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 &.kubed-in-focused {\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 &.kubed-in-disabled {\n cursor: not-allowed;\n background-color: ${({ theme }) => theme.palette.accents_1};\n border-color: ${({ theme }) => theme.palette.accents_4};\n\n input,\n .kubed-in-handler {\n cursor: not-allowed;\n }\n }\n\n .kubed-in-handler-wrap {\n position: absolute;\n top: 0;\n right: 0;\n width: 20px;\n height: 100%;\n border-radius: 0 3px 3px 0;\n border-left: 1px solid ${({ theme }) => theme.palette.accents_3};\n }\n\n .kubed-in-handler {\n width: 100%;\n height: 50%;\n display: block;\n text-align: center;\n cursor: pointer;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_1};\n }\n }\n\n .kubed-in-input-wrap {\n display: inline-flex;\n }\n\n .kubed-in-handler-down-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .kubed-in-input {\n width: 100%;\n height: 100%;\n font-weight: 600;\n border: none;\n outline: none;\n padding: 0;\n }\n`;\n\ntype ValueType = string | number;\n\nexport interface InputNumberProps extends DefaultProps {\n /** value will show as string */\n stringMode?: boolean;\n\n /** Default value for uncontrolled variant only */\n defaultValue?: ValueType;\n\n /** Input value for controlled variant */\n value?: ValueType;\n\n /** width of input */\n width?: number;\n\n /** Minimal possible value */\n min?: ValueType;\n\n /** Maximum possible value */\n max?: ValueType;\n\n /** The step used to increment or decrement the value */\n step?: ValueType;\n\n /** Whether to show +- controls */\n controls?: boolean;\n\n /** Parse display value to validate number */\n parser?: (displayValue: string | undefined) => ValueType;\n\n /** Transform `value` to display value show in input */\n formatter?: (\n value: ValueType | undefined,\n info: { userTyping: boolean; input: string }\n ) => string;\n\n /** Syntactic sugar of `formatter`. Config precision of display. */\n precision?: number;\n\n /** Syntactic sugar of `formatter`. Config decimal separator of display. */\n decimalSeparator?: string;\n\n /** The callback triggered when the value is changed */\n onChange?: (value: ValueType) => void;\n\n /** The callback function that is triggered when Enter key is pressed */\n onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;\n\n /** The callback function that is triggered when click up or down buttons */\n onStep?: (value: ValueType, info: { offset: ValueType; type: 'up' | 'down' }) => void;\n}\n\nexport const InputNumber = forwardRef<InputNumberProps, 'input'>(({ ...restProps }, ref) => {\n const upIcon = <ChevronUp size={14} />;\n const downIcon = <ChevronDown size={14} />;\n return (\n <StyledInputNumber\n prefixCls=\"kubed-in\"\n upHandler={upIcon}\n downHandler={downIcon}\n {...restProps}\n ref={ref}\n />\n );\n});\n\nInputNumber.displayName = '@kubed/components/InputNumber';\n"],"names":["h","w","y","p","g","x"],"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,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,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,CAAC,OAAO,CAAC,SAAS,CAAC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAa,MAAC,WAAW,CAACC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAOC,UAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,SAAS,CAACA,UAAC,CAAC,aAAa,CAACC,SAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAACD,UAAC,CAAC,aAAa,CAACE,WAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,+BAA+B;;;;"}
1
+ {"version":3,"file":"InputNumber.js","sources":["../../src/InputNumber/InputNumber.tsx"],"sourcesContent":["import React from 'react';\nimport RcInputNumber, { InputNumberProps as RcInputNumberProps } from 'rc-input-number';\nimport styled from 'styled-components';\nimport { ChevronUp, ChevronDown } from '@kubed/icons';\nimport { DefaultProps } from '../theme';\nimport forwardRef from '../utils/forwardRef';\nimport { addColorAlpha } from '../utils/color';\n\nconst StyledInputNumber = styled(RcInputNumber)<RcInputNumberProps>`\n display: inline-flex;\n width: ${({ width }) => (width ? `${width}px` : '90px')};\n position: relative;\n border-radius: 3px;\n height: 32px;\n line-height: 1.67;\n padding: 6px 18px 6px 12px;\n border: 1px solid ${({ theme }) => theme.palette.accents_4};\n color: ${({ theme }) => theme.palette.accents_7};\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 &.kubed-in-focused {\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 &.kubed-in-disabled {\n cursor: not-allowed;\n background-color: ${({ theme }) => theme.palette.accents_1};\n border-color: ${({ theme }) => theme.palette.accents_4};\n\n input,\n .kubed-in-handler {\n cursor: not-allowed;\n }\n }\n\n .kubed-in-handler-wrap {\n position: absolute;\n top: 0;\n right: 0;\n width: 20px;\n height: 100%;\n border-radius: 0 3px 3px 0;\n border-left: 1px solid ${({ theme }) => theme.palette.accents_3};\n }\n\n .kubed-in-handler {\n width: 100%;\n height: 50%;\n display: block;\n text-align: center;\n cursor: pointer;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.accents_1};\n }\n }\n\n .kubed-in-input-wrap {\n display: inline-flex;\n }\n\n .kubed-in-handler-down-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .kubed-in-input {\n width: 100%;\n height: 100%;\n font-weight: 600;\n border: none;\n outline: none;\n padding: 0;\n }\n`;\n\ntype ValueType = string | number;\n\nexport interface InputNumberProps extends DefaultProps {\n /** value will show as string */\n stringMode?: boolean;\n\n /** Default value for uncontrolled variant only */\n defaultValue?: ValueType;\n\n /** Input value for controlled variant */\n value?: ValueType;\n\n /** width of input */\n width?: number;\n\n /** Minimal possible value */\n min?: ValueType;\n\n /** Maximum possible value */\n max?: ValueType;\n\n /** The step used to increment or decrement the value */\n step?: ValueType;\n\n /** Whether to show +- controls */\n controls?: boolean;\n\n /** Parse display value to validate number */\n parser?: (displayValue: string | undefined) => ValueType;\n\n /** Transform `value` to display value show in input */\n formatter?: (\n value: ValueType | undefined,\n info: { userTyping: boolean; input: string }\n ) => string;\n\n /** Syntactic sugar of `formatter`. Config precision of display. */\n precision?: number;\n\n /** Syntactic sugar of `formatter`. Config decimal separator of display. */\n decimalSeparator?: string;\n\n /** The callback triggered when the value is changed */\n onChange?: (value: ValueType) => void;\n\n /** The callback function that is triggered when Enter key is pressed */\n onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;\n\n /** The callback function that is triggered when click up or down buttons */\n onStep?: (value: ValueType, info: { offset: ValueType; type: 'up' | 'down' }) => void;\n}\n\nexport const InputNumber = forwardRef<InputNumberProps, 'input'>(({ ...restProps }, ref) => {\n const upIcon = <ChevronUp size={14} />;\n const downIcon = <ChevronDown size={14} />;\n return (\n <StyledInputNumber\n prefixCls=\"kubed-in\"\n upHandler={upIcon}\n downHandler={downIcon}\n {...restProps}\n ref={ref}\n />\n );\n});\n\nInputNumber.displayName = '@kubed/components/InputNumber';\n"],"names":["h","w","y","p","g","x"],"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,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,IA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