@team-monolith/cds 0.1.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.
- package/README.md +46 -0
- package/dist/CodleDesignSystemProvider.d.ts +5 -0
- package/dist/CodleDesignSystemProvider.js +96 -0
- package/dist/components/AlertDialog/AlertDialog.d.ts +14 -0
- package/dist/components/AlertDialog/AlertDialog.js +45 -0
- package/dist/components/AlertDialog/AlertDialogActions.d.ts +8 -0
- package/dist/components/AlertDialog/AlertDialogActions.js +35 -0
- package/dist/components/AlertDialog/AlertDialogContent.d.ts +8 -0
- package/dist/components/AlertDialog/AlertDialogContent.js +36 -0
- package/dist/components/AlertDialog/AlertDialogTitle.d.ts +13 -0
- package/dist/components/AlertDialog/AlertDialogTitle.js +38 -0
- package/dist/components/AlertDialog/index.d.ts +4 -0
- package/dist/components/AlertDialog/index.js +4 -0
- package/dist/components/Banner.d.ts +29 -0
- package/dist/components/Banner.js +65 -0
- package/dist/components/Button.d.ts +26 -0
- package/dist/components/Button.js +72 -0
- package/dist/components/CheckboxInput.d.ts +27 -0
- package/dist/components/CheckboxInput.js +77 -0
- package/dist/components/Input.d.ts +17 -0
- package/dist/components/Input.js +72 -0
- package/dist/components/InputBase.d.ts +42 -0
- package/dist/components/InputBase.js +52 -0
- package/dist/components/Pagination.d.ts +27 -0
- package/dist/components/Pagination.js +32 -0
- package/dist/components/PinInput.d.ts +36 -0
- package/dist/components/PinInput.js +154 -0
- package/dist/components/RadioInput.d.ts +23 -0
- package/dist/components/RadioInput.js +78 -0
- package/dist/components/SquareButton.d.ts +26 -0
- package/dist/components/SquareButton.js +80 -0
- package/dist/components/Switch.d.ts +19 -0
- package/dist/components/Switch.js +59 -0
- package/dist/components/Tag.d.ts +21 -0
- package/dist/components/Tag.js +61 -0
- package/dist/components/Tooltip.d.ts +26 -0
- package/dist/components/Tooltip.js +50 -0
- package/dist/foundation/color.d.ts +75 -0
- package/dist/foundation/color.js +75 -0
- package/dist/foundation/shadows.d.ts +9 -0
- package/dist/foundation/shadows.js +10 -0
- package/dist/icons/arrows.d.ts +16 -0
- package/dist/icons/arrows.js +17 -0
- package/dist/icons/brand.d.ts +4 -0
- package/dist/icons/brand.js +13 -0
- package/dist/icons/map.d.ts +4 -0
- package/dist/icons/map.js +13 -0
- package/dist/icons/system.d.ts +25 -0
- package/dist/icons/system.js +20 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/patterns/Dropdown/Dropdown.d.ts +27 -0
- package/dist/patterns/Dropdown/Dropdown.js +41 -0
- package/dist/patterns/Dropdown/DropdownItem.d.ts +42 -0
- package/dist/patterns/Dropdown/DropdownItem.js +89 -0
- package/dist/patterns/Dropdown/DropdownMenu.d.ts +30 -0
- package/dist/patterns/Dropdown/DropdownMenu.js +85 -0
- package/dist/patterns/Dropdown/index.d.ts +2 -0
- package/dist/patterns/Dropdown/index.js +2 -0
- package/dist/patterns/EmptyState/EmptyState.d.ts +16 -0
- package/dist/patterns/EmptyState/EmptyState.js +36 -0
- package/dist/patterns/EmptyState/index.d.ts +2 -0
- package/dist/patterns/EmptyState/index.js +2 -0
- package/dist/patterns/Grid/EnhancedTableCell.d.ts +9 -0
- package/dist/patterns/Grid/EnhancedTableCell.js +122 -0
- package/dist/patterns/Grid/Grid.d.ts +51 -0
- package/dist/patterns/Grid/Grid.js +140 -0
- package/dist/patterns/Grid/index.d.ts +3 -0
- package/dist/patterns/Grid/index.js +2 -0
- package/dist/patterns/SegmentedControl/SegmentedControlButton.d.ts +8 -0
- package/dist/patterns/SegmentedControl/SegmentedControlButton.js +41 -0
- package/dist/patterns/SegmentedControl/SegmentedControlGroup.d.ts +26 -0
- package/dist/patterns/SegmentedControl/SegmentedControlGroup.js +50 -0
- package/dist/patterns/SegmentedControl/SegmentedControlGroupPropsContext.d.ts +5 -0
- package/dist/patterns/SegmentedControl/SegmentedControlGroupPropsContext.js +5 -0
- package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.d.ts +8 -0
- package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.js +45 -0
- package/dist/patterns/SegmentedControl/index.d.ts +3 -0
- package/dist/patterns/SegmentedControl/index.js +3 -0
- package/dist/patterns/Table/Table.d.ts +16 -0
- package/dist/patterns/Table/Table.js +33 -0
- package/dist/patterns/Table/TableBody.d.ts +8 -0
- package/dist/patterns/Table/TableBody.js +26 -0
- package/dist/patterns/Table/TableCell.d.ts +15 -0
- package/dist/patterns/Table/TableCell.js +78 -0
- package/dist/patterns/Table/TableHead.d.ts +8 -0
- package/dist/patterns/Table/TableHead.js +26 -0
- package/dist/patterns/Table/TableRow.d.ts +12 -0
- package/dist/patterns/Table/TableRow.js +29 -0
- package/dist/patterns/Table/TableSizeContext.d.ts +7 -0
- package/dist/patterns/Table/TableSizeContext.js +3 -0
- package/dist/patterns/Table/TableVariantContext.d.ts +6 -0
- package/dist/patterns/Table/TableVariantContext.js +3 -0
- package/dist/patterns/Table/index.d.ts +7 -0
- package/dist/patterns/Table/index.js +6 -0
- package/dist/utils/hover.d.ts +3 -0
- package/dist/utils/hover.js +14 -0
- package/dist/utils/reset.d.ts +2 -0
- package/dist/utils/reset.js +8 -0
- package/dist/utils/zIndex.d.ts +3 -0
- package/dist/utils/zIndex.js +3 -0
- package/package.json +52 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/src/App.tsx +7 -0
- package/src/cds/CodleDesignSystemProvider.tsx +93 -0
- package/src/cds/README.md +23 -0
- package/src/cds/components/AlertDialog/AlertDialog.tsx +101 -0
- package/src/cds/components/AlertDialog/AlertDialogActions.tsx +34 -0
- package/src/cds/components/AlertDialog/AlertDialogContent.tsx +38 -0
- package/src/cds/components/AlertDialog/AlertDialogTitle.tsx +63 -0
- package/src/cds/components/AlertDialog/index.tsx +4 -0
- package/src/cds/components/Banner.tsx +176 -0
- package/src/cds/components/Button.tsx +239 -0
- package/src/cds/components/CheckboxInput.tsx +270 -0
- package/src/cds/components/Input.tsx +166 -0
- package/src/cds/components/InputBase.tsx +226 -0
- package/src/cds/components/Pagination.tsx +99 -0
- package/src/cds/components/PinInput.tsx +322 -0
- package/src/cds/components/RadioInput.tsx +226 -0
- package/src/cds/components/SquareButton.tsx +229 -0
- package/src/cds/components/Switch.tsx +129 -0
- package/src/cds/components/Tag.tsx +155 -0
- package/src/cds/components/Tooltip.tsx +104 -0
- package/src/cds/emotion.d.ts +70 -0
- package/src/cds/foundation/color.ts +83 -0
- package/src/cds/foundation/shadows.ts +17 -0
- package/src/cds/icons/arrows.tsx +61 -0
- package/src/cds/icons/brand.tsx +13 -0
- package/src/cds/icons/map.tsx +14 -0
- package/src/cds/icons/system.tsx +113 -0
- package/src/cds/index.ts +3 -0
- package/src/cds/patterns/Dropdown/Dropdown.tsx +111 -0
- package/src/cds/patterns/Dropdown/DropdownItem.tsx +203 -0
- package/src/cds/patterns/Dropdown/DropdownMenu.tsx +176 -0
- package/src/cds/patterns/Dropdown/index.tsx +2 -0
- package/src/cds/patterns/EmptyState/EmptyState.tsx +91 -0
- package/src/cds/patterns/EmptyState/empty-state-icon.svg +36 -0
- package/src/cds/patterns/EmptyState/index.tsx +2 -0
- package/src/cds/patterns/Grid/EnhancedTableCell.tsx +180 -0
- package/src/cds/patterns/Grid/Grid.tsx +360 -0
- package/src/cds/patterns/Grid/index.tsx +4 -0
- package/src/cds/patterns/SegmentedControl/SegmentedControlButton.tsx +41 -0
- package/src/cds/patterns/SegmentedControl/SegmentedControlGroup.tsx +81 -0
- package/src/cds/patterns/SegmentedControl/SegmentedControlGroupPropsContext.tsx +9 -0
- package/src/cds/patterns/SegmentedControl/SegmentedControlSquareButton.tsx +51 -0
- package/src/cds/patterns/SegmentedControl/index.ts +3 -0
- package/src/cds/patterns/Table/Table.tsx +56 -0
- package/src/cds/patterns/Table/TableBody.tsx +30 -0
- package/src/cds/patterns/Table/TableCell.tsx +242 -0
- package/src/cds/patterns/Table/TableHead.tsx +30 -0
- package/src/cds/patterns/Table/TableRow.tsx +54 -0
- package/src/cds/patterns/Table/TableSizeContext.tsx +10 -0
- package/src/cds/patterns/Table/TableVariantContext.tsx +9 -0
- package/src/cds/patterns/Table/index.tsx +15 -0
- package/src/cds/utils/hover.tsx +24 -0
- package/src/cds/utils/reset.tsx +19 -0
- package/src/cds/utils/zIndex.tsx +3 -0
- package/src/index.tsx +10 -0
- package/src/react-app-env.d.ts +1 -0
- package/tsconfig.json +22 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ArrowDropDownFillIcon: (props: {
|
|
3
|
+
className?: string;
|
|
4
|
+
}) => JSX.Element;
|
|
5
|
+
export declare const ExpandUpDownIcon: (props: {
|
|
6
|
+
className?: string;
|
|
7
|
+
}) => JSX.Element;
|
|
8
|
+
export declare const ArrowDownFillIcon: (props: {
|
|
9
|
+
className?: string;
|
|
10
|
+
}) => JSX.Element;
|
|
11
|
+
export declare const ArrowUpFillIcon: (props: {
|
|
12
|
+
className?: string;
|
|
13
|
+
}) => JSX.Element;
|
|
14
|
+
export declare const ArrowRightSLineIcon: (props: {
|
|
15
|
+
className?: string;
|
|
16
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export var ArrowDropDownFillIcon = function (props) { return (_jsx("svg", __assign({}, props, { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, { children: _jsx("path", { fill: "currentColor", d: "m12 14l-4-4h8l-4 4Z" }) }))); };
|
|
14
|
+
export var ExpandUpDownIcon = function (props) { return (_jsx("svg", __assign({}, props, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M18 9L12 3L6 9H18ZM18 15L12 21L6 15H18Z", fill: "currentColor" }) }))); };
|
|
15
|
+
export var ArrowDownFillIcon = function (props) { return (_jsx("svg", __assign({}, props, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M13 12H20L12 20L4 12H11V4H13V12Z", fill: "currentColor" }) }))); };
|
|
16
|
+
export var ArrowUpFillIcon = function (props) { return (_jsx("svg", __assign({}, props, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M13 12V20H11V12H4L12 4L20 12H13Z", fill: "currentColor" }) }))); };
|
|
17
|
+
export var ArrowRightSLineIcon = function (props) { return (_jsx("svg", __assign({}, props, { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, { children: _jsx("path", { d: "M13.1714 12.0007L8.22168 7.05093L9.63589 5.63672L15.9999 12.0007L9.63589 18.3646L8.22168 16.9504L13.1714 12.0007Z", fill: "currentColor" }) }))); };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export var SymbolIcon = function (props) { return (_jsx("svg", __assign({}, props, { viewBox: "-3 -2 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M8.89269 0C3.98164 0 0 3.80096 0 8.49034C0 12.0308 2.26988 15.0622 5.4957 16.336C6.05262 16.5557 6.36122 17.1512 6.19366 17.7238L5.83323 18.9592C5.66206 19.5427 6.17196 20.1009 6.76987 19.9845C8.47801 19.6495 11.564 18.7587 14.0701 16.4644C16.9898 13.7908 17.7854 10.9527 17.7854 8.49154C17.7854 3.80337 13.8037 0.00120173 8.89269 0.00120173V0Z", fill: "currentColor" }) }))); };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export var EarthFillIcon = function (props) { return (_jsx("svg", __assign({}, props, { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, { children: _jsx("path", { d: "M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM16.0043 12.8777C15.6589 12.3533 15.4097 11.9746 14.4622 12.1248C12.6717 12.409 12.4732 12.7224 12.3877 13.2375L12.3636 13.3943L12.3393 13.5597C12.2416 14.2428 12.2453 14.5012 12.5589 14.8308C13.8241 16.1582 14.582 17.115 14.8116 17.6746C14.9237 17.9484 15.2119 18.7751 15.0136 19.5927C16.2372 19.1066 17.3156 18.3332 18.1653 17.3559C18.2755 16.9821 18.3551 16.5166 18.3551 15.9518V15.8472C18.3551 14.9247 18.3551 14.504 17.7031 14.1314C17.428 13.9751 17.2227 13.881 17.0582 13.8064C16.691 13.6394 16.4479 13.5297 16.1198 13.0499C16.0807 12.9928 16.0425 12.9358 16.0043 12.8777ZM12 3.83333C9.68259 3.83333 7.59062 4.79858 6.1042 6.34896C6.28116 6.47186 6.43537 6.64453 6.54129 6.88256C6.74529 7.34029 6.74529 7.8112 6.74529 8.22764C6.74488 8.55621 6.74442 8.8672 6.84992 9.09302C6.99443 9.40134 7.6164 9.53227 8.16548 9.64736C8.36166 9.68867 8.56395 9.73083 8.74797 9.78176C9.25405 9.92233 9.64554 10.3765 9.95938 10.7412C10.0896 10.8931 10.2819 11.1163 10.3783 11.1717C10.4286 11.1356 10.59 10.9608 10.6699 10.6735C10.7307 10.4547 10.7134 10.2597 10.6239 10.1543C10.0648 9.49445 10.0952 8.2232 10.268 7.75495C10.5402 7.01606 11.3905 7.07058 12.012 7.11097C12.2438 7.12589 12.4626 7.14023 12.6257 7.11976C13.2482 7.04166 13.4396 6.09538 13.575 5.91C13.8671 5.50981 14.7607 4.9071 15.3158 4.53454C14.3025 4.08382 13.1805 3.83333 12 3.83333Z", fill: "currentColor" }) }))); };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const CloseFillIcon: (props: {
|
|
3
|
+
className?: string;
|
|
4
|
+
}) => JSX.Element;
|
|
5
|
+
export declare const CloseCircleFillIcon: (props: {
|
|
6
|
+
className?: string;
|
|
7
|
+
}) => JSX.Element;
|
|
8
|
+
export declare const ErrorWarningFillIcon: (props: {
|
|
9
|
+
className?: string;
|
|
10
|
+
}) => JSX.Element;
|
|
11
|
+
export declare const AlertFillIcon: (props: {
|
|
12
|
+
className?: string;
|
|
13
|
+
}) => JSX.Element;
|
|
14
|
+
export declare const CheckboxCircleFillIcon: (props: {
|
|
15
|
+
className?: string;
|
|
16
|
+
}) => JSX.Element;
|
|
17
|
+
export declare const EyeFillIcon: (props: {
|
|
18
|
+
className?: string;
|
|
19
|
+
}) => JSX.Element;
|
|
20
|
+
export declare const InformationFillIcon: (props: {
|
|
21
|
+
className?: string;
|
|
22
|
+
}) => JSX.Element;
|
|
23
|
+
export declare const FilterFillIcon: (props: {
|
|
24
|
+
className?: string;
|
|
25
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export var CloseFillIcon = function (props) { return (_jsx("svg", __assign({}, props, { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, { children: _jsx("path", { fill: "currentColor", d: "m12 10.586l4.95-4.95l1.415 1.415l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.95 4.95l-1.413-1.415l4.95-4.95l-4.95-4.95L7.05 5.638l4.95 4.95Z" }) }))); };
|
|
14
|
+
export var CloseCircleFillIcon = function (props) { return (_jsx("svg", __assign({}, props, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z", fill: "currentColor" }) }))); };
|
|
15
|
+
export var ErrorWarningFillIcon = function (props) { return (_jsx("svg", __assign({}, props, { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, { children: _jsx("path", { fill: "currentColor", d: "M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10Zm-1-7v2h2v-2h-2Zm0-8v6h2V7h-2Z" }) }))); };
|
|
16
|
+
export var AlertFillIcon = function (props) { return (_jsx("svg", __assign({}, props, { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, { children: _jsx("path", { fill: "currentColor", d: "m12.865 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.473a1 1 0 0 1-.866-1.5L11.133 3a1 1 0 0 1 1.732 0Zm-1.866 13v2h2v-2h-2Zm0-7v5h2V9h-2Z" }) }))); };
|
|
17
|
+
export var CheckboxCircleFillIcon = function (props) { return (_jsx("svg", __assign({}, props, { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, { children: _jsx("path", { fill: "currentColor", d: "M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10Zm-.997-6l7.07-7.071l-1.413-1.414l-5.657 5.657l-2.829-2.829l-1.414 1.414L11.003 16Z" }) }))); };
|
|
18
|
+
export var EyeFillIcon = function (props) { return (_jsx("svg", __assign({}, props, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z", fill: "currentColor" }) }))); };
|
|
19
|
+
export var InformationFillIcon = function (props) { return (_jsx("svg", __assign({}, props, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 11V17H13V11H11ZM11 7V9H13V7H11Z", fill: "currentColor" }) }))); };
|
|
20
|
+
export var FilterFillIcon = function (props) { return (_jsx("svg", __assign({}, props, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M21 4V6H20L14 15V22H10V15L4 6H3V4H21Z", fill: "currentColor" }) }))); };
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ButtonColor, ButtonSize } from "../../components/Button";
|
|
3
|
+
import { DropdownMenuProps } from "./DropdownMenu";
|
|
4
|
+
export interface DropdownProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
component?: React.ElementType;
|
|
7
|
+
/** 버튼 비활성화 여부 */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** 버튼 컴포넌트 색상 */
|
|
10
|
+
color?: ButtonColor;
|
|
11
|
+
/** 버튼 컴포넌트 크기 */
|
|
12
|
+
size?: ButtonSize;
|
|
13
|
+
/** 버튼 컴포넌트 내 좌측에 표기될 아이콘 */
|
|
14
|
+
startIcon?: React.ReactNode;
|
|
15
|
+
/** 버튼 컴포넌트 내 우측에 표기될 아이콘 */
|
|
16
|
+
endIcon?: React.ReactNode;
|
|
17
|
+
/** 버튼 컴포넌트 내 표기될 문자열 */
|
|
18
|
+
label: string;
|
|
19
|
+
/** 버튼 클릭 시 호출될 콜백 함수 */
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
/** 드롭다운 메뉴의 props */
|
|
22
|
+
menuProps: DropdownMenuProps;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=203-95329&t=FwczLZ1IVvskUVbT-0)
|
|
26
|
+
*/
|
|
27
|
+
export default function Dropdown(props: DropdownProps): JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useRef, useState } from "react";
|
|
14
|
+
import Button from "../../components/Button";
|
|
15
|
+
import DropdownMenu from "./DropdownMenu";
|
|
16
|
+
import { ArrowDropDownFillIcon } from "../../icons/arrows";
|
|
17
|
+
/**
|
|
18
|
+
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=203-95329&t=FwczLZ1IVvskUVbT-0)
|
|
19
|
+
*/
|
|
20
|
+
export default function Dropdown(props) {
|
|
21
|
+
var className = props.className, _a = props.component, Component = _a === void 0 ? "div" : _a, disabled = props.disabled, _b = props.color, color = _b === void 0 ? "primary" : _b, _c = props.size, size = _c === void 0 ? "medium" : _c, startIcon = props.startIcon, _d = props.endIcon, endIcon = _d === void 0 ? _jsx(ArrowDropDownFillIcon, {}) : _d, label = props.label, onClick = props.onClick, menuProps = props.menuProps;
|
|
22
|
+
var buttonProps = {
|
|
23
|
+
disabled: disabled,
|
|
24
|
+
color: color,
|
|
25
|
+
size: size,
|
|
26
|
+
startIcon: startIcon,
|
|
27
|
+
endIcon: endIcon,
|
|
28
|
+
};
|
|
29
|
+
var menuRef = useRef(null);
|
|
30
|
+
var _e = useState(false), open = _e[0], setOpen = _e[1];
|
|
31
|
+
var handleClick = function () {
|
|
32
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
33
|
+
setOpen(true);
|
|
34
|
+
};
|
|
35
|
+
var handleClose = function (e) {
|
|
36
|
+
var _a;
|
|
37
|
+
(_a = menuProps.onClose) === null || _a === void 0 ? void 0 : _a.call(menuProps, e);
|
|
38
|
+
setOpen(false);
|
|
39
|
+
};
|
|
40
|
+
return (_jsxs(Component, __assign({ className: className }, { children: [_jsx(Button, __assign({ ref: menuRef }, buttonProps, { label: label, onClick: handleClick })), _jsx(DropdownMenu, __assign({}, menuProps, { open: open, onClose: handleClose, anchorEl: menuRef.current }))] })));
|
|
41
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CheckboxInputProps } from "../../components/CheckboxInput";
|
|
3
|
+
import { DropdownMenuProps } from "./DropdownMenu";
|
|
4
|
+
export type DropdownItemType = "default" | "danger";
|
|
5
|
+
export declare const DROPDOWN_ITEM_WIDTH = 116;
|
|
6
|
+
export interface DropdownItemProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
component?: React.ElementType;
|
|
9
|
+
/** 드롭다운 아이템의 타입 */
|
|
10
|
+
type?: DropdownItemType;
|
|
11
|
+
/** 체크박스 노출여부 */
|
|
12
|
+
checkbox?: boolean;
|
|
13
|
+
/** 체크박스 설정 props. 초기 체크여부 및 체크박스 값 변경시 호출되는 함수 등을 지정합니다. */
|
|
14
|
+
checkboxProps?: CheckboxInputProps;
|
|
15
|
+
/** 시작 아이콘 설정 */
|
|
16
|
+
startIcon?: React.ReactNode;
|
|
17
|
+
/** 드롭다운 아이템의 라벨 */
|
|
18
|
+
label?: string;
|
|
19
|
+
/** 끝 아이콘 설정. subMenuProps가 없으면 노출되지 않습니다. */
|
|
20
|
+
endIcon?: React.ReactNode;
|
|
21
|
+
/** 비활성화 여부 */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** 드롭다운 아이템의 활성화 여부. 서브 메뉴가 노출될 때 true가 됩니다. */
|
|
24
|
+
active?: boolean;
|
|
25
|
+
/** 드롭다운 아이템 마우스 호버 시 호출될 콜백 함수 */
|
|
26
|
+
onMouseEnter?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
27
|
+
/** 드롭다운 아이템 마우스 아웃 시 호출될 콜백 함수 */
|
|
28
|
+
onMouseLeave?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
29
|
+
/** 드롭다운 아이템 클릭 시 호출될 콜백 함수 */
|
|
30
|
+
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
31
|
+
/** 드롭다운 아이템의 서브 메뉴가 열려야 하는지 여부 */
|
|
32
|
+
shouldSubMenuOpen?: boolean;
|
|
33
|
+
/** 아이템이 가지는 드롭다운 메뉴 props. 주어지지 않으면 서브메뉴가 없습니다. */
|
|
34
|
+
subMenuProps?: DropdownMenuProps;
|
|
35
|
+
/** 드롭다운 아이템의 서브 메뉴가 닫힐 때 실행할 콜백함수 */
|
|
36
|
+
onSubMenuClose?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=106-1900&t=FwczLZ1IVvskUVbT-0)
|
|
40
|
+
*/
|
|
41
|
+
declare const DropdownItem: React.ForwardRefExoticComponent<DropdownItemProps & React.RefAttributes<any>>;
|
|
42
|
+
export default DropdownItem;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
28
|
+
/** @jsxImportSource @emotion/react */
|
|
29
|
+
import { css } from "@emotion/react";
|
|
30
|
+
import * as React from "react";
|
|
31
|
+
import styled from "@emotion/styled";
|
|
32
|
+
import { MenuItem } from "@mui/material";
|
|
33
|
+
import { HOVER } from "../../utils/hover";
|
|
34
|
+
import CheckboxInput from "../../components/CheckboxInput";
|
|
35
|
+
import { useRef, useState } from "react";
|
|
36
|
+
import DropdownMenu from "./DropdownMenu";
|
|
37
|
+
import { ArrowRightSLineIcon } from "../../icons/arrows";
|
|
38
|
+
export var DROPDOWN_ITEM_WIDTH = 116;
|
|
39
|
+
var TYPE_TO_COLOR = function (theme, type) {
|
|
40
|
+
return {
|
|
41
|
+
default: theme.color.foreground.neutralBase,
|
|
42
|
+
danger: theme.color.foreground.danger,
|
|
43
|
+
}[type];
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=106-1900&t=FwczLZ1IVvskUVbT-0)
|
|
47
|
+
*/
|
|
48
|
+
var DropdownItem = React.forwardRef(function (props, ref) {
|
|
49
|
+
var className = props.className, _a = props.component, Component = _a === void 0 ? "div" : _a, _b = props.type, type = _b === void 0 ? "default" : _b, checkbox = props.checkbox, _c = props.checkboxProps, checkboxProps = _c === void 0 ? { checked: false } : _c, startIcon = props.startIcon, label = props.label, _d = props.endIcon, endIcon = _d === void 0 ? _jsx(ArrowRightSLineIcon, {}) : _d, disabled = props.disabled, active = props.active, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, onClick = props.onClick, _e = props.shouldSubMenuOpen, shouldSubMenuOpen = _e === void 0 ? false : _e, _f = props.subMenuProps, subMenuProps = _f === void 0 ? {
|
|
50
|
+
itemsProps: [],
|
|
51
|
+
} : _f, onSubMenuClose = props.onSubMenuClose, other = __rest(props, ["className", "component", "type", "checkbox", "checkboxProps", "startIcon", "label", "endIcon", "disabled", "active", "onMouseEnter", "onMouseLeave", "onClick", "shouldSubMenuOpen", "subMenuProps", "onSubMenuClose"]);
|
|
52
|
+
var itemRef = useRef(null);
|
|
53
|
+
var _g = useState(false), isSubMenuOpen = _g[0], setIsSubMenuOpen = _g[1];
|
|
54
|
+
var handleClick = function (e) {
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
setIsSubMenuOpen(true);
|
|
57
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
58
|
+
};
|
|
59
|
+
var handleClose = function (e) {
|
|
60
|
+
setIsSubMenuOpen(false);
|
|
61
|
+
onSubMenuClose === null || onSubMenuClose === void 0 ? void 0 : onSubMenuClose(e);
|
|
62
|
+
};
|
|
63
|
+
var isSubMenuExist = subMenuProps.itemsProps.length > 0;
|
|
64
|
+
var isSubMenuShowed = isSubMenuExist && isSubMenuOpen && shouldSubMenuOpen;
|
|
65
|
+
return (_jsxs(Component, __assign({ className: className, ref: ref, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onClick: handleClick }, other, { children: [_jsxs(StyledMenuItem, __assign({ ref: itemRef, disabled: disabled, selected: isSubMenuShowed || active }, { children: [_jsxs(LeftWrapper, { children: [checkbox && (_jsx(StyledCheckboxInput, __assign({}, checkboxProps, { onClick: function (e) {
|
|
66
|
+
var _a;
|
|
67
|
+
e.stopPropagation();
|
|
68
|
+
(_a = checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
|
|
69
|
+
} }))), startIcon && _jsx(IconDiv, __assign({ type: type }, { children: startIcon })), _jsx(LabelDiv, __assign({ type: type }, { children: label }))] }), isSubMenuExist && _jsx(IconDiv, __assign({ type: type }, { children: endIcon }))] })), isSubMenuExist && (_jsx(DropdownMenu, __assign({}, subMenuProps, { open: isSubMenuShowed, anchorEl: itemRef.current, isNestedMenu: true, onClose: handleClose, anchorOrigin: {
|
|
70
|
+
vertical: "top",
|
|
71
|
+
horizontal: "right",
|
|
72
|
+
} })))] })));
|
|
73
|
+
});
|
|
74
|
+
var StyledCheckboxInput = styled(CheckboxInput)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin: 4px;\n"], ["\n margin: 4px;\n"])));
|
|
75
|
+
var IconDiv = styled.div(function (_a) {
|
|
76
|
+
var theme = _a.theme, type = _a.type;
|
|
77
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 14px;\n height: 14px;\n svg {\n width: 14px;\n height: 14px;\n path {\n fill: ", ";\n }\n }\n "], ["\n width: 14px;\n height: 14px;\n svg {\n width: 14px;\n height: 14px;\n path {\n fill: ", ";\n }\n }\n "])), TYPE_TO_COLOR(theme, type));
|
|
78
|
+
});
|
|
79
|
+
var LabelDiv = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n color: ", ";\n"], ["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n color: ", ";\n"])), function (_a) {
|
|
80
|
+
var theme = _a.theme, type = _a.type;
|
|
81
|
+
return TYPE_TO_COLOR(theme, type);
|
|
82
|
+
});
|
|
83
|
+
var LeftWrapper = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n overflow: hidden;\n white-space: nowrap;\n gap: 4px;\n"], ["\n display: flex;\n align-items: center;\n overflow: hidden;\n white-space: nowrap;\n gap: 4px;\n"])));
|
|
84
|
+
var StyledMenuItem = styled(MenuItem)(function (_a) {
|
|
85
|
+
var theme = _a.theme;
|
|
86
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n &.MuiMenuItem-root {\n background-color: ", ";\n width: ", "px;\n height: 32px;\n border-radius: 6px;\n padding: 4px 8px 4px 8px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n line-height: 14px;\n ", "\n &.Mui-selected {\n background-color: ", ";\n }\n }\n "], ["\n &.MuiMenuItem-root {\n background-color: ", ";\n width: ", "px;\n height: 32px;\n border-radius: 6px;\n padding: 4px 8px 4px 8px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n line-height: 14px;\n ", "\n &.Mui-selected {\n background-color: ", ";\n }\n }\n "])), theme.color.background.neutralBase, DROPDOWN_ITEM_WIDTH, HOVER(css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n "], ["\n background-color: ", ";\n "])), theme.color.background.neutralAlt)), theme.color.background.neutralAlt);
|
|
87
|
+
});
|
|
88
|
+
export default DropdownItem;
|
|
89
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DropdownItemProps } from "./DropdownItem";
|
|
3
|
+
interface OriginProps {
|
|
4
|
+
vertical: "top" | "center" | "bottom";
|
|
5
|
+
horizontal: "left" | "center" | "right";
|
|
6
|
+
}
|
|
7
|
+
export declare const DROPDOWN_MENU_WIDTH = 124;
|
|
8
|
+
export declare const DROPDOWN_MENU_MAX_HEIGHT = 160;
|
|
9
|
+
export interface DropdownMenuProps {
|
|
10
|
+
className?: string;
|
|
11
|
+
/** 드롭다운 메뉴가 열리는지 여부 */
|
|
12
|
+
open?: boolean;
|
|
13
|
+
/** 드롭다운 메뉴의 위치참조 */
|
|
14
|
+
anchorEl?: HTMLElement | null;
|
|
15
|
+
/** 드롭다운 메뉴가 닫힐 때 실행될 콜백함수 */
|
|
16
|
+
onClose?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
17
|
+
/** 현재 드롭다운 메뉴가 중첩 드롭다운인지 여부. 최상위일 경우 false입니다. */
|
|
18
|
+
isNestedMenu?: boolean;
|
|
19
|
+
/** 드롭다운 메뉴 원점이 anchor의 어디에 위치하는지 조정 */
|
|
20
|
+
anchorOrigin?: OriginProps;
|
|
21
|
+
/** 드롭다운 메뉴 원점이 메뉴 자신의 어디에 위치하는지 조정 */
|
|
22
|
+
transformOrigin?: OriginProps;
|
|
23
|
+
/** 드롭다운 메뉴가 가지는 드롭다운 아이템들의 props 배열 */
|
|
24
|
+
itemsProps: DropdownItemProps[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=106-1921&t=FwczLZ1IVvskUVbT-0)
|
|
28
|
+
*/
|
|
29
|
+
declare const DropdownMenu: React.ForwardRefExoticComponent<DropdownMenuProps & React.RefAttributes<any>>;
|
|
30
|
+
export default DropdownMenu;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
+
import styled from "@emotion/styled";
|
|
29
|
+
import { css } from "@emotion/react";
|
|
30
|
+
import { Menu } from "@mui/material";
|
|
31
|
+
import React, { useState } from "react";
|
|
32
|
+
import shadows from "../../foundation/shadows";
|
|
33
|
+
import DropdownItem, { DROPDOWN_ITEM_WIDTH, } from "./DropdownItem";
|
|
34
|
+
var ORIGIN_PROPS_TO_MARGIN = function (originProps) {
|
|
35
|
+
var vertical = originProps.vertical, horizontal = originProps.horizontal;
|
|
36
|
+
return {
|
|
37
|
+
top: {
|
|
38
|
+
left: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-right: 12px;\n "], ["\n margin-right: 12px;\n "]))),
|
|
39
|
+
center: css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-bottom: 8px;\n "], ["\n margin-bottom: 8px;\n "]))),
|
|
40
|
+
right: css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-left: 12px;\n "], ["\n margin-left: 12px;\n "]))),
|
|
41
|
+
},
|
|
42
|
+
center: {
|
|
43
|
+
left: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-right: 12px;\n "], ["\n margin-right: 12px;\n "]))),
|
|
44
|
+
center: css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-bottom: 8px;\n "], ["\n margin-bottom: 8px;\n "]))),
|
|
45
|
+
right: css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin-left: 12px;\n "], ["\n margin-left: 12px;\n "]))),
|
|
46
|
+
},
|
|
47
|
+
bottom: {
|
|
48
|
+
left: css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: 8px;\n "], ["\n margin-top: 8px;\n "]))),
|
|
49
|
+
center: css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n margin-top: 8px;\n "], ["\n margin-top: 8px;\n "]))),
|
|
50
|
+
right: css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n margin-top: 8px;\n "], ["\n margin-top: 8px;\n "]))),
|
|
51
|
+
},
|
|
52
|
+
}[vertical][horizontal];
|
|
53
|
+
};
|
|
54
|
+
export var DROPDOWN_MENU_WIDTH = 124;
|
|
55
|
+
export var DROPDOWN_MENU_MAX_HEIGHT = 160;
|
|
56
|
+
/**
|
|
57
|
+
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=106-1921&t=FwczLZ1IVvskUVbT-0)
|
|
58
|
+
*/
|
|
59
|
+
var DropdownMenu = React.forwardRef(function (props, ref) {
|
|
60
|
+
var className = props.className, _a = props.open, open = _a === void 0 ? false : _a, anchorEl = props.anchorEl, onClose = props.onClose, _b = props.isNestedMenu, isNestedMenu = _b === void 0 ? false : _b, _c = props.anchorOrigin, anchorOrigin = _c === void 0 ? {
|
|
61
|
+
vertical: "bottom",
|
|
62
|
+
horizontal: "left",
|
|
63
|
+
} : _c, transformOrigin = props.transformOrigin, itemsProps = props.itemsProps, other = __rest(props, ["className", "open", "anchorEl", "onClose", "isNestedMenu", "anchorOrigin", "transformOrigin", "itemsProps"]);
|
|
64
|
+
var _d = useState(-1), selectedIndex = _d[0], setSelectedIndex = _d[1];
|
|
65
|
+
var handleClick = function (e) {
|
|
66
|
+
setSelectedIndex(-1);
|
|
67
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(e);
|
|
68
|
+
};
|
|
69
|
+
// https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Popover/Popover.js#L104
|
|
70
|
+
// 메뉴를 감싸는 popover의 절대위치를 이동시키기 위해 anchorEl의 위치를 가져옵니다.
|
|
71
|
+
var anchorRect = anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.getBoundingClientRect();
|
|
72
|
+
return (_jsx(StyledMenu, __assign({ ref: ref, open: open, anchorEl: anchorEl, onClick: handleClick, onClose: onClose, className: className, anchorRect: isNestedMenu ? anchorRect : undefined, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, hideBackdrop: true }, other, { children: itemsProps === null || itemsProps === void 0 ? void 0 : itemsProps.map(function (itemProps, index) { return (_jsx(DropdownItem, __assign({}, itemProps, { onClick: function (e) {
|
|
73
|
+
var _a;
|
|
74
|
+
(_a = itemProps.onClick) === null || _a === void 0 ? void 0 : _a.call(itemProps, e);
|
|
75
|
+
setSelectedIndex(index);
|
|
76
|
+
}, shouldSubMenuOpen: open && selectedIndex === index, onSubMenuClose: onClose }), index)); }) })));
|
|
77
|
+
});
|
|
78
|
+
var StyledMenu = styled(Menu, {
|
|
79
|
+
shouldForwardProp: function (prop) { return prop !== "anchorRect"; },
|
|
80
|
+
})(function (_a) {
|
|
81
|
+
var anchorRect = _a.anchorRect, anchorOrigin = _a.anchorOrigin;
|
|
82
|
+
return css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n .MuiPaper-root {\n display: block;\n ", "\n width: ", "px;\n max-height: ", "px;\n box-shadow: ", ";\n .MuiList-root {\n display: inline-flex;\n flex-direction: column;\n padding: 4px;\n gap: 2px;\n }\n ", "\n }\n &.MuiModal-root {\n ", "\n }\n "], ["\n .MuiPaper-root {\n display: block;\n ", "\n width: ", "px;\n max-height: ", "px;\n box-shadow: ", ";\n .MuiList-root {\n display: inline-flex;\n flex-direction: column;\n padding: 4px;\n gap: 2px;\n }\n ", "\n }\n &.MuiModal-root {\n ", "\n }\n "])), ORIGIN_PROPS_TO_MARGIN(anchorOrigin), DROPDOWN_MENU_WIDTH, DROPDOWN_MENU_MAX_HEIGHT, shadows.shadow04, anchorRect && css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n position: absolute;\n top: 0px !important;\n left: 0px !important;\n "], ["\n position: absolute;\n top: 0px !important;\n left: 0px !important;\n "]))), anchorRect && css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n position: absolute;\n top: ", "px;\n left: ", "px;\n "], ["\n position: absolute;\n top: ", "px;\n left: ", "px;\n "])), anchorRect.top, anchorRect.left + DROPDOWN_ITEM_WIDTH));
|
|
83
|
+
});
|
|
84
|
+
export default DropdownMenu;
|
|
85
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ButtonProps } from "../../components/Button";
|
|
3
|
+
export interface EmptyStateProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
component?: React.ElementType;
|
|
6
|
+
/** 상단에 표시되는 텍스트입니다. */
|
|
7
|
+
title: string;
|
|
8
|
+
/** title 하단에 표시되는 텍스트입니다. */
|
|
9
|
+
subtitle?: string;
|
|
10
|
+
/** 하단의 영역에 렌더링 될 Button 컴포넌트의 속성 배열입니다. */
|
|
11
|
+
buttons?: ButtonProps[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=181-89918&t=J5yAnjojg5Dm1764-0)
|
|
15
|
+
*/
|
|
16
|
+
export default function EmptyState(props: EmptyStateProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
17
|
+
/** @jsxImportSource @emotion/react */
|
|
18
|
+
import { css } from "@emotion/react";
|
|
19
|
+
import styled from "@emotion/styled";
|
|
20
|
+
import Button from "../../components/Button";
|
|
21
|
+
import { ReactComponent as EmptyStateIcon } from "./empty-state-icon.svg";
|
|
22
|
+
/**
|
|
23
|
+
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=181-89918&t=J5yAnjojg5Dm1764-0)
|
|
24
|
+
*/
|
|
25
|
+
export default function EmptyState(props) {
|
|
26
|
+
var className = props.className, _a = props.component, Component = _a === void 0 ? "div" : _a, title = props.title, subtitle = props.subtitle, buttons = props.buttons;
|
|
27
|
+
return (_jsxs(Component, __assign({ className: className, css: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 10px;\n\n padding: 120px 10px;\n "], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 10px;\n\n padding: 120px 10px;\n "]))) }, { children: [_jsx(EmptyStateIcon, {}), _jsxs(TextDiv, { children: [_jsx(Title, { children: title }), subtitle && _jsx(Subtitle, { children: subtitle }), (buttons === null || buttons === void 0 ? void 0 : buttons.length) !== 0 && (_jsx(Buttons, { children: buttons === null || buttons === void 0 ? void 0 : buttons.map(function (buttonProps) { return (_jsx(Button, __assign({}, buttonProps))); }) }))] })] })));
|
|
28
|
+
}
|
|
29
|
+
var TextDiv = styled.div(function (_a) {
|
|
30
|
+
var theme = _a.theme;
|
|
31
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 24px 0px;\n gap: 12px;\n\n font-style: normal;\n color: ", ";\n "], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 24px 0px;\n gap: 12px;\n\n font-style: normal;\n color: ", ";\n "])), theme.color.foreground.neutralBase);
|
|
32
|
+
});
|
|
33
|
+
var Title = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-weight: 800;\n font-size: 36px;\n line-height: 44px;\n"], ["\n font-weight: 800;\n font-size: 36px;\n line-height: 44px;\n"])));
|
|
34
|
+
var Subtitle = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-weight: 400;\n font-size: 18px;\n line-height: 28px;\n"], ["\n font-weight: 400;\n font-size: 18px;\n line-height: 28px;\n"])));
|
|
35
|
+
var Buttons = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 4px;\n gap: 8px;\n"], ["\n display: flex;\n align-items: center;\n padding: 4px;\n gap: 8px;\n"])));
|
|
36
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { Header, RowData, Table as TableType } from "@tanstack/react-table";
|
|
3
|
+
/**
|
|
4
|
+
* Sort, Filter, Resize 등의 기능이 추가된 Cell입니다.
|
|
5
|
+
*/
|
|
6
|
+
export default function EnhancedTableCell<TData extends RowData>(props: {
|
|
7
|
+
table: TableType<TData>;
|
|
8
|
+
header: Header<TData, unknown>;
|
|
9
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element;
|