@activecollab/components 2.0.459 → 2.0.460

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 (47) hide show
  1. package/dist/cjs/components/Button/Button.js +16 -6
  2. package/dist/cjs/components/Button/Button.js.map +1 -1
  3. package/dist/cjs/components/CaretButton/CaretButton.js +52 -0
  4. package/dist/cjs/components/CaretButton/CaretButton.js.map +1 -0
  5. package/dist/cjs/components/CaretButton/Styles.js +20 -0
  6. package/dist/cjs/components/CaretButton/Styles.js.map +1 -0
  7. package/dist/cjs/components/CaretButton/index.js +17 -0
  8. package/dist/cjs/components/CaretButton/index.js.map +1 -0
  9. package/dist/cjs/components/Tables/Styles.js +68 -6
  10. package/dist/cjs/components/Tables/Styles.js.map +1 -1
  11. package/dist/cjs/components/Tables/Table.js +9 -4
  12. package/dist/cjs/components/Tables/Table.js.map +1 -1
  13. package/dist/cjs/components/index.js +11 -0
  14. package/dist/cjs/components/index.js.map +1 -1
  15. package/dist/esm/components/Button/Button.d.ts +10 -2
  16. package/dist/esm/components/Button/Button.d.ts.map +1 -1
  17. package/dist/esm/components/Button/Button.js +16 -6
  18. package/dist/esm/components/Button/Button.js.map +1 -1
  19. package/dist/esm/components/CaretButton/CaretButton.d.ts +22 -0
  20. package/dist/esm/components/CaretButton/CaretButton.d.ts.map +1 -0
  21. package/dist/esm/components/CaretButton/CaretButton.js +43 -0
  22. package/dist/esm/components/CaretButton/CaretButton.js.map +1 -0
  23. package/dist/esm/components/CaretButton/Styles.d.ts +4 -0
  24. package/dist/esm/components/CaretButton/Styles.d.ts.map +1 -0
  25. package/dist/esm/components/CaretButton/Styles.js +14 -0
  26. package/dist/esm/components/CaretButton/Styles.js.map +1 -0
  27. package/dist/esm/components/CaretButton/index.d.ts +2 -0
  28. package/dist/esm/components/CaretButton/index.d.ts.map +1 -0
  29. package/dist/esm/components/CaretButton/index.js +2 -0
  30. package/dist/esm/components/CaretButton/index.js.map +1 -0
  31. package/dist/esm/components/Tables/Styles.d.ts +9 -1
  32. package/dist/esm/components/Tables/Styles.d.ts.map +1 -1
  33. package/dist/esm/components/Tables/Styles.js +65 -7
  34. package/dist/esm/components/Tables/Styles.js.map +1 -1
  35. package/dist/esm/components/Tables/Table.d.ts +7 -2
  36. package/dist/esm/components/Tables/Table.d.ts.map +1 -1
  37. package/dist/esm/components/Tables/Table.js +9 -4
  38. package/dist/esm/components/Tables/Table.js.map +1 -1
  39. package/dist/esm/components/index.d.ts +1 -0
  40. package/dist/esm/components/index.d.ts.map +1 -1
  41. package/dist/esm/components/index.js +1 -0
  42. package/dist/esm/components/index.js.map +1 -1
  43. package/dist/index.js +4835 -4709
  44. package/dist/index.js.map +1 -1
  45. package/dist/index.min.js +1 -1
  46. package/dist/index.min.js.map +1 -1
  47. package/package.json +1 -1
@@ -7,7 +7,7 @@ exports.Button = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _classnames = _interopRequireDefault(require("classnames"));
9
9
  var _Styles = require("./Styles");
10
- var _excluded = ["children", "active", "variant", "size", "type", "inset", "className"];
10
+ var _excluded = ["children", "active", "variant", "size", "type", "inset", "endAdornment", "endAdornmentInset", "className"];
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
13
13
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
@@ -46,8 +46,18 @@ var Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
46
46
  type = _ref$type === void 0 ? "button" : _ref$type,
47
47
  _ref$inset = _ref.inset,
48
48
  inset = _ref$inset === void 0 ? "default" : _ref$inset,
49
+ endAdornment = _ref.endAdornment,
50
+ _ref$endAdornmentInse = _ref.endAdornmentInset,
51
+ endAdornmentInset = _ref$endAdornmentInse === void 0 ? 0 : _ref$endAdornmentInse,
49
52
  className = _ref.className,
50
53
  args = _objectWithoutProperties(_ref, _excluded);
54
+ var content = endAdornment ? [...(children instanceof Array ? children : [children]), /*#__PURE__*/_react.default.createElement("span", {
55
+ key: "end-adornment",
56
+ style: {
57
+ display: "inline-flex",
58
+ marginRight: -endAdornmentInset
59
+ }
60
+ }, endAdornment)] : children;
51
61
  return /*#__PURE__*/_react.default.createElement(_Styles.StyledButton, _extends({
52
62
  className: (0, _classnames.default)("c-btn", className, {
53
63
  "c-btn--contained": variant === "primary" || variant === "contained",
@@ -58,9 +68,9 @@ var Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
58
68
  "c-btn--circle-raised": variant === "circle raised",
59
69
  "c-btn--big": size === "big",
60
70
  "c-btn--small": size === "small",
61
- "c-btn--icon-only": children instanceof Object && !(children instanceof Array)
71
+ "c-btn--icon-only": content instanceof Object && !(content instanceof Array)
62
72
  }),
63
- iconOnly: children instanceof Object && !(children instanceof Array),
73
+ iconOnly: content instanceof Object && !(content instanceof Array),
64
74
  variant: variant,
65
75
  active: active,
66
76
  size: size,
@@ -69,14 +79,14 @@ var Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
69
79
  "aria-pressed": active,
70
80
  role: "button",
71
81
  type: type
72
- }, args), children instanceof Array ? /*#__PURE__*/_react.default.createElement(_Styles.StyledButtonElements, {
82
+ }, args), content instanceof Array ? /*#__PURE__*/_react.default.createElement(_Styles.StyledButtonElements, {
73
83
  className: "c-btn__elements"
74
- }, children.map(function (value, index) {
84
+ }, content.map(function (value, index) {
75
85
  return value ? /*#__PURE__*/_react.default.createElement(_Styles.StyledButtonElement, {
76
86
  className: "c-btn__elements__element",
77
87
  key: index
78
88
  }, value) : null;
79
- })) : children);
89
+ })) : content);
80
90
  });
81
91
  Button.displayName = "Button";
82
92
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_Styles","_excluded","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","Button","exports","forwardRef","_ref","ref","children","_ref$active","active","_ref$variant","variant","_ref$size","size","_ref$type","type","_ref$inset","inset","className","args","createElement","StyledButton","classnames","Array","iconOnly","$inset","role","StyledButtonElements","map","value","index","StyledButtonElement","key","displayName"],"sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import React, {\n ComponentPropsWithoutRef,\n forwardRef,\n PropsWithChildren,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledButton,\n StyledButtonElement,\n StyledButtonElements,\n} from \"./Styles\";\n\nexport interface ButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n /** Types of a button. */\n variant?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"option\"\n | \"contained\"\n | \"outlined\"\n | \"text colored\"\n | \"text gray\"\n | \"dark transparent\"\n | \"circle raised\";\n /** Button size dictates the height. */\n size?: \"big\" | \"small\" | \"medium\";\n /** Active or pressed state. */\n active?: boolean;\n /** Empty space an icon only text button keeps around its icon. Use \"tight\" for an icon that draws close to its edges. */\n inset?: \"default\" | \"tight\";\n}\n/**\n * @component Button\n * @description\n * Button component is used to trigger an action or event, such as submitting a form,\n * opening a Dialog, canceling an action, or performing a delete operation.\n *\n * @prop {variant} - adds unique look and feel to button.\n * @prop {size} - controls the size of a button.\n * @prop {active} - adds active/pressed state to a button.\n * @prop {type} - defaults to \"button\"; pass \"submit\" for a form's submit control.\n *\n * @example\n * return (\n * <Button className=\"mr-2\" variant=\"primary\" size=\"big\">\n * Save\n * </Button>\n * )\n * @see\n * https://system.activecollab.com/?path=/story/components-button-indicators-button--button\n * https://design.activecollab.com/docs/components/button\n */\nexport const Button = forwardRef<\n HTMLButtonElement,\n PropsWithChildren<ButtonProps>\n>(\n (\n {\n children,\n active = false,\n variant = \"contained\",\n size = \"medium\",\n type = \"button\",\n inset = \"default\",\n className,\n ...args\n },\n ref\n ) => {\n return (\n <StyledButton\n className={classnames(\"c-btn\", className, {\n \"c-btn--contained\": variant === \"primary\" || variant === \"contained\",\n \"c-btn--outlined\": variant === \"secondary\" || variant === \"outlined\",\n \"c-btn--text_colored\":\n variant === \"tertiary\" || variant === \"text colored\",\n \"c-btn--text_gray\": variant === \"option\" || variant === \"text gray\",\n \"c-btn--dark_transparent\": variant === \"dark transparent\",\n \"c-btn--circle-raised\": variant === \"circle raised\",\n \"c-btn--big\": size === \"big\",\n \"c-btn--small\": size === \"small\",\n \"c-btn--icon-only\":\n children instanceof Object && !(children instanceof Array),\n })}\n iconOnly={children instanceof Object && !(children instanceof Array)}\n variant={variant}\n active={active}\n size={size}\n $inset={inset}\n ref={ref}\n aria-pressed={active}\n role=\"button\"\n type={type}\n {...args}\n >\n {children instanceof Array ? (\n <StyledButtonElements className=\"c-btn__elements\">\n {children.map((value, index) =>\n value ? (\n <StyledButtonElement\n className=\"c-btn__elements__element\"\n key={index}\n >\n {value}\n </StyledButtonElement>\n ) : null\n )}\n </StyledButtonElements>\n ) : (\n children\n )}\n </StyledButton>\n );\n }\n);\n\nButton.displayName = \"Button\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC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5B,cAAc,EAAEA,IAAI,KAAK,OAAO;MAChC,kBAAkB,EAChBN,QAAQ,YAAYnB,MAAM,IAAI,EAAEmB,QAAQ,YAAYgB,KAAK;IAC7D,CAAC,CAAE;IACHC,QAAQ,EAAEjB,QAAQ,YAAYnB,MAAM,IAAI,EAAEmB,QAAQ,YAAYgB,KAAK,CAAE;IACrEZ,OAAO,EAAEA,OAAQ;IACjBF,MAAM,EAAEA,MAAO;IACfI,IAAI,EAAEA,IAAK;IACXY,MAAM,EAAER,KAAM;IACdX,GAAG,EAAEA,GAAI;IACT,gBAAcG,MAAO;IACrBiB,IAAI,EAAC,QAAQ;IACbX,IAAI,EAAEA;EAAK,GACPI,IAAI,GAEPZ,QAAQ,YAAYgB,KAAK,gBACxB3D,MAAA,CAAAS,OAAA,CAAA+C,aAAA,CAACnD,OAAA,CAAA0D,oBAAoB;IAACT,SAAS,EAAC;EAAiB,GAC9CX,QAAQ,CAACqB,GAAG,CAAC,UAACC,KAAK,EAAEC,KAAK;IAAA,OACzBD,KAAK,gBACHjE,MAAA,CAAAS,OAAA,CAAA+C,aAAA,CAACnD,OAAA,CAAA8D,mBAAmB;MAClBb,SAAS,EAAC,0BAA0B;MACpCc,GAAG,EAAEF;IAAM,GAEVD,KACkB,CAAC,GACpB,IAAI;EAAA,CACV,CACoB,CAAC,GAEvBtB,QAEU,CAAC;AAEnB,CACF,CAAC;AAEDL,MAAM,CAAC+B,WAAW,GAAG,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"Button.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_Styles","_excluded","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","Button","exports","forwardRef","_ref","ref","children","_ref$active","active","_ref$variant","variant","_ref$size","size","_ref$type","type","_ref$inset","inset","endAdornment","_ref$endAdornmentInse","endAdornmentInset","className","args","content","Array","createElement","key","style","display","marginRight","StyledButton","classnames","iconOnly","$inset","role","StyledButtonElements","map","value","index","StyledButtonElement","displayName"],"sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import React, {\n ComponentPropsWithoutRef,\n forwardRef,\n PropsWithChildren,\n ReactNode,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledButton,\n StyledButtonElement,\n StyledButtonElements,\n} from \"./Styles\";\n\nexport interface ButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n /** Types of a button. */\n variant?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"option\"\n | \"contained\"\n | \"outlined\"\n | \"text colored\"\n | \"text gray\"\n | \"dark transparent\"\n | \"circle raised\";\n /** Button size dictates the height. */\n size?: \"big\" | \"small\" | \"medium\";\n /** Active or pressed state. */\n active?: boolean;\n /** Empty space an icon only text button keeps around its icon. Use \"tight\" for an icon that draws close to its edges. */\n inset?: \"default\" | \"tight\";\n /** Node drawn after the label, for example a caret or a spinner. */\n endAdornment?: ReactNode;\n /**\n * Pixels the end adornment is pulled back by. A glyph carries whitespace inside its own box,\n * which makes that side of the button look wider. Pull it back by that whitespace to even the\n * two sides. The caret needs about 5.\n */\n endAdornmentInset?: number;\n}\n/**\n * @component Button\n * @description\n * Button component is used to trigger an action or event, such as submitting a form,\n * opening a Dialog, canceling an action, or performing a delete operation.\n *\n * @prop {variant} - adds unique look and feel to button.\n * @prop {size} - controls the size of a button.\n * @prop {active} - adds active/pressed state to a button.\n * @prop {type} - defaults to \"button\"; pass \"submit\" for a form's submit control.\n *\n * @example\n * return (\n * <Button className=\"mr-2\" variant=\"primary\" size=\"big\">\n * Save\n * </Button>\n * )\n * @see\n * https://system.activecollab.com/?path=/story/components-button-indicators-button--button\n * https://design.activecollab.com/docs/components/button\n */\nexport const Button = forwardRef<\n HTMLButtonElement,\n PropsWithChildren<ButtonProps>\n>(\n (\n {\n children,\n active = false,\n variant = \"contained\",\n size = \"medium\",\n type = \"button\",\n inset = \"default\",\n endAdornment,\n endAdornmentInset = 0,\n className,\n ...args\n },\n ref\n ) => {\n const content: ReactNode = endAdornment\n ? [\n ...(children instanceof Array ? children : [children]),\n <span\n key=\"end-adornment\"\n style={{ display: \"inline-flex\", marginRight: -endAdornmentInset }}\n >\n {endAdornment}\n </span>,\n ]\n : children;\n\n return (\n <StyledButton\n className={classnames(\"c-btn\", className, {\n \"c-btn--contained\": variant === \"primary\" || variant === \"contained\",\n \"c-btn--outlined\": variant === \"secondary\" || variant === \"outlined\",\n \"c-btn--text_colored\":\n variant === \"tertiary\" || variant === \"text colored\",\n \"c-btn--text_gray\": variant === \"option\" || variant === \"text gray\",\n \"c-btn--dark_transparent\": variant === \"dark transparent\",\n \"c-btn--circle-raised\": variant === \"circle raised\",\n \"c-btn--big\": size === \"big\",\n \"c-btn--small\": size === \"small\",\n \"c-btn--icon-only\":\n content instanceof Object && !(content instanceof Array),\n })}\n iconOnly={content instanceof Object && !(content instanceof Array)}\n variant={variant}\n active={active}\n size={size}\n $inset={inset}\n ref={ref}\n aria-pressed={active}\n role=\"button\"\n type={type}\n {...args}\n >\n {content instanceof Array ? (\n <StyledButtonElements className=\"c-btn__elements\">\n {content.map((value, index) =>\n value ? (\n <StyledButtonElement\n className=\"c-btn__elements__element\"\n key={index}\n >\n {value}\n </StyledButtonElement>\n ) : null\n )}\n </StyledButtonElements>\n ) : (\n content\n )}\n </StyledButton>\n );\n }\n);\n\nButton.displayName = \"Button\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AAIkB,IAAAI,SAAA;AAAA,SAAAF,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAA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0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _Styles = require("./Styles");
10
+ var _Icons = require("../Icons");
11
+ var _excluded = ["children", "className"];
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
14
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
15
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
16
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
17
+ var CARET_SIZE = 16;
18
+
19
+ // The caret sits in a 24 unit box and its shape is 10 units wide, so about 5px of its box is air.
20
+ var CARET_INSET = 5;
21
+ /**
22
+ * @component CaretButton
23
+ * @description
24
+ * A button that opens something: a menu, a picker, a panel. It always draws a caret after its
25
+ * label, pulls that caret back by the whitespace inside its own box, and keeps four more pixels
26
+ * on each side than a plain button. Both sides then look the same.
27
+ *
28
+ * @example
29
+ * return (
30
+ * <CaretButton variant="text gray" onClick={openMenu}>
31
+ * <ToolsIcon />
32
+ * Tools
33
+ * </CaretButton>
34
+ * )
35
+ */
36
+ var CaretButton = exports.CaretButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
37
+ var children = _ref.children,
38
+ className = _ref.className,
39
+ rest = _objectWithoutProperties(_ref, _excluded);
40
+ return /*#__PURE__*/_react.default.createElement(_Styles.StyledCaretButton, _extends({
41
+ ref: ref,
42
+ className: (0, _classnames.default)("c-caret-btn", className),
43
+ endAdornment: /*#__PURE__*/_react.default.createElement(_Icons.CollapseExpandSingleIcon, {
44
+ width: CARET_SIZE,
45
+ height: CARET_SIZE,
46
+ className: "tw-rotate-180"
47
+ }),
48
+ endAdornmentInset: CARET_INSET
49
+ }, rest), children);
50
+ });
51
+ CaretButton.displayName = "CaretButton";
52
+ //# sourceMappingURL=CaretButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CaretButton.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_Styles","_Icons","_excluded","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","CARET_SIZE","CARET_INSET","CaretButton","exports","forwardRef","_ref","ref","children","className","rest","createElement","StyledCaretButton","classnames","endAdornment","CollapseExpandSingleIcon","width","height","endAdornmentInset","displayName"],"sources":["../../../../src/components/CaretButton/CaretButton.tsx"],"sourcesContent":["import React, { forwardRef, PropsWithChildren } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { StyledCaretButton } from \"./Styles\";\nimport { ButtonProps } from \"../Button\";\nimport { CollapseExpandSingleIcon } from \"../Icons\";\n\nconst CARET_SIZE = 16;\n\n// The caret sits in a 24 unit box and its shape is 10 units wide, so about 5px of its box is air.\nconst CARET_INSET = 5;\n\nexport type CaretButtonProps = Omit<\n ButtonProps,\n \"endAdornment\" | \"endAdornmentInset\"\n>;\n\n/**\n * @component CaretButton\n * @description\n * A button that opens something: a menu, a picker, a panel. It always draws a caret after its\n * label, pulls that caret back by the whitespace inside its own box, and keeps four more pixels\n * on each side than a plain button. Both sides then look the same.\n *\n * @example\n * return (\n * <CaretButton variant=\"text gray\" onClick={openMenu}>\n * <ToolsIcon />\n * Tools\n * </CaretButton>\n * )\n */\nexport const CaretButton = forwardRef<\n HTMLButtonElement,\n PropsWithChildren<CaretButtonProps>\n>(({ children, className, ...rest }, ref) => (\n <StyledCaretButton\n ref={ref}\n className={classnames(\"c-caret-btn\", className)}\n endAdornment={\n <CollapseExpandSingleIcon\n width={CARET_SIZE}\n height={CARET_SIZE}\n className=\"tw-rotate-180\"\n />\n }\n endAdornmentInset={CARET_INSET}\n {...rest}\n >\n {children}\n </StyledCaretButton>\n));\n\nCaretButton.displayName = \"CaretButton\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AAAoD,IAAAK,SAAA;AAAA,SAAAH,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,wBAAAO,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAA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MAAA,CAAAU,OAAA,CAAAuC,aAAA,CAAC3C,MAAA,CAAA+C,wBAAwB;MACvBC,KAAK,EAAEf,UAAW;MAClBgB,MAAM,EAAEhB,UAAW;MACnBQ,SAAS,EAAC;IAAe,CAC1B,CACF;IACDS,iBAAiB,EAAEhB;EAAY,GAC3BQ,IAAI,GAEPF,QACgB,CAAC;AAAA,CACrB,CAAC;AAEFL,WAAW,CAACgB,WAAW,GAAG,aAAa","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledCaretButton = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ var _Button = require("../Button");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ // A caret button carries four more pixels on each side than a plain button, so the caret does
11
+ // not crowd the edge.
12
+ var StyledCaretButton = exports.StyledCaretButton = (0, _styledComponents.default)(_Button.Button).withConfig({
13
+ displayName: "Styles__StyledCaretButton",
14
+ componentId: "sc-11aoinc-0"
15
+ })(["", ""], {
16
+ "paddingLeft": "0.75rem",
17
+ "paddingRight": "0.75rem"
18
+ });
19
+ StyledCaretButton.displayName = "StyledCaretButton";
20
+ //# sourceMappingURL=Styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireDefault","require","_Button","e","__esModule","default","StyledCaretButton","exports","styled","Button","withConfig","displayName","componentId"],"sources":["../../../../src/components/CaretButton/Styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { Button } from \"../Button\";\n\n// A caret button carries four more pixels on each side than a plain button, so the caret does\n// not crowd the edge.\nexport const StyledCaretButton = styled(Button)`\n ${tw`tw-px-3`}\n`;\n\nStyledCaretButton.displayName = \"StyledCaretButton\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AAAmC,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnC;AACA;AACO,IAAMG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAAE,yBAAM,EAACC,cAAM,CAAC,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aACzC;EAAA;EAAA;AAAQ,CAAC,CACd;AAEDN,iBAAiB,CAACK,WAAW,GAAG,mBAAmB","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _CaretButton = require("./CaretButton");
7
+ Object.keys(_CaretButton).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _CaretButton[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _CaretButton[key];
14
+ }
15
+ });
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_CaretButton","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../../src/components/CaretButton/index.ts"],"sourcesContent":["export * from \"./CaretButton\";\n"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,YAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,YAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -12,7 +12,13 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
12
12
  /**
13
13
  * `default` is the page look: paper shadow, outer margins, uppercase header.
14
14
  * `plain` is the in-dialog look: the table sits flush in the content it is
15
- * dropped into.
15
+ * dropped into, with a quiet header that lines up with the cells below it.
16
+ */
17
+
18
+ /**
19
+ * The look of the table.
20
+ * `1` is the plain one this component always drew.
21
+ * `2` is the card: a border around the whole table, a shaded header band and a line between rows.
16
22
  */
17
23
 
18
24
  var StyledTableHead = exports.StyledTableHead = _styledComponents.default.thead.withConfig({
@@ -64,7 +70,7 @@ StyledTableBody.displayName = "StyledTableBody";
64
70
  var StyledTableWrapper = exports.StyledTableWrapper = _styledComponents.default.div.withConfig({
65
71
  displayName: "Styles__StyledTableWrapper",
66
72
  componentId: "sc-e16t6w-2"
67
- })(["", " ", " ", " ", ""], _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle, {
73
+ })(["", " ", " ", " ", " ", ""], _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle, {
68
74
  "overflowX": "auto",
69
75
  "overflowY": "hidden"
70
76
  }, function (props) {
@@ -83,12 +89,19 @@ var StyledTableWrapper = exports.StyledTableWrapper = _styledComponents.default.
83
89
  "--tw-shadow-colored": "0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color)",
84
90
  "boxShadow": "var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)"
85
91
  });
92
+ }, function (props) {
93
+ return props.$appearance === 2 && (0, _styledComponents.css)(["", " border-color:var(--border-primary);background-color:var(--page-paper-main);"], {
94
+ "overflow": "hidden",
95
+ "borderRadius": "0.5rem",
96
+ "borderWidth": "1px",
97
+ "borderStyle": "solid"
98
+ });
86
99
  });
87
100
  StyledTableWrapper.displayName = "StyledTableWrapper";
88
101
  var StyledTable = exports.StyledTable = _styledComponents.default.table.withConfig({
89
102
  displayName: "Styles__StyledTable",
90
103
  componentId: "sc-e16t6w-3"
91
- })(["", " border-spacing:0;", " ", " td{", "}", ""], {
104
+ })(["", " border-spacing:0;", " ", " td{", "}", " ", ""], {
92
105
  "width": "100%",
93
106
  "padding": "0px",
94
107
  "paddingBottom": "1rem",
@@ -99,14 +112,63 @@ var StyledTable = exports.StyledTable = _styledComponents.default.table.withConf
99
112
  "textAlign": "right"
100
113
  });
101
114
  }, function (props) {
102
- return props.$variant === "plain" && (0, _styledComponents.css)([".c-table__head{", "}"], {
103
- "textTransform": "none"
115
+ return props.$variant === "plain" && (0, _styledComponents.css)(["", " .c-table__head{", " th{", "}tr th:first-child{", "}}.c-table__row td{", "}"], {
116
+ "fontSize": "0.875rem",
117
+ "lineHeight": "1.25rem"
118
+ }, {
119
+ "fontSize": "0.75rem",
120
+ "lineHeight": "1rem",
121
+ "textTransform": "none",
122
+ "color": "var(--color-theme-600)"
123
+ }, {
124
+ "paddingLeft": "1rem",
125
+ "paddingRight": "1rem",
126
+ "paddingBottom": "0.5rem",
127
+ "paddingTop": "0px",
128
+ "fontWeight": "500"
129
+ }, {
130
+ "paddingLeft": "1rem"
131
+ }, {
132
+ "paddingTop": "0.625rem",
133
+ "paddingBottom": "0.625rem",
134
+ "color": "var(--color-theme-900)"
104
135
  });
105
136
  }, {
106
137
  "paddingLeft": "1rem",
107
138
  "paddingRight": "1rem",
108
139
  "paddingTop": "0.75rem",
109
140
  "paddingBottom": "0.75rem"
141
+ }, function (props) {
142
+ return props.$appearance === 2 && (0, _styledComponents.css)(["", " border-collapse:collapse;.c-table__head{", " background-color:var(--color-theme-300);color:var(--color-theme-600);th{", "}tr th:first-child{", "}}.c-table__row td{", " border-color:var(--border-primary);color:var(--color-theme-900);background-color:transparent;}"], {
143
+ "width": "100%",
144
+ "tableLayout": "fixed",
145
+ "fontSize": "0.875rem",
146
+ "lineHeight": "1.25rem"
147
+ }, {
148
+ "fontSize": "0.75rem",
149
+ "lineHeight": "1rem",
150
+ "textTransform": "none"
151
+ }, {
152
+ "height": "2.25rem",
153
+ "paddingLeft": "1rem",
154
+ "paddingRight": "1rem",
155
+ "paddingTop": "0px",
156
+ "paddingBottom": "0px",
157
+ "verticalAlign": "middle",
158
+ "fontWeight": "500"
159
+ }, {
160
+ "paddingLeft": "1rem"
161
+ }, {
162
+ "height": "2.5rem",
163
+ "borderWidth": "0px",
164
+ "borderTopWidth": "1px",
165
+ "borderStyle": "solid",
166
+ "paddingLeft": "1rem",
167
+ "paddingRight": "1rem",
168
+ "paddingTop": "0px",
169
+ "paddingBottom": "0px",
170
+ "verticalAlign": "middle"
171
+ });
110
172
  }, function (props) {
111
173
  return props.$striped && (0, _styledComponents.css)(["", ":not(.c-table__grouped__head){tr:nth-child(odd){", "}}"], StyledTableBody, {
112
174
  "backgroundColor": "var(--color-theme-200)"
@@ -116,7 +178,7 @@ StyledTable.displayName = "StyledTable";
116
178
  var StyledDataTable = exports.StyledDataTable = _styledComponents.default.div.withConfig({
117
179
  displayName: "Styles__StyledDataTable",
118
180
  componentId: "sc-e16t6w-4"
119
- })(["", " ", " &.c-table__collapsible{.c-table__head{tr{th{position:sticky;top:0;z-index:1;}}}}&.c-table__grouped{.c-table__head th{", " &:last-child{", "}}}&.c-data-table{position:relative;.c-table__head th{&:last-child{", "}}}.c-table__cell{", " &:hover{.c-table__icon{", "}}}.c-table__overlay{", " top:0px;border-top-left-radius:8px;border-top-right-radius:8px;background:rgba(0,0,0,0.02);", " &{background:rgba(0,0,0,0.1);}z-index:5;}.c-table__icon-wrapper{", "}.c-table__label{", "}.c-table__icon{transform:translateY(1px);", " fill:var(--color-theme-900);&:hover{", "}}.c-table__icon--inactive{", "}.c-table__icon--active{", "}.c-table__icon--desc{transform:rotate(-180deg) scale(-1,1);}.c-table__grouped__head{", " > :first-child{", "}a:first-child{", "}}.c-table__head--hidden{", "}.c-table__collapse_icon--expanded{transition-duration:0.3s;", "}.c-table__collapse_icon--collapsed{transform:rotate(180deg);transition-duration:0.3s;", "}.c-table__head__icon-wrapper__icon{", " transform:translate(-24px,-5px);}&.c-table__collapsible{.c-table__group{.c-table__row:last-child .c-table__cell{border-bottom:1px solid var(--border-primary);}&:last-child{.c-table__row:last-child .c-table__cell{border-bottom:0;}}}.c-table__grouped__head{tr td{border-bottom:1px solid var(--border-primary);}.c-table__body__collapse td{border-bottom:0;}&.last{tr td{border-bottom:0 !important;}}}.c-table__grouped__head--expanded{tr:last-child td{border-bottom:0;}}}.c-table__collapse_body{tr{background-color:transparent !important;}td:last-child{", "}", "}.c-table__row{td:first-child{position:sticky;left:0;z-index:1;}&:nth-child(odd){td{", "}}&:nth-child(even){td{", "}}}.c-table__row{th:first-child{position:sticky;left:0;z-index:2 !important;}}&.c-table__collapsible .c-table__body{tr{td:first-child,th:first-child{", "}}}.c-table__body__icon{", " padding-left:0 !important;transform:translateY(8px);}&.padding-b-0{", "}.cursor-pointer{", "}.text-center{", "}.opacity-75{", "}.hidden{", "}"], _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle, {
181
+ })(["", " ", " &.c-table__collapsible{.c-table__head{tr{th{position:sticky;top:0;z-index:1;}}}}&.c-table__grouped{.c-table__head th{", " &:last-child{", "}}}&.c-data-table{position:relative;.c-table__head th{&:last-child{", "}}}.c-table__cell{", " &:hover{.c-table__icon{", "}}}.c-table__overlay{", " top:0px;border-top-left-radius:8px;border-top-right-radius:8px;background:rgba(0,0,0,0.02);", " &{background:rgba(0,0,0,0.1);}z-index:5;}.c-table__icon-wrapper{", "}.c-table__label{", "}.c-table__icon{transform:translateY(1px);", " fill:var(--color-theme-900);&:hover{", "}}.c-table__icon--inactive{", "}.c-table__icon--active{", "}.c-table__icon--desc{transform:rotate(-180deg) scale(-1,1);}.c-table__grouped__head{", " > :first-child{", "}a:first-child{", "}}.c-table__head--hidden{", "}.c-table__collapse_icon--expanded{transition-duration:0.3s;", "}.c-table__collapse_icon--collapsed{transform:rotate(180deg);transition-duration:0.3s;", "}.c-table__head__icon-wrapper__icon{", " transform:translate(-24px,-5px);}&.c-table__collapsible{.c-table__group{.c-table__row:last-child .c-table__cell{border-bottom:1px solid var(--border-primary);}&:last-child{.c-table__row:last-child .c-table__cell{border-bottom:0;}}}.c-table__grouped__head{tr td{border-bottom:1px solid var(--border-primary);}.c-table__body__collapse td{border-bottom:0;}&.last{tr td{border-bottom:0 !important;}}}.c-table__grouped__head--expanded{tr:last-child td{border-bottom:0;}}}.c-table__collapse_body{tr{background-color:transparent !important;}td:last-child{", "}", "}.c-table__row{td:first-child{position:sticky;left:0;z-index:1;}}&:not(.c-table--plain){.c-table__row{&:nth-child(odd){td{", "}}&:nth-child(even){td{", "}}}}.c-table__row{th:first-child{position:sticky;left:0;z-index:2 !important;}}&.c-table__collapsible .c-table__body{tr{td:first-child,th:first-child{", "}}}.c-table__body__icon{", " padding-left:0 !important;transform:translateY(8px);}&.padding-b-0{", "}.cursor-pointer{", "}.text-center{", "}.opacity-75{", "}.hidden{", "}"], _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle, {
120
182
  "paddingBottom": "1rem"
121
183
  }, {
122
184
  "paddingRight": "0px"
@@ -1 +1 @@
1
- {"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_themes","_BoxSizingStyle","_FontStyle","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledTableHead","exports","styled","thead","withConfig","displayName","componentId","FontStyle","BoxSizingStyle","props","$headerVariant","css","StyledTableBody","tbody","StyledTableWrapper","div","$variant","StyledTable","table","$striped","StyledDataTable","DARK_THEME_SELECTOR"],"sources":["../../../../src/components/Tables/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { DARK_THEME_SELECTOR } from \"../../utils/themes\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\n/**\n * `default` is the page look: paper shadow, outer margins, uppercase header.\n * `plain` is the in-dialog look: the table sits flush in the content it is\n * dropped into.\n */\nexport type TableVariant = \"default\" | \"plain\";\n\nexport const StyledTableHead = styled.thead<{\n $headerVariant: \"primary\" | \"secondary\";\n}>`\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${tw`tw-text-left tw-uppercase`}\n ${tw`tw-text-theme-700 tw-font-semibold tw-text-xxs`}\n\n ${(props) =>\n props.$headerVariant &&\n props.$headerVariant === \"primary\" &&\n css`\n th {\n ${tw`tw-whitespace-nowrap tw-pl-4 tw-pr-4 tw-pb-8 tw-pt-2`}\n }\n\n tr {\n td:first-child,\n th:first-child {\n ${tw`tw-pl-6`}\n }\n }\n `}\n\n ${(props) =>\n props.$headerVariant &&\n props.$headerVariant === \"secondary\" &&\n css`\n th {\n ${tw`tw-whitespace-nowrap`}\n }\n\n tr {\n th {\n padding-bottom: 8px;\n padding-left: 16px;\n }\n }\n\n tr {\n th:last-child {\n padding-right: 16px;\n }\n }\n `}\n`;\nStyledTableHead.displayName = \"StyledTableHead\";\n\nexport const StyledTableBody = styled.tbody`\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${tw`tw-truncate`}\n\n td {\n ${tw`tw-truncate`}\n }\n\n &:not(.c-table__grouped__head) {\n td {\n ${tw`tw-text-theme-700`}\n }\n }\n\n a {\n ${tw`tw-no-underline tw-text-primary`}\n &:hover {\n ${tw`tw-underline`}\n }\n }\n`;\nStyledTableBody.displayName = \"StyledTableBody\";\n\nexport const StyledTableWrapper = styled.div<{\n $variant: TableVariant;\n}>`\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${tw`tw-overflow-x-auto tw-overflow-y-hidden`}\n\n ${(props) =>\n props.$variant === \"default\" &&\n css`\n ${tw`tw-mt-8 tw-mx-4`}\n\n &:before {\n ${tw`tw-absolute tw-left-0 tw-right-0 tw-bottom-0 tw-bg-page-paper-main tw-rounded-lg tw-shadow-lg`}\n content: \"\";\n top: 39px;\n z-index: -1;\n }\n `}\n`;\nStyledTableWrapper.displayName = \"StyledTableWrapper\";\n\nexport const StyledTable = styled.table<{\n $striped: boolean;\n $variant: TableVariant;\n}>`\n ${tw`tw-w-full tw-p-0 tw-text-xs tw-pb-4`}\n border-spacing: 0;\n\n ${(props) =>\n props.$variant === \"default\" &&\n css`\n ${StyledTableHead} tr th,\n ${StyledTableBody} tr td {\n &:last-child {\n ${tw`tw-text-right`}\n }\n }\n `}\n\n ${(props) =>\n props.$variant === \"plain\" &&\n css`\n .c-table__head {\n ${tw`tw-normal-case`}\n }\n `}\n\n td {\n ${tw`tw-py-3 tw-px-4`}\n }\n\n ${(props) =>\n props.$striped &&\n css`\n ${StyledTableBody}:not(.c-table__grouped__head) {\n tr:nth-child(odd) {\n ${tw`tw-bg-theme-200`}\n }\n }\n `}\n`;\nStyledTable.displayName = \"StyledTable\";\n\nexport const StyledDataTable = styled.div`\n ${FontStyle}\n ${BoxSizingStyle}\n\n &.c-table__collapsible {\n .c-table__head {\n tr {\n th {\n position: sticky;\n top: 0;\n z-index: 1;\n }\n }\n }\n }\n &.c-table__grouped {\n .c-table__head th {\n ${tw`tw-pb-4`}\n &:last-child {\n ${tw`tw-pr-0`}\n }\n }\n }\n &.c-data-table {\n position: relative;\n .c-table__head th {\n &:last-child {\n ${tw`tw-pr-0`}\n }\n }\n }\n .c-table__cell {\n ${tw`tw-relative`}\n &:hover {\n .c-table__icon {\n ${tw`tw-opacity-50`}\n }\n }\n }\n .c-table__overlay {\n ${tw`tw-absolute tw-w-full tw-left-0 tw-pointer-events-none`}\n top: 0px;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n background: rgba(0, 0, 0, 0.02);\n ${DARK_THEME_SELECTOR} & {\n background: rgba(0, 0, 0, 0.1);\n }\n z-index: 5;\n }\n .c-table__icon-wrapper {\n ${tw`tw-inline-block tw-select-none`}\n }\n .c-table__label {\n ${tw`tw-border-0 tw-border-0 tw-border-transparent tw-border-solid`}\n }\n .c-table__icon {\n transform: translateY(1px);\n ${tw`tw-ml-1`}\n fill: var(--color-theme-900);\n\n &:hover {\n ${tw`tw-opacity-100`}\n }\n }\n .c-table__icon--inactive {\n ${tw`tw-opacity-0`}\n }\n .c-table__icon--active {\n ${tw`tw-opacity-100`}\n }\n .c-table__icon--desc {\n transform: rotate(-180deg) scale(-1, 1);\n }\n .c-table__grouped__head {\n ${tw`tw-font-bold`}\n > :first-child {\n ${tw`tw-text-theme-900`}\n }\n a:first-child {\n ${tw`tw-text-primary`}\n }\n }\n .c-table__head--hidden {\n ${tw`tw-pointer-events-none tw-opacity-0`}\n }\n .c-table__collapse_icon--expanded {\n transition-duration: 0.3s;\n ${tw`tw-cursor-pointer`}\n }\n .c-table__collapse_icon--collapsed {\n transform: rotate(180deg);\n transition-duration: 0.3s;\n ${tw`tw-cursor-pointer`}\n }\n .c-table__head__icon-wrapper__icon {\n ${tw`tw-absolute tw-cursor-pointer`}\n transform: translate(-24px, -5px);\n }\n &.c-table__collapsible {\n .c-table__group {\n .c-table__row:last-child .c-table__cell {\n border-bottom: 1px solid var(--border-primary);\n }\n &:last-child {\n .c-table__row:last-child .c-table__cell {\n border-bottom: 0;\n }\n }\n }\n .c-table__grouped__head {\n tr td {\n border-bottom: 1px solid var(--border-primary);\n }\n .c-table__body__collapse td {\n border-bottom: 0;\n }\n &.last {\n tr td {\n border-bottom: 0 !important;\n }\n }\n }\n .c-table__grouped__head--expanded {\n tr:last-child td {\n border-bottom: 0;\n }\n }\n }\n .c-table__collapse_body {\n tr {\n background-color: transparent !important;\n }\n td:last-child {\n ${tw`tw-border-0`}\n }\n ${tw`tw-absolute`}\n }\n .c-table__row {\n td:first-child {\n position: sticky;\n left: 0;\n z-index: 1;\n }\n &:nth-child(odd) {\n td {\n ${tw`tw-bg-theme-200`}\n }\n }\n &:nth-child(even) {\n td {\n ${tw`tw-bg-page-paper-main`}\n }\n }\n }\n .c-table__row {\n th:first-child {\n position: sticky;\n left: 0;\n z-index: 2 !important;\n }\n }\n &.c-table__collapsible .c-table__body {\n tr {\n td:first-child,\n th:first-child {\n ${tw`tw-pl-6`}\n }\n }\n }\n .c-table__body__icon {\n ${tw`tw-p-0`}\n padding-left: 0 !important;\n transform: translateY(8px);\n }\n &.padding-b-0 {\n ${tw`tw-pb-0`}\n }\n .cursor-pointer {\n ${tw`tw-cursor-pointer`}\n }\n .text-center {\n ${tw`tw-text-center`}\n }\n .opacity-75 {\n ${tw`tw-opacity-75`}\n }\n .hidden {\n ${tw`tw-hidden`}\n }\n`;\nStyledDataTable.displayName = \"StyledDataTable\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAAyC,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,wBAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,CAAAK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C,EAGT;EAAA;AAAc,CAAC,EAKnB;EAAA;EAAA;EAAA;EAAA;AAAuD,CAAC,EAK1Da,2BAAmB,EAMjB;EAAA;EAAA;AAA+B,CAAC,EAGhC;EAAA;EAAA;EAAA;AAA8D,CAAC,EAI/D;EAAA;AAAQ,CAAC,EAIP;EAAA;AAAe,CAAC,EAIlB;EAAA;AAAa,CAAC,EAGd;EAAA;AAAe,CAAC,EAMhB;EAAA;AAAa,CAAC,EAEZ;EAAA;AAAkB,CAAC,EAGnB;EAAA;AAAgB,CAAC,EAInB;EAAA;EAAA;AAAoC,CAAC,EAIrC;EAAA;AAAkB,CAAC,EAKnB;EAAA;AAAkB,CAAC,EAGnB;EAAA;EAAA;AAA8B,CAAC,EAsC7B;EAAA;AAAY,CAAC,EAEf;EAAA;AAAY,CAAC,EAUT;EAAA;AAAgB,CAAC,EAKjB;EAAA;AAAsB,CAAC,EAevB;EAAA;AAAQ,CAAC,EAKb;EAAA;AAAO,CAAC,EAKR;EAAA;AAAQ,CAAC,EAGT;EAAA;AAAkB,CAAC,EAGnB;EAAA;AAAe,CAAC,EAGhB;EAAA;AAAc,CAAC,EAGf;EAAA;AAAU,CAAC,CAElB;AACDD,eAAe,CAACf,WAAW,GAAG,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_themes","_BoxSizingStyle","_FontStyle","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledTableHead","exports","styled","thead","withConfig","displayName","componentId","FontStyle","BoxSizingStyle","props","$headerVariant","css","StyledTableBody","tbody","StyledTableWrapper","div","$variant","$appearance","StyledTable","table","$striped","StyledDataTable","DARK_THEME_SELECTOR"],"sources":["../../../../src/components/Tables/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { DARK_THEME_SELECTOR } from \"../../utils/themes\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\n/**\n * `default` is the page look: paper shadow, outer margins, uppercase header.\n * `plain` is the in-dialog look: the table sits flush in the content it is\n * dropped into, with a quiet header that lines up with the cells below it.\n */\nexport type TableVariant = \"default\" | \"plain\";\n\n/**\n * The look of the table.\n * `1` is the plain one this component always drew.\n * `2` is the card: a border around the whole table, a shaded header band and a line between rows.\n */\nexport type TableAppearance = 1 | 2;\n\nexport const StyledTableHead = styled.thead<{\n $headerVariant: \"primary\" | \"secondary\";\n}>`\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${tw`tw-text-left tw-uppercase`}\n ${tw`tw-text-theme-700 tw-font-semibold tw-text-xxs`}\n\n ${(props) =>\n props.$headerVariant &&\n props.$headerVariant === \"primary\" &&\n css`\n th {\n ${tw`tw-whitespace-nowrap tw-pl-4 tw-pr-4 tw-pb-8 tw-pt-2`}\n }\n\n tr {\n td:first-child,\n th:first-child {\n ${tw`tw-pl-6`}\n }\n }\n `}\n\n ${(props) =>\n props.$headerVariant &&\n props.$headerVariant === \"secondary\" &&\n css`\n th {\n ${tw`tw-whitespace-nowrap`}\n }\n\n tr {\n th {\n padding-bottom: 8px;\n padding-left: 16px;\n }\n }\n\n tr {\n th:last-child {\n padding-right: 16px;\n }\n }\n `}\n`;\nStyledTableHead.displayName = \"StyledTableHead\";\n\nexport const StyledTableBody = styled.tbody`\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${tw`tw-truncate`}\n\n td {\n ${tw`tw-truncate`}\n }\n\n &:not(.c-table__grouped__head) {\n td {\n ${tw`tw-text-theme-700`}\n }\n }\n\n a {\n ${tw`tw-no-underline tw-text-primary`}\n &:hover {\n ${tw`tw-underline`}\n }\n }\n`;\nStyledTableBody.displayName = \"StyledTableBody\";\n\nexport const StyledTableWrapper = styled.div<{\n $variant: TableVariant;\n $appearance: TableAppearance;\n}>`\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${tw`tw-overflow-x-auto tw-overflow-y-hidden`}\n\n ${(props) =>\n props.$variant === \"default\" &&\n css`\n ${tw`tw-mt-8 tw-mx-4`}\n\n &:before {\n ${tw`tw-absolute tw-left-0 tw-right-0 tw-bottom-0 tw-bg-page-paper-main tw-rounded-lg tw-shadow-lg`}\n content: \"\";\n top: 39px;\n z-index: -1;\n }\n `}\n\n ${(props) =>\n props.$appearance === 2 &&\n css`\n ${tw`tw-overflow-hidden tw-rounded-lg tw-border tw-border-solid`}\n border-color: var(--border-primary);\n background-color: var(--page-paper-main);\n `}\n`;\nStyledTableWrapper.displayName = \"StyledTableWrapper\";\n\nexport const StyledTable = styled.table<{\n $striped: boolean;\n $variant: TableVariant;\n $appearance: TableAppearance;\n}>`\n ${tw`tw-w-full tw-p-0 tw-text-xs tw-pb-4`}\n border-spacing: 0;\n\n ${(props) =>\n props.$variant === \"default\" &&\n css`\n ${StyledTableHead} tr th,\n ${StyledTableBody} tr td {\n &:last-child {\n ${tw`tw-text-right`}\n }\n }\n `}\n\n ${(props) =>\n props.$variant === \"plain\" &&\n css`\n ${tw`tw-text-sm`}\n\n .c-table__head {\n ${tw`tw-normal-case tw-text-theme-600 tw-text-xs`}\n\n th {\n ${tw`tw-pt-0 tw-pb-2 tw-px-4 tw-font-medium`}\n }\n\n tr th:first-child {\n ${tw`tw-pl-4`}\n }\n }\n\n .c-table__row td {\n ${tw`tw-py-2.5 tw-text-theme-900`}\n }\n `}\n\n td {\n ${tw`tw-py-3 tw-px-4`}\n }\n\n ${(props) =>\n props.$appearance === 2 &&\n css`\n ${tw`tw-w-full tw-table-fixed tw-text-sm`}\n border-collapse: collapse;\n\n .c-table__head {\n ${tw`tw-normal-case tw-text-xs`}\n background-color: var(--color-theme-300);\n color: var(--color-theme-600);\n\n th {\n ${tw`tw-h-9 tw-px-4 tw-py-0 tw-align-middle tw-font-medium`}\n }\n\n tr th:first-child {\n ${tw`tw-pl-4`}\n }\n }\n\n .c-table__row td {\n ${tw`tw-h-10 tw-border-0 tw-border-t tw-border-solid tw-px-4 tw-py-0 tw-align-middle`}\n border-color: var(--border-primary);\n color: var(--color-theme-900);\n background-color: transparent;\n }\n `}\n\n ${(props) =>\n props.$striped &&\n css`\n ${StyledTableBody}:not(.c-table__grouped__head) {\n tr:nth-child(odd) {\n ${tw`tw-bg-theme-200`}\n }\n }\n `}\n`;\nStyledTable.displayName = \"StyledTable\";\n\nexport const StyledDataTable = styled.div`\n ${FontStyle}\n ${BoxSizingStyle}\n\n &.c-table__collapsible {\n .c-table__head {\n tr {\n th {\n position: sticky;\n top: 0;\n z-index: 1;\n }\n }\n }\n }\n &.c-table__grouped {\n .c-table__head th {\n ${tw`tw-pb-4`}\n &:last-child {\n ${tw`tw-pr-0`}\n }\n }\n }\n &.c-data-table {\n position: relative;\n .c-table__head th {\n &:last-child {\n ${tw`tw-pr-0`}\n }\n }\n }\n .c-table__cell {\n ${tw`tw-relative`}\n &:hover {\n .c-table__icon {\n ${tw`tw-opacity-50`}\n }\n }\n }\n .c-table__overlay {\n ${tw`tw-absolute tw-w-full tw-left-0 tw-pointer-events-none`}\n top: 0px;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n background: rgba(0, 0, 0, 0.02);\n ${DARK_THEME_SELECTOR} & {\n background: rgba(0, 0, 0, 0.1);\n }\n z-index: 5;\n }\n .c-table__icon-wrapper {\n ${tw`tw-inline-block tw-select-none`}\n }\n .c-table__label {\n ${tw`tw-border-0 tw-border-0 tw-border-transparent tw-border-solid`}\n }\n .c-table__icon {\n transform: translateY(1px);\n ${tw`tw-ml-1`}\n fill: var(--color-theme-900);\n\n &:hover {\n ${tw`tw-opacity-100`}\n }\n }\n .c-table__icon--inactive {\n ${tw`tw-opacity-0`}\n }\n .c-table__icon--active {\n ${tw`tw-opacity-100`}\n }\n .c-table__icon--desc {\n transform: rotate(-180deg) scale(-1, 1);\n }\n .c-table__grouped__head {\n ${tw`tw-font-bold`}\n > :first-child {\n ${tw`tw-text-theme-900`}\n }\n a:first-child {\n ${tw`tw-text-primary`}\n }\n }\n .c-table__head--hidden {\n ${tw`tw-pointer-events-none tw-opacity-0`}\n }\n .c-table__collapse_icon--expanded {\n transition-duration: 0.3s;\n ${tw`tw-cursor-pointer`}\n }\n .c-table__collapse_icon--collapsed {\n transform: rotate(180deg);\n transition-duration: 0.3s;\n ${tw`tw-cursor-pointer`}\n }\n .c-table__head__icon-wrapper__icon {\n ${tw`tw-absolute tw-cursor-pointer`}\n transform: translate(-24px, -5px);\n }\n &.c-table__collapsible {\n .c-table__group {\n .c-table__row:last-child .c-table__cell {\n border-bottom: 1px solid var(--border-primary);\n }\n &:last-child {\n .c-table__row:last-child .c-table__cell {\n border-bottom: 0;\n }\n }\n }\n .c-table__grouped__head {\n tr td {\n border-bottom: 1px solid var(--border-primary);\n }\n .c-table__body__collapse td {\n border-bottom: 0;\n }\n &.last {\n tr td {\n border-bottom: 0 !important;\n }\n }\n }\n .c-table__grouped__head--expanded {\n tr:last-child td {\n border-bottom: 0;\n }\n }\n }\n .c-table__collapse_body {\n tr {\n background-color: transparent !important;\n }\n td:last-child {\n ${tw`tw-border-0`}\n }\n ${tw`tw-absolute`}\n }\n .c-table__row {\n td:first-child {\n position: sticky;\n left: 0;\n z-index: 1;\n }\n }\n /* The in-dialog table sits on one surface, so its rows keep the paper behind them. */\n &:not(.c-table--plain) {\n .c-table__row {\n &:nth-child(odd) {\n td {\n ${tw`tw-bg-theme-200`}\n }\n }\n &:nth-child(even) {\n td {\n ${tw`tw-bg-page-paper-main`}\n }\n }\n }\n }\n .c-table__row {\n th:first-child {\n position: sticky;\n left: 0;\n z-index: 2 !important;\n }\n }\n &.c-table__collapsible .c-table__body {\n tr {\n td:first-child,\n th:first-child {\n ${tw`tw-pl-6`}\n }\n }\n }\n .c-table__body__icon {\n ${tw`tw-p-0`}\n padding-left: 0 !important;\n transform: translateY(8px);\n }\n &.padding-b-0 {\n ${tw`tw-pb-0`}\n }\n .cursor-pointer {\n ${tw`tw-cursor-pointer`}\n }\n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,CAAChB,WAAW,GAAG,iBAAiB","ignoreList":[]}
@@ -16,19 +16,24 @@ var Table = exports.Table = function Table(_ref) {
16
16
  striped = _ref$striped === void 0 ? false : _ref$striped,
17
17
  innerRef = _ref.innerRef,
18
18
  _ref$variant = _ref.variant,
19
- variant = _ref$variant === void 0 ? "default" : _ref$variant;
19
+ variant = _ref$variant === void 0 ? "default" : _ref$variant,
20
+ _ref$appearance = _ref.appearance,
21
+ appearance = _ref$appearance === void 0 ? 1 : _ref$appearance;
20
22
  return /*#__PURE__*/_react.default.createElement(_Styles.StyledTableWrapper, {
21
23
  className: (0, _classnames.default)("c-table__wrap", wrapperClassName, {
22
24
  "c-table__wrap--plain": variant === "plain"
23
25
  }),
24
- $variant: variant
26
+ $variant: variant,
27
+ $appearance: appearance
25
28
  }, /*#__PURE__*/_react.default.createElement(_Styles.StyledTable, {
26
29
  ref: innerRef,
27
30
  className: (0, _classnames.default)("c-table", className, {
28
- "c-table--plain": variant === "plain"
31
+ "c-table--plain": variant === "plain",
32
+ "c-table--card": appearance === 2
29
33
  }),
30
34
  $striped: striped,
31
- $variant: variant
35
+ $variant: variant,
36
+ $appearance: appearance
32
37
  }, children));
33
38
  };
34
39
  Table.displayName = "Table";
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","names":["_react","_interopRequireDefault","require","_classnames","_Styles","e","__esModule","default","Table","exports","_ref","children","className","wrapperClassName","_ref$striped","striped","innerRef","_ref$variant","variant","createElement","StyledTableWrapper","classNames","$variant","StyledTable","ref","$striped","displayName","Thead","_ref2","_ref2$headerVariant","headerVariant","StyledTableHead","$headerVariant","Tbody","_ref3","StyledTableBody"],"sources":["../../../../src/components/Tables/Table.tsx"],"sourcesContent":["import React, { ReactNode, FC, RefObject } from \"react\";\n\nimport classNames from \"classnames\";\n\nimport {\n StyledTableWrapper,\n StyledTable,\n StyledTableBody,\n StyledTableHead,\n TableVariant,\n} from \"./Styles\";\n\nexport type { TableVariant } from \"./Styles\";\n\nexport interface ITableWithChildren {\n /** Children prop can be ReactNode. */\n children: ReactNode;\n /** Classname prop for custom styling. */\n className?: string;\n}\n\nexport interface ITableProps {\n /** Darker color on odd column. */\n striped?: boolean;\n /** CSS classes. */\n className?: string;\n /** CSS classes for wrapper */\n wrapperClassName?: string;\n /** Ref object for table. */\n innerRef?: RefObject<HTMLTableElement>;\n /**\n * `\"default\"` is the page look. `\"plain\"` drops the outer margins, the paper\n * shadow and the forced right alignment of the last column, and keeps the\n * header in sentence case. It is the look a table needs inside a dialog.\n */\n variant?: TableVariant;\n}\n\nexport const Table: FC<ITableProps & ITableWithChildren> = ({\n children,\n className,\n wrapperClassName,\n striped = false,\n innerRef,\n variant = \"default\",\n}) => {\n return (\n <StyledTableWrapper\n className={classNames(\"c-table__wrap\", wrapperClassName, {\n \"c-table__wrap--plain\": variant === \"plain\",\n })}\n $variant={variant}\n >\n <StyledTable\n ref={innerRef}\n className={classNames(\"c-table\", className, {\n \"c-table--plain\": variant === \"plain\",\n })}\n $striped={striped}\n $variant={variant}\n >\n {children}\n </StyledTable>\n </StyledTableWrapper>\n );\n};\n\nTable.displayName = \"Table\";\n\nexport const Thead: FC<\n ITableWithChildren & { headerVariant?: \"primary\" | \"secondary\" }\n> = ({ children, className, headerVariant = \"primary\" }) => (\n <StyledTableHead\n $headerVariant={headerVariant}\n className={classNames(\"c-table__head\", className)}\n >\n {children}\n </StyledTableHead>\n);\n\nThead.displayName = \"Thead\";\n\nexport const Tbody: FC<ITableWithChildren> = ({ children, className }) => (\n <StyledTableBody className={classNames(\"c-table__body\", className)}>\n {children}\n </StyledTableBody>\n);\n\nTbody.displayName = \"Tbody\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAMkB,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CA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AAAD,KAAA,CAAEE,aAAa;IAAbA,aAAa,GAAAD,mBAAA,cAAG,SAAS,GAAAA,mBAAA;EAAA,oBACnD7B,MAAA,CAAAO,OAAA,CAAAY,aAAA,CAACf,OAAA,CAAA2B,eAAe;IACdC,cAAc,EAAEF,aAAc;IAC9BlB,SAAS,EAAE,IAAAS,mBAAU,EAAC,eAAe,EAAET,SAAS;EAAE,GAEjDD,QACc,CAAC;AAAA,CACnB;AAEDgB,KAAK,CAACD,WAAW,GAAG,OAAO;AAEpB,IAAMO,KAA6B,GAAAxB,OAAA,CAAAwB,KAAA,GAAG,SAAhCA,KAA6BA,CAAAC,KAAA;EAAA,IAAMvB,QAAQ,GAAAuB,KAAA,CAARvB,QAAQ;IAAEC,SAAS,GAAAsB,KAAA,CAATtB,SAAS;EAAA,oBACjEZ,MAAA,CAAAO,OAAA,CAAAY,aAAA,CAACf,OAAA,CAAA+B,eAAe;IAACvB,SAAS,EAAE,IAAAS,mBAAU,EAAC,eAAe,EAAET,SAAS;EAAE,GAChED,QACc,CAAC;AAAA,CACnB;AAEDsB,KAAK,CAACP,WAAW,GAAG,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"Table.js","names":["_react","_interopRequireDefault","require","_classnames","_Styles","e","__esModule","default","Table","exports","_ref","children","className","wrapperClassName","_ref$striped","striped","innerRef","_ref$variant","variant","_ref$appearance","appearance","createElement","StyledTableWrapper","classNames","$variant","$appearance","StyledTable","ref","$striped","displayName","Thead","_ref2","_ref2$headerVariant","headerVariant","StyledTableHead","$headerVariant","Tbody","_ref3","StyledTableBody"],"sources":["../../../../src/components/Tables/Table.tsx"],"sourcesContent":["import React, { ReactNode, FC, RefObject } from \"react\";\n\nimport classNames from \"classnames\";\n\nimport {\n StyledTableWrapper,\n StyledTable,\n StyledTableBody,\n StyledTableHead,\n TableAppearance,\n TableVariant,\n} from \"./Styles\";\n\nexport type { TableAppearance, TableVariant } from \"./Styles\";\n\nexport interface ITableWithChildren {\n /** Children prop can be ReactNode. */\n children: ReactNode;\n /** Classname prop for custom styling. */\n className?: string;\n}\n\nexport interface ITableProps {\n /** Darker color on odd column. */\n striped?: boolean;\n /** CSS classes. */\n className?: string;\n /** CSS classes for wrapper */\n wrapperClassName?: string;\n /** Ref object for table. */\n innerRef?: RefObject<HTMLTableElement>;\n /**\n * `\"default\"` is the page look. `\"plain\"` drops the outer margins, the paper\n * shadow and the forced right alignment of the last column, and keeps the\n * header in sentence case. It is the look a table needs inside a dialog.\n */\n variant?: TableVariant;\n /**\n * The look of the table. `1` is the one this component always drew. `2` is the card: a border\n * around the whole table, a shaded header band and a line between the rows.\n */\n appearance?: TableAppearance;\n}\n\nexport const Table: FC<ITableProps & ITableWithChildren> = ({\n children,\n className,\n wrapperClassName,\n striped = false,\n innerRef,\n variant = \"default\",\n appearance = 1,\n}) => {\n return (\n <StyledTableWrapper\n className={classNames(\"c-table__wrap\", wrapperClassName, {\n \"c-table__wrap--plain\": variant === \"plain\",\n })}\n $variant={variant}\n $appearance={appearance}\n >\n <StyledTable\n ref={innerRef}\n className={classNames(\"c-table\", className, {\n \"c-table--plain\": variant === \"plain\",\n \"c-table--card\": appearance === 2,\n })}\n $striped={striped}\n $variant={variant}\n $appearance={appearance}\n >\n {children}\n </StyledTable>\n </StyledTableWrapper>\n );\n};\n\nTable.displayName = \"Table\";\n\nexport const Thead: FC<\n ITableWithChildren & { headerVariant?: \"primary\" | \"secondary\" }\n> = ({ children, className, headerVariant = \"primary\" }) => (\n <StyledTableHead\n $headerVariant={headerVariant}\n className={classNames(\"c-table__head\", className)}\n >\n {children}\n </StyledTableHead>\n);\n\nThead.displayName = \"Thead\";\n\nexport const Tbody: FC<ITableWithChildren> = ({ children, className }) => (\n <StyledTableBody className={classNames(\"c-table__body\", className)}>\n {children}\n </StyledTableBody>\n);\n\nTbody.displayName = \"Tbody\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAF,sBAAA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,EAAEN,OAAQ;IAClBO,WAAW,EAAEL;EAAW,GAEvBT,QACU,CACK,CAAC;AAEzB,CAAC;AAEDH,KAAK,CAACqB,WAAW,GAAG,OAAO;AAEpB,IAAMC,KAEZ,GAAArB,OAAA,CAAAqB,KAAA,GAAG,SAFSA,KAEZA,CAAAC,KAAA;EAAA,IAAMpB,QAAQ,GAAAoB,KAAA,CAARpB,QAAQ;IAAEC,SAAS,GAAAmB,KAAA,CAATnB,SAAS;IAAAoB,mBAAA,GAAAD,KAAA,CAAEE,aAAa;IAAbA,aAAa,GAAAD,mBAAA,cAAG,SAAS,GAAAA,mBAAA;EAAA,oBACnDhC,MAAA,CAAAO,OAAA,CAAAc,aAAA,CAACjB,OAAA,CAAA8B,eAAe;IACdC,cAAc,EAAEF,aAAc;IAC9BrB,SAAS,EAAE,IAAAW,mBAAU,EAAC,eAAe,EAAEX,SAAS;EAAE,GAEjDD,QACc,CAAC;AAAA,CACnB;AAEDmB,KAAK,CAACD,WAAW,GAAG,OAAO;AAEpB,IAAMO,KAA6B,GAAA3B,OAAA,CAAA2B,KAAA,GAAG,SAAhCA,KAA6BA,CAAAC,KAAA;EAAA,IAAM1B,QAAQ,GAAA0B,KAAA,CAAR1B,QAAQ;IAAEC,SAAS,GAAAyB,KAAA,CAATzB,SAAS;EAAA,oBACjEZ,MAAA,CAAAO,OAAA,CAAAc,aAAA,CAACjB,OAAA,CAAAkC,eAAe;IAAC1B,SAAS,EAAE,IAAAW,mBAAU,EAAC,eAAe,EAAEX,SAAS;EAAE,GAChED,QACc,CAAC;AAAA,CACnB;AAEDyB,KAAK,CAACP,WAAW,GAAG,OAAO","ignoreList":[]}
@@ -14,6 +14,17 @@ Object.keys(_Button).forEach(function (key) {
14
14
  }
15
15
  });
16
16
  });
17
+ var _CaretButton = require("./CaretButton");
18
+ Object.keys(_CaretButton).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _CaretButton[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function get() {
24
+ return _CaretButton[key];
25
+ }
26
+ });
27
+ });
17
28
  var _ButtonGroup = require("./ButtonGroup");
18
29
  Object.keys(_ButtonGroup).forEach(function (key) {
19
30
  if (key === "default" || key === "__esModule") return;