@clickhouse/click-ui 0.8.0 → 0.9.0

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 (96) hide show
  1. package/dist/cjs/click-ui.css +362 -0
  2. package/dist/cjs/components/Assets/Icons/Horizontal-Loading.cjs +13 -49
  3. package/dist/cjs/components/Assets/Icons/Horizontal-Loading.cjs.map +1 -1
  4. package/dist/cjs/components/Assets/Icons/Loaders.css +94 -0
  5. package/dist/cjs/components/Assets/Icons/Loaders.module.css.cjs +13 -0
  6. package/dist/cjs/components/Assets/Icons/Loaders.module.css.cjs.map +1 -0
  7. package/dist/cjs/components/Assets/Icons/Loading-Animated.cjs +8 -12
  8. package/dist/cjs/components/Assets/Icons/Loading-Animated.cjs.map +1 -1
  9. package/dist/cjs/components/Assets/Icons/Loading.cjs +13 -6
  10. package/dist/cjs/components/Assets/Icons/Loading.cjs.map +1 -1
  11. package/dist/cjs/components/DatePicker/DateRangePicker.cjs +12 -2
  12. package/dist/cjs/components/DatePicker/DateRangePicker.cjs.map +1 -1
  13. package/dist/cjs/components/DatePicker/index.cjs +1 -3
  14. package/dist/cjs/components/DatePicker/index.cjs.map +1 -1
  15. package/dist/cjs/components/DatePicker/utils.cjs +3 -0
  16. package/dist/cjs/components/DatePicker/utils.cjs.map +1 -1
  17. package/dist/cjs/components/Grid/Cell.cjs +1 -3
  18. package/dist/cjs/components/Grid/Cell.cjs.map +1 -1
  19. package/dist/cjs/components/Grid/ColumnResizer.cjs +18 -15
  20. package/dist/cjs/components/Grid/ColumnResizer.cjs.map +1 -1
  21. package/dist/cjs/components/Grid/ColumnResizer.css +22 -0
  22. package/dist/cjs/components/Grid/ColumnResizer.module.css.cjs +11 -0
  23. package/dist/cjs/components/Grid/ColumnResizer.module.css.cjs.map +1 -0
  24. package/dist/cjs/components/Grid/Grid.css +34 -0
  25. package/dist/cjs/components/Grid/Grid.module.css.cjs +21 -0
  26. package/dist/cjs/components/Grid/Grid.module.css.cjs.map +1 -0
  27. package/dist/cjs/components/Grid/Header.cjs +22 -43
  28. package/dist/cjs/components/Grid/Header.cjs.map +1 -1
  29. package/dist/cjs/components/Grid/Header.css +44 -0
  30. package/dist/cjs/components/Grid/Header.module.css.cjs +19 -0
  31. package/dist/cjs/components/Grid/Header.module.css.cjs.map +1 -0
  32. package/dist/cjs/components/Grid/RowNumberColumn.cjs +12 -29
  33. package/dist/cjs/components/Grid/RowNumberColumn.cjs.map +1 -1
  34. package/dist/cjs/components/Grid/RowNumberColumn.css +22 -0
  35. package/dist/cjs/components/Grid/RowNumberColumn.module.css.cjs +12 -0
  36. package/dist/cjs/components/Grid/RowNumberColumn.module.css.cjs.map +1 -0
  37. package/dist/cjs/components/Grid/StyledCell.cjs +84 -56
  38. package/dist/cjs/components/Grid/StyledCell.cjs.map +1 -1
  39. package/dist/cjs/components/Grid/StyledCell.css +146 -0
  40. package/dist/cjs/components/Grid/StyledCell.module.css.cjs +47 -0
  41. package/dist/cjs/components/Grid/StyledCell.module.css.cjs.map +1 -0
  42. package/dist/cjs/components/Grid/index.cjs +30 -30
  43. package/dist/cjs/components/Grid/index.cjs.map +1 -1
  44. package/dist/esm/click-ui.css +362 -0
  45. package/dist/esm/components/Assets/Icons/Horizontal-Loading.js +13 -49
  46. package/dist/esm/components/Assets/Icons/Horizontal-Loading.js.map +1 -1
  47. package/dist/esm/components/Assets/Icons/Loaders.css +94 -0
  48. package/dist/esm/components/Assets/Icons/Loaders.module.css.js +8 -0
  49. package/dist/esm/components/Assets/Icons/Loaders.module.css.js.map +1 -0
  50. package/dist/esm/components/Assets/Icons/Loading-Animated.js +9 -13
  51. package/dist/esm/components/Assets/Icons/Loading-Animated.js.map +1 -1
  52. package/dist/esm/components/Assets/Icons/Loading.js +13 -6
  53. package/dist/esm/components/Assets/Icons/Loading.js.map +1 -1
  54. package/dist/esm/components/Assets/Icons/system/IconsLight.js +2 -2
  55. package/dist/esm/components/Assets/Icons/system/IconsLight.js.map +1 -1
  56. package/dist/esm/components/DatePicker/DateRangePicker.js +14 -4
  57. package/dist/esm/components/DatePicker/DateRangePicker.js.map +1 -1
  58. package/dist/esm/components/DatePicker/index.js +2 -4
  59. package/dist/esm/components/DatePicker/index.js.map +1 -1
  60. package/dist/esm/components/DatePicker/utils.js +3 -1
  61. package/dist/esm/components/DatePicker/utils.js.map +1 -1
  62. package/dist/esm/components/Grid/Cell.js +1 -3
  63. package/dist/esm/components/Grid/Cell.js.map +1 -1
  64. package/dist/esm/components/Grid/ColumnResizer.css +22 -0
  65. package/dist/esm/components/Grid/ColumnResizer.js +18 -15
  66. package/dist/esm/components/Grid/ColumnResizer.js.map +1 -1
  67. package/dist/esm/components/Grid/ColumnResizer.module.css.js +7 -0
  68. package/dist/esm/components/Grid/ColumnResizer.module.css.js.map +1 -0
  69. package/dist/esm/components/Grid/Grid.css +34 -0
  70. package/dist/esm/components/Grid/Grid.module.css.js +13 -0
  71. package/dist/esm/components/Grid/Grid.module.css.js.map +1 -0
  72. package/dist/esm/components/Grid/Header.css +44 -0
  73. package/dist/esm/components/Grid/Header.js +22 -43
  74. package/dist/esm/components/Grid/Header.js.map +1 -1
  75. package/dist/esm/components/Grid/Header.module.css.js +13 -0
  76. package/dist/esm/components/Grid/Header.module.css.js.map +1 -0
  77. package/dist/esm/components/Grid/RowNumberColumn.css +22 -0
  78. package/dist/esm/components/Grid/RowNumberColumn.js +12 -29
  79. package/dist/esm/components/Grid/RowNumberColumn.js.map +1 -1
  80. package/dist/esm/components/Grid/RowNumberColumn.module.css.js +8 -0
  81. package/dist/esm/components/Grid/RowNumberColumn.module.css.js.map +1 -0
  82. package/dist/esm/components/Grid/StyledCell.css +146 -0
  83. package/dist/esm/components/Grid/StyledCell.js +84 -56
  84. package/dist/esm/components/Grid/StyledCell.js.map +1 -1
  85. package/dist/esm/components/Grid/StyledCell.module.css.js +32 -0
  86. package/dist/esm/components/Grid/StyledCell.module.css.js.map +1 -0
  87. package/dist/esm/components/Grid/index.js +30 -30
  88. package/dist/esm/components/Grid/index.js.map +1 -1
  89. package/dist/types/components/Assets/Icons/Horizontal-Loading.d.ts +2 -3
  90. package/dist/types/components/Assets/Icons/Loading-Animated.d.ts +2 -3
  91. package/dist/types/components/Assets/Icons/Loading.d.ts +2 -4
  92. package/dist/types/components/DatePicker/DateRangePicker.d.ts +2 -1
  93. package/dist/types/components/DatePicker/utils.d.ts +1 -0
  94. package/dist/types/components/Grid/RowNumberColumn.d.ts +1 -2
  95. package/dist/types/components/Grid/StyledCell.d.ts +10 -5
  96. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"StyledCell.cjs","sources":["../../../../src/components/Grid/StyledCell.tsx"],"sourcesContent":["import { styled } from 'styled-components';\nimport { SelectionType } from './types';\n\nexport const StyledCell = styled.div<{\n $isFocused: boolean;\n $selectionType: SelectionType;\n $isSelectedTop: boolean;\n $isSelectedLeft: boolean;\n $isLastRow: boolean;\n $isLastColumn: boolean;\n $isFirstRow: boolean;\n $isFirstColumn: boolean;\n $height: number;\n $type?: 'body' | 'header';\n $showBorder: boolean;\n $rowAutoHeight?: boolean;\n}>`\n display: block;\n text-align: left;\n &[data-align='right'] {\n text-align: right;\n }\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: default;\n width: 100%;\n box-sizing: border-box;\n ${({\n theme,\n $isFocused,\n $isLastRow,\n $isLastColumn,\n $selectionType,\n $height,\n $type = 'body',\n $showBorder,\n $rowAutoHeight,\n }) => `\n height: ${$rowAutoHeight ? '100%' : `${$height}px`};\n min-height: ${$rowAutoHeight ? 'auto' : ''};\n overflow-y: ${$rowAutoHeight ? 'auto' : ''};\n background: ${theme.click.grid[$type].cell.color.background[$selectionType]};\n color: ${\n $type === 'header'\n ? theme.click.grid.header.cell.color.title[$selectionType]\n : theme.click.grid.body.cell.color.text[$selectionType]\n };\n font: ${theme.click.grid.cell.text.default};\n padding: ${theme.click.grid[$type].cell.space.y} ${\n theme.click.grid[$type].cell.space.x\n };\n border: 1px solid ${theme.click.grid[$type].cell.color.stroke.default};\n ${\n $type === 'header' && !$showBorder\n ? `\n &[data-grid-row=\"-1\"] {\n border-top: none;\n }\n &[data-grid-column=\"-1\"] {\n border-left: none;\n }\n `\n : ''\n }\n ${\n $isFocused\n ? `box-shadow: inset 0 0 0 1px ${theme.click.grid[$type].cell.color.stroke.selectDirect};`\n : ''\n }\n ${\n $isLastRow\n ? `\n border-bottom-color: ${\n theme.click.grid[$type].cell.color.stroke[\n $isFocused ? 'selectDirect' : $selectionType\n ]\n };\n `\n : 'border-bottom: none;'\n }\n ${\n $isLastColumn\n ? `\n border-right-color: ${\n theme.click.grid[$type].cell.color.stroke[\n $isFocused ? 'selectDirect' : $selectionType\n ]\n };\n `\n : 'border-right: none;'\n }\n ${$rowAutoHeight && 'border: none;'}\n `}\n ${({\n theme,\n $isLastRow,\n $isLastColumn,\n $selectionType,\n $type = 'body',\n $isSelectedTop,\n $isSelectedLeft,\n $rowAutoHeight,\n }) =>\n $isSelectedTop ||\n $isSelectedLeft ||\n ($selectionType === 'selectDirect' && ($isLastRow || $isLastColumn)) ||\n $rowAutoHeight\n ? `\n &::before {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n ${\n $isSelectedTop\n ? `border-top: 1px solid ${theme.click.grid[$type].cell.color.stroke.selectDirect};`\n : ''\n }\n ${\n $isSelectedLeft\n ? `border-left: 1px solid ${theme.click.grid[$type].cell.color.stroke.selectDirect};`\n : ''\n }\n ${\n $selectionType === 'selectDirect' && $isLastRow\n ? `border-bottom: 1px solid ${theme.click.grid[$type].cell.color.stroke.selectDirect};`\n : ''\n }\n ${\n $selectionType === 'selectDirect' && $isLastColumn\n ? `border-right: 1px solid ${theme.click.grid[$type].cell.color.stroke.selectDirect};`\n : ''\n }\n ${$rowAutoHeight && 'border: none;'}\n }\n `\n : ''};\n`;\n"],"names":["StyledCell","styled","div","withConfig","componentId","theme","$isFocused","$isLastRow","$isLastColumn","$selectionType","$height","$type","$showBorder","$rowAutoHeight","click","grid","cell","color","background","header","title","body","text","default","space","y","x","stroke","selectDirect","$isSelectedTop","$isSelectedLeft"],"mappings":";;;;;;AAGO,MAAMA,UAAAA,GAAaC,uBAAAA,CAAOC,GAAAA,CAAGC,UAAAA,CAAA;AAAA,EAAAC,WAAAA,EAAA;AAAA,CAAA,EAAA,CAAA,kLAAA,EAAA,GAAA,EAAA,GAAA,GAyBhC,CAAC;AAAA,EACDC,KAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,KAAAA,GAAQ,MAAA;AAAA,EACRC,WAAAA;AAAAA,EACAC;AACF,CAAA,KAAM;AAAA,YAAA,EACMA,cAAAA,GAAiB,MAAA,GAAS,CAAA,EAAGH,OAAO,CAAA,EAAA,CAAI,CAAA;AAAA,gBAAA,EACpCG,cAAAA,GAAiB,SAAS,EAAE,CAAA;AAAA,gBAAA,EAC5BA,cAAAA,GAAiB,SAAS,EAAE,CAAA;AAAA,gBAAA,EAC5BR,KAAAA,CAAMS,MAAMC,IAAAA,CAAKJ,KAAK,EAAEK,IAAAA,CAAKC,KAAAA,CAAMC,UAAAA,CAAWT,cAAc,CAAC,CAAA;AAAA,WAAA,EAEzEE,UAAU,QAAA,GACNN,KAAAA,CAAMS,MAAMC,IAAAA,CAAKI,MAAAA,CAAOH,KAAKC,KAAAA,CAAMG,KAAAA,CAAMX,cAAc,CAAA,GACvDJ,KAAAA,CAAMS,MAAMC,IAAAA,CAAKM,IAAAA,CAAKL,KAAKC,KAAAA,CAAMK,IAAAA,CAAKb,cAAc,CAAC,CAAA;AAAA,UAAA,EAEnDJ,KAAAA,CAAMS,KAAAA,CAAMC,IAAAA,CAAKC,IAAAA,CAAKM,KAAKC,OAAO,CAAA;AAAA,aAAA,EAC/BlB,MAAMS,KAAAA,CAAMC,IAAAA,CAAKJ,KAAK,CAAA,CAAE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E,KAAAA,GAAQ,MAAA;AAAA,EACRkB,cAAAA;AAAAA,EACAC,eAAAA;AAAAA,EACAjB;AACF,CAAA,KACEgB,kBACAC,eAAAA,IACCrB,cAAAA,KAAmB,cAAA,KAAmBF,UAAAA,IAAcC,kBACrDK,cAAAA,GACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAA,EASMgB,cAAAA,GACI,CAAA,sBAAA,EAAyBxB,KAAAA,CAAMS,KAAAA,CAAMC,IAAAA,CAAKJ,KAAK,CAAA,CAAEK,IAAAA,CAAKC,KAAAA,CAAMU,MAAAA,CAAOC,YAAY,CAAA,CAAA,CAAA,GAC/E,EAAE;AAAA,YAAA,EAGNE,eAAAA,GACI,CAAA,uBAAA,EAA0BzB,KAAAA,CAAMS,KAAAA,CAAMC,IAAAA,CAAKJ,KAAK,CAAA,CAAEK,IAAAA,CAAKC,KAAAA,CAAMU,MAAAA,CAAOC,YAAY,CAAA,CAAA,CAAA,GAChF,EAAE;AAAA,YAAA,EAGNnB,cAAAA,KAAmB,cAAA,IAAkBF,UAAAA,GACjC,CAAA,yBAAA,EAA4BF,MAAMS,KAAAA,CAAMC,IAAAA,CAAKJ,KAAK,CAAA,CAAEK,IAAAA,CAAKC,KAAAA,CAAMU,MAAAA,CAAOC,YAAY,MAClF,EAAE;AAAA,YAAA,EAGNnB,cAAAA,KAAmB,cAAA,IAAkBD,aAAAA,GACjC,CAAA,wBAAA,EAA2BH,MAAMS,KAAAA,CAAMC,IAAAA,CAAKJ,KAAK,CAAA,CAAEK,IAAAA,CAAKC,KAAAA,CAAMU,MAAAA,CAAOC,YAAY,MACjF,EAAE;AAAA,YAAA,EAENf,kBAAkB,eAAe;AAAA;AAAA,QAAA,CAAA,GAGvC,EAAE;;;;"}
1
+ {"version":3,"file":"StyledCell.cjs","sources":["../../../../src/components/Grid/StyledCell.tsx"],"sourcesContent":["import { ComponentProps, CSSProperties, ElementType, ReactNode } from 'react';\nimport { cn, cva } from '@/lib/cva';\nimport styles from './StyledCell.module.css';\nimport { SelectionType } from './types';\n\ninterface StyledCellOwnProps {\n $isFocused: boolean;\n $selectionType: SelectionType;\n $isSelectedTop: boolean;\n $isSelectedLeft: boolean;\n $isLastRow: boolean;\n $isLastColumn: boolean;\n $height: number;\n $type?: 'body' | 'header';\n $showBorder: boolean;\n $rowAutoHeight?: boolean;\n}\n\nconst cellVariants = cva(styles.cell, {\n variants: {\n type: {\n body: styles.cell_type_body,\n header: styles.cell_type_header,\n },\n selection: {\n default: null,\n selectDirect: styles['cell_selection_direct'],\n selectIndirect: styles['cell_selection_indirect'],\n },\n noBorder: { true: styles['cell_no-border'] },\n focused: { true: styles.cell_focused },\n lastRow: { true: styles['cell_last-row'] },\n lastColumn: { true: styles['cell_last-column'] },\n rowAutoHeight: { true: styles['cell_row-auto-height'] },\n overlay: { true: styles.cell__overlay },\n overlayTop: { true: styles['cell__overlay_selected_top'] },\n overlayLeft: { true: styles['cell__overlay_selected_left'] },\n overlayBottom: { true: styles['cell__overlay_selected_bottom'] },\n overlayRight: { true: styles['cell__overlay_selected_right'] },\n overlayAutoHeight: { true: styles['cell__overlay_row-auto-height'] },\n },\n});\n\ntype StyledCellProps<T extends ElementType> = StyledCellOwnProps & {\n as?: T;\n children?: ReactNode;\n} & Omit<ComponentProps<T>, keyof StyledCellOwnProps | 'as' | 'children'>;\n\nexport const StyledCell = <T extends ElementType = 'div'>({\n as,\n $isFocused,\n $selectionType,\n $isSelectedTop,\n $isSelectedLeft,\n $isLastRow,\n $isLastColumn,\n $height,\n $type = 'body',\n $showBorder,\n $rowAutoHeight,\n className,\n style,\n children,\n ...props\n}: StyledCellProps<T>) => {\n const Component = (as ?? 'div') as ElementType;\n // A single overlay `::before` is drawn whenever any selection/focus edge or\n // auto-height needs to paint on top of the cell (see Grid.module.css).\n const hasOverlay =\n $isSelectedTop ||\n $isSelectedLeft ||\n ($selectionType === 'selectDirect' && ($isLastRow || $isLastColumn)) ||\n !!$rowAutoHeight;\n const mergedStyle = {\n height: $rowAutoHeight ? '100%' : `${$height}px`,\n ...style,\n } as CSSProperties;\n return (\n <Component\n className={cn(\n cellVariants({\n type: $type,\n selection: $selectionType,\n noBorder: $type === 'header' && !$showBorder,\n focused: $isFocused,\n lastRow: $isLastRow,\n lastColumn: $isLastColumn,\n rowAutoHeight: !!$rowAutoHeight,\n overlay: hasOverlay,\n overlayTop: $isSelectedTop,\n overlayLeft: $isSelectedLeft,\n overlayBottom: $selectionType === 'selectDirect' && $isLastRow,\n overlayRight: $selectionType === 'selectDirect' && $isLastColumn,\n overlayAutoHeight: !!$rowAutoHeight,\n }),\n className\n )}\n style={mergedStyle}\n {...props}\n >\n {children}\n </Component>\n );\n};\n"],"names":["cellVariants","cva","styles","cell","variants","type","body","cell_type_body","header","cell_type_header","selection","default","selectDirect","selectIndirect","noBorder","true","focused","cell_focused","lastRow","lastColumn","rowAutoHeight","overlay","cell__overlay","overlayTop","overlayLeft","overlayBottom","overlayRight","overlayAutoHeight","StyledCell","as","$isFocused","$selectionType","$isSelectedTop","$isSelectedLeft","$isLastRow","$isLastColumn","$height","$type","$showBorder","$rowAutoHeight","className","style","children","props","Component","hasOverlay","mergedStyle","height","jsx","cn"],"mappings":";;;;;;;;;AAkBA,MAAMA,YAAAA,GAAeC,0BAAAA,CAAIC,yBAAAA,CAAOC,IAAAA,EAAM;AAAA,EACpCC,QAAAA,EAAU;AAAA,IACRC,IAAAA,EAAM;AAAA,MACJC,MAAMJ,yBAAAA,CAAOK,cAAAA;AAAAA,MACbC,QAAQN,yBAAAA,CAAOO;AAAAA,KACjB;AAAA,IACAC,SAAAA,EAAW;AAAA,MACTC,OAAAA,EAAS,IAAA;AAAA,MACTC,YAAAA,EAAcV,0BAAO,uBAAuB,CAAA;AAAA,MAC5CW,cAAAA,EAAgBX,0BAAO,yBAAyB;AAAA,KAClD;AAAA,IACAY,QAAAA,EAAU;AAAA,MAAEC,IAAAA,EAAMb,0BAAO,gBAAgB;AAAA,KAAE;AAAA,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AAM,KAAA;AAGzB,EAAA,MAAMgB,UAAAA,GACJb,kBACAC,eAAAA,IACCF,cAAAA,KAAmB,mBAAmBG,UAAAA,IAAcC,aAAAA,CAAAA,IACrD,CAAC,CAACI,cAAAA;AACJ,EAAA,MAAMO,WAAAA,GAAc;AAAA,IAClBC,MAAAA,EAAQR,cAAAA,GAAiB,MAAA,GAAS,CAAA,EAAGH,OAAO,CAAA,EAAA,CAAA;AAAA,IAC5C,GAAGK;AAAAA,GACL;AACA,EAAA,uBACEO,cAAA,CAAC,SAAA,EAAA,EACC,SAAA,EAAWC,MAAAA,CACTjD,YAAAA,CAAa;AAAA,IACXK,IAAAA,EAAMgC,KAAAA;AAAAA,IACN3B,SAAAA,EAAWqB,cAAAA;AAAAA,IACXjB,QAAAA,EAAUuB,KAAAA,KAAU,QAAA,IAAY,CAACC,WAAAA;AAAAA,IACjCtB,OAAAA,EAASc,UAAAA;AAAAA,IACTZ,OAAAA,EAASgB,UAAAA;AAAAA,IACTf,UAAAA,EAAYgB,aAAAA;AAAAA,IACZf,aAAAA,EAAe,CAAC,CAACmB,cAAAA;AAAAA,IACjBlB,OAAAA,EAASwB,UAAAA;AAAAA,IACTtB,UAAAA,EAAYS,cAAAA;AAAAA,IACZR,WAAAA,EAAaS,eAAAA;AAAAA,IACbR,aAAAA,EAAeM,mBAAmB,cAAA,IAAkBG,UAAAA;AAAAA,IACpDR,YAAAA,EAAcK,mBAAmB,cAAA,IAAkBI,aAAAA;AAAAA,IACnDR,iBAAAA,EAAmB,CAAC,CAACY;AAAAA,GACtB,GACDC,SACF,CAAA,EACA,OAAOM,WAAAA,EACP,GAAIH,OAEHD,QAAAA,EACH,CAAA;AAEJ;;;;"}
@@ -0,0 +1,146 @@
1
+ /* stylelint-disable custom-property-pattern -- design tokens use camelCase (e.g. selectDirect) */
2
+
3
+ /*
4
+ * The original styled-component dispatches background / text colour / border
5
+ * colour off `$type` (body|header) and `$selectionType`, and toggles individual
6
+ * borders / a `::before` overlay off boolean flags. Colours are aliased to local
7
+ * custom properties (set by the type + selection modifiers) so the shared border
8
+ * / overlay rules can reference them once.
9
+ */
10
+
11
+ .cell__OXAxg {
12
+ display: block;
13
+ box-sizing: border-box;
14
+ width: 100%;
15
+ padding: var(--cell-space-y) var(--cell-space-x);
16
+ overflow: hidden;
17
+ border-top: 1px solid var(--cell-stroke-default);
18
+ border-left: 1px solid var(--cell-stroke-default);
19
+ background: var(--cell-background);
20
+ color: var(--cell-color);
21
+ font: var(--click-grid-cell-text-default);
22
+ text-align: left;
23
+ white-space: nowrap;
24
+ cursor: default;
25
+ text-overflow: ellipsis;
26
+ }
27
+
28
+ .cell__OXAxg[data-align='right'] {
29
+ text-align: right;
30
+ }
31
+
32
+ .cell_type_body__SohuF {
33
+ --cell-stroke-default: var(--click-grid-body-cell-color-stroke-default);
34
+ --cell-stroke-select-direct: var(--click-grid-body-cell-color-stroke-selectDirect);
35
+ --cell-stroke-last: var(--click-grid-body-cell-color-stroke-default);
36
+ --cell-space-y: var(--click-grid-body-cell-space-y);
37
+ --cell-space-x: var(--click-grid-body-cell-space-x);
38
+ --cell-background: var(--click-grid-body-cell-color-background-default);
39
+ --cell-color: var(--click-grid-body-cell-color-text-default);
40
+ }
41
+
42
+ .cell_type_body__SohuF.cell_selection_indirect__6e6yy {
43
+ --cell-stroke-last: var(--click-grid-body-cell-color-stroke-selectIndirect);
44
+ --cell-background: var(--click-grid-body-cell-color-background-selectIndirect);
45
+ --cell-color: var(--click-grid-body-cell-color-text-selectIndirect);
46
+ }
47
+
48
+ .cell_type_body__SohuF.cell_selection_direct__QEL9m {
49
+ --cell-stroke-last: var(--click-grid-body-cell-color-stroke-selectDirect);
50
+ --cell-background: var(--click-grid-body-cell-color-background-selectDirect);
51
+ --cell-color: var(--click-grid-body-cell-color-text-selectDirect);
52
+ }
53
+
54
+ .cell_type_header__3tsr- {
55
+ --cell-stroke-default: var(--click-grid-header-cell-color-stroke-default);
56
+ --cell-stroke-select-direct: var(--click-grid-header-cell-color-stroke-selectDirect);
57
+ --cell-stroke-last: var(--click-grid-header-cell-color-stroke-default);
58
+ --cell-space-y: var(--click-grid-header-cell-space-y);
59
+ --cell-space-x: var(--click-grid-header-cell-space-x);
60
+ --cell-background: var(--click-grid-header-cell-color-background-default);
61
+ --cell-color: var(--click-grid-header-cell-color-title-default);
62
+ }
63
+
64
+ .cell_type_header__3tsr-.cell_selection_indirect__6e6yy {
65
+ --cell-stroke-last: var(--click-grid-header-cell-color-stroke-selectIndirect);
66
+ --cell-background: var(--click-grid-header-cell-color-background-selectIndirect);
67
+ --cell-color: var(--click-grid-header-cell-color-title-selectIndirect);
68
+ }
69
+
70
+ .cell_type_header__3tsr-.cell_selection_direct__QEL9m {
71
+ --cell-stroke-last: var(--click-grid-header-cell-color-stroke-selectDirect);
72
+ --cell-background: var(--click-grid-header-cell-color-background-selectDirect);
73
+ --cell-color: var(--click-grid-header-cell-color-title-selectDirect);
74
+ }
75
+
76
+ /* header cell with no border removes top/left edges on the corner cells */
77
+ .cell_type_header__3tsr-.cell_no-border__9gXDK[data-grid-row='-1'] {
78
+ border-top: none;
79
+ }
80
+
81
+ .cell_type_header__3tsr-.cell_no-border__9gXDK[data-grid-column='-1'] {
82
+ border-left: none;
83
+ }
84
+
85
+ /* a focused cell draws its last-edge borders with the select-direct stroke */
86
+ .cell_focused__cmh-b {
87
+ box-shadow: inset 0 0 0 1px var(--cell-stroke-select-direct);
88
+ }
89
+
90
+ /*
91
+ * Focus must win the last-edge stroke colour over any selection state. The
92
+ * original styled-component resolved the last-row / last-column border colour
93
+ * inline as `stroke[$isFocused ? 'selectDirect' : $selectionType]`, so focus
94
+ * always overrode the selection stroke. The `.cell_type_*.cell_selection_*`
95
+ * rules above set `--cell-stroke-last` at (0,2,0) specificity, so the focus
96
+ * override is qualified with the type class to match that specificity and,
97
+ * coming later in source order, take precedence. `.cell_focused` always
98
+ * co-occurs with a type class.
99
+ */
100
+ .cell_type_body__SohuF.cell_focused__cmh-b,
101
+ .cell_type_header__3tsr-.cell_focused__cmh-b {
102
+ --cell-stroke-last: var(--cell-stroke-select-direct);
103
+ }
104
+
105
+ /* only the last row/column draw the closing border, colored by focus/selection */
106
+ .cell_last-row__DoJdk {
107
+ border-bottom: 1px solid var(--cell-stroke-last);
108
+ }
109
+
110
+ .cell_last-column__LgKM7 {
111
+ border-right: 1px solid var(--cell-stroke-last);
112
+ }
113
+
114
+ /* rowAutoHeight resets the entire border last, overriding every rule above */
115
+ .cell_row-auto-height__yzQUR {
116
+ min-height: auto;
117
+ overflow-y: auto;
118
+ border: none;
119
+ }
120
+
121
+ /* selection / focus overlay drawn on top of the cell so adjacent borders meet */
122
+ .cell__overlay__U9XGO::before {
123
+ content: '';
124
+ position: absolute;
125
+ inset: 0;
126
+ }
127
+
128
+ .cell__overlay_selected_top__OMUJB::before {
129
+ border-top: 1px solid var(--cell-stroke-select-direct);
130
+ }
131
+
132
+ .cell__overlay_selected_left__MiimG::before {
133
+ border-left: 1px solid var(--cell-stroke-select-direct);
134
+ }
135
+
136
+ .cell__overlay_selected_bottom__2ra9F::before {
137
+ border-bottom: 1px solid var(--cell-stroke-select-direct);
138
+ }
139
+
140
+ .cell__overlay_selected_right__Dt-g5::before {
141
+ border-right: 1px solid var(--cell-stroke-select-direct);
142
+ }
143
+
144
+ .cell__overlay_row-auto-height__teKk1::before {
145
+ border: none;
146
+ }
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
+
5
+ const cell = "cell__OXAxg";
6
+ const cell_type_body = "cell_type_body__SohuF";
7
+ const cell_selection_indirect = "cell_selection_indirect__6e6yy";
8
+ const cell_selection_direct = "cell_selection_direct__QEL9m";
9
+ const cell_type_header = "cell_type_header__3tsr-";
10
+ const cell_focused = "cell_focused__cmh-b";
11
+ const cell__overlay = "cell__overlay__U9XGO";
12
+ const cell__overlay_selected_top = "cell__overlay_selected_top__OMUJB";
13
+ const cell__overlay_selected_left = "cell__overlay_selected_left__MiimG";
14
+ const cell__overlay_selected_bottom = "cell__overlay_selected_bottom__2ra9F";
15
+ const cell__overlay_selected_right = "cell__overlay_selected_right__Dt-g5";
16
+ const styles = {
17
+ cell: cell,
18
+ cell_type_body: cell_type_body,
19
+ cell_selection_indirect: cell_selection_indirect,
20
+ cell_selection_direct: cell_selection_direct,
21
+ cell_type_header: cell_type_header,
22
+ "cell_no-border": "cell_no-border__9gXDK",
23
+ cell_focused: cell_focused,
24
+ "cell_last-row": "cell_last-row__DoJdk",
25
+ "cell_last-column": "cell_last-column__LgKM7",
26
+ "cell_row-auto-height": "cell_row-auto-height__yzQUR",
27
+ cell__overlay: cell__overlay,
28
+ cell__overlay_selected_top: cell__overlay_selected_top,
29
+ cell__overlay_selected_left: cell__overlay_selected_left,
30
+ cell__overlay_selected_bottom: cell__overlay_selected_bottom,
31
+ cell__overlay_selected_right: cell__overlay_selected_right,
32
+ "cell__overlay_row-auto-height": "cell__overlay_row-auto-height__teKk1"
33
+ };
34
+
35
+ exports.cell = cell;
36
+ exports.cell__overlay = cell__overlay;
37
+ exports.cell__overlay_selected_bottom = cell__overlay_selected_bottom;
38
+ exports.cell__overlay_selected_left = cell__overlay_selected_left;
39
+ exports.cell__overlay_selected_right = cell__overlay_selected_right;
40
+ exports.cell__overlay_selected_top = cell__overlay_selected_top;
41
+ exports.cell_focused = cell_focused;
42
+ exports.cell_selection_direct = cell_selection_direct;
43
+ exports.cell_selection_indirect = cell_selection_indirect;
44
+ exports.cell_type_body = cell_type_body;
45
+ exports.cell_type_header = cell_type_header;
46
+ exports.default = styles;
47
+ //# sourceMappingURL=StyledCell.module.css.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StyledCell.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ require("./Grid.css");
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
@@ -8,7 +9,8 @@ const reactWindow = require('react-window');
8
9
  const AutoSizer = require('react-virtualized-auto-sizer');
9
10
  const RowNumberColumn = require('./RowNumberColumn.cjs');
10
11
  const Header = require('./Header.cjs');
11
- const styledComponents = require('styled-components');
12
+ const cva = require('../../lib/cva.cjs');
13
+ const Grid_module = require('./Grid.module.css.cjs');
12
14
  const useSelectionActions = require('./useSelectionActions.cjs');
13
15
  const mergeRefs = require('../../utils/mergeRefs.cjs');
14
16
  const Cell = require('./Cell.cjs');
@@ -17,17 +19,22 @@ const copyGridElements = require('./copyGridElements.cjs');
17
19
  const useColumns = require('./useColumns.cjs');
18
20
  const useResizingState = require('./useResizingState.cjs');
19
21
  const ContextMenu = require('../ContextMenu/index.cjs');
22
+ const classVarianceAuthority = require('class-variance-authority');
20
23
 
21
24
  const _interopDefault = e => e && e.__esModule ? e : { default: e };
22
25
 
23
26
  const AutoSizer__default = /*#__PURE__*/_interopDefault(AutoSizer);
24
27
 
28
+ const gridVariants = classVarianceAuthority.cva(Grid_module.default["grid"], {
29
+ variants: {
30
+ bordered: {
31
+ true: Grid_module.default["grid_bordered"]
32
+ }
33
+ }
34
+ });
25
35
  const NO_BUTTONS_PRESSED = 0;
26
36
  const LEFT_BUTTON_PRESSED = 1;
27
37
  const RIGHT_BUTTON_PRESSED = 2;
28
- const GridContainer = styledComponents.styled.div.withConfig({
29
- componentId: "sc-175eneg-0"
30
- })(["display:flex;flex-direction:column-reverse;user-select:none;overflow-anchor:none;"]);
31
38
  const getRenderedCursor = (children) => children.reduce(([minRow, maxRow, minColumn, maxColumn], {
32
39
  props: {
33
40
  columnIndex,
@@ -48,28 +55,12 @@ const getRenderedCursor = (children) => children.reduce(([minRow, maxRow, minCol
48
55
  }
49
56
  return [minRow, maxRow, minColumn, maxColumn];
50
57
  }, [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]);
51
- const GridDataContainer = styledComponents.styled.div.withConfig({
52
- componentId: "sc-175eneg-1"
53
- })(["position:absolute;top:0;left:0;", ""], ({
54
- $top,
55
- $left
56
- }) => `
57
- margin-top: ${$top}px;
58
- margin-left: ${$left}px;
59
- `);
60
- const ContextMenuTrigger = styledComponents.styled.div.withConfig({
61
- componentId: "sc-175eneg-2"
62
- })(["outline:none;overflow:hidden;height:", ";width:100%;background:", ";border-radius:", ";", ";"], ({
63
- $height
64
- }) => $height ? `${$height}px` : "100%", ({
65
- theme
66
- }) => theme.click.grid.body.cell.color.background.default, ({
67
- theme,
68
- $rounded
69
- }) => theme.click.grid.radii[$rounded], ({
70
- $showBorder,
71
- theme
72
- }) => $showBorder && `border: 1px solid ${theme.click.grid.header.cell.color.stroke.default}`);
58
+ const roundedRadii = {
59
+ none: "var(--click-grid-radii-none)",
60
+ lg: "var(--click-grid-radii-lg)",
61
+ md: "var(--click-grid-radii-md)",
62
+ sm: "var(--click-grid-radii-sm)"
63
+ };
73
64
  const OuterElementType = react.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-testid": "grid-outer-element", tabIndex: 0, ...props }));
74
65
  const Grid = react.forwardRef(({
75
66
  autoFocus,
@@ -339,9 +330,12 @@ const Grid = react.forwardRef(({
339
330
  ...containerProps
340
331
  }, ref) => {
341
332
  const [minRow, maxRow, minColumn, maxColumn] = getRenderedCursor(children);
342
- return /* @__PURE__ */ jsxRuntime.jsxs(GridContainer, { ...containerProps, className: `sticky-grid__container grid-outer ${props.className ?? ""}`, children: [
343
- /* @__PURE__ */ jsxRuntime.jsx(GridDataContainer, { $top: showHeader ? headerHeight : 0, $left: showRowNumber ? rowNumberWidth : 0, ref, children }),
344
- showRowNumber && /* @__PURE__ */ jsxRuntime.jsx(RowNumberColumn.default, { scrolledHorizontal, minRow, maxRow, rowHeight, headerHeight, rowWidth: rowNumberWidth, rowCount, getSelectionType, showHeader, rowStart, showBorder, rowAutoHeight }),
333
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...containerProps, className: cva.cn(Grid_module.default["grid__inner"], `sticky-grid__container grid-outer ${props.className ?? ""}`), children: [
334
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: Grid_module.default["grid__data"], style: {
335
+ "--grid-data-top": `${showHeader ? headerHeight : 0}px`,
336
+ "--grid-data-left": `${showRowNumber ? rowNumberWidth : 0}px`
337
+ }, ref, children }),
338
+ showRowNumber && /* @__PURE__ */ jsxRuntime.jsx(RowNumberColumn.default, { scrolledHorizontal, minRow, maxRow, rowHeight, headerHeight, rowWidth: rowNumberWidth, rowCount, getSelectionType, rowStart, showBorder, rowAutoHeight }),
345
339
  showHeader && /* @__PURE__ */ jsxRuntime.jsx(Header.default, { scrolledVertical, scrolledHorizontal, showRowNumber, minColumn, maxColumn, height: headerHeight, getColumnWidth: columnWidth, cell, rowNumberWidth, getSelectionType, columnCount, onColumnResize, getColumnHorizontalPosition, getResizerPosition, showBorder, resizingState })
346
340
  ] });
347
341
  });
@@ -595,8 +589,14 @@ const Grid = react.forwardRef(({
595
589
  gridRef.current.resetAfterRowIndex(0);
596
590
  }
597
591
  }, [rowCount, columnCount]);
592
+ const contextMenuTriggerHeight = autoHeight ? rowCount * rowHeight + (showHeader ? headerHeight : 0) + elementBorderRef.current.scrollBarHeight : void 0;
598
593
  return /* @__PURE__ */ jsxRuntime.jsxs(ContextMenu.ContextMenu, { modal: false, onOpenChange: setContextMenuOpen, children: [
599
- /* @__PURE__ */ jsxRuntime.jsx(ContextMenuTrigger, { as: ContextMenu.ContextMenu.Trigger, ref: mergeRefs.mergeRefs([forwardedRef, containerRef]), tabIndex: 0, onMouseDown, onMouseMove, onKeyDown, onPointerDown, onPointerUp, onPointerLeave: setPointerCapture, onPointerEnter: setPointerCapture, onContextMenu, $rounded: rounded, $height: autoHeight ? rowCount * rowHeight + (showHeader ? headerHeight : 0) + elementBorderRef.current.scrollBarHeight : void 0, $showBorder: showBorder, children: /* @__PURE__ */ jsxRuntime.jsx(AutoSizer__default.default, { onResize, children: ({
594
+ /* @__PURE__ */ jsxRuntime.jsx(ContextMenu.ContextMenu.Trigger, { className: gridVariants({
595
+ bordered: showBorder
596
+ }), style: {
597
+ "--grid-radius": roundedRadii[rounded],
598
+ "--grid-height": contextMenuTriggerHeight ? `${contextMenuTriggerHeight}px` : "100%"
599
+ }, ref: mergeRefs.mergeRefs([forwardedRef, containerRef]), tabIndex: 0, onMouseDown, onMouseMove, onKeyDown, onPointerDown, onPointerUp, onPointerLeave: setPointerCapture, onPointerEnter: setPointerCapture, onContextMenu, children: /* @__PURE__ */ jsxRuntime.jsx(AutoSizer__default.default, { onResize, children: ({
600
600
  height,
601
601
  width
602
602
  }) => /* @__PURE__ */ jsxRuntime.jsx(reactWindow.VariableSizeGrid, { ref: forwardedGridRef ? mergeRefs.mergeRefs([forwardedGridRef, gridRef]) : gridRef, height, width, columnCount, rowHeight: getRowHeight, useIsScrolling, innerElementType: InnerElementType, itemData: data, initialScrollTop: focus.row < rowStart ? focus.row * rowHeight : (focus.row - rowStart) * rowHeight, initialScrollLeft: getColumnHorizontalPosition(focus.column), columnWidth, rowCount, onScroll, outerRef, outerElementType: OuterElementType, onItemsRendered, ...props, children: CellWithWidth }) }) }),