@rovula/ui 0.0.21 → 0.0.23
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/dist/cjs/bundle.css +185 -495
- package/dist/cjs/bundle.js +3 -3
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/ActionButton/ActionButton.stories.d.ts +7 -7
- package/dist/cjs/types/components/Button/Button.d.ts +1 -1
- package/dist/cjs/types/components/Button/Button.styles.d.ts +1 -1
- package/dist/cjs/types/components/Button/Buttons.stories.d.ts +13 -13
- package/dist/cjs/types/components/Checkbox/Checkbox.stories.d.ts +60 -60
- package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +64 -64
- package/dist/cjs/types/components/Icon/Icon.d.ts +11 -0
- package/dist/cjs/types/components/Icon/Icon.stories.d.ts +508 -0
- package/dist/cjs/types/components/Icon/Icon.styles.d.ts +4 -0
- package/dist/cjs/types/components/Input/Input.stories.d.ts +115 -115
- package/dist/cjs/types/components/Label/Label.stories.d.ts +51 -51
- package/dist/cjs/types/components/RadioGroup/RadioGroup.stories.d.ts +54 -54
- package/dist/cjs/types/components/Search/Search.stories.d.ts +64 -64
- package/dist/cjs/types/components/Slider/Slider.d.ts +5 -0
- package/dist/cjs/types/components/Slider/Slider.stories.d.ts +303 -0
- package/dist/cjs/types/components/Switch/Switch.d.ts +4 -0
- package/dist/cjs/types/components/Switch/Switch.stories.d.ts +305 -0
- package/dist/cjs/types/components/Table/Table.stories.d.ts +7 -7
- package/dist/cjs/types/components/Tabs/Tabs.d.ts +12 -3
- package/dist/cjs/types/components/Tabs/Tabs.stories.d.ts +18 -0
- package/dist/cjs/types/components/Text/Text.d.ts +6 -5
- package/dist/cjs/types/components/Text/Text.stories.d.ts +2 -10
- package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +62 -62
- package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +1 -1
- package/dist/cjs/types/icons/heroIconConfig.d.ts +1 -0
- package/dist/cjs/types/icons/iconConfig.d.ts +2 -0
- package/dist/cjs/types/icons/iconRegistry.d.ts +19 -0
- package/dist/cjs/types/icons/index.d.ts +1 -0
- package/dist/cjs/types/icons/material-icon/outline/ChevronDownIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/outline/CollapseContentIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/outline/ContentCopyIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/outline/ContentPasteIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/outline/DataTableIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/outline/ExpandCircleDownIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/outline/ExpandCircleRightIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/outline/ExpandCircleUpIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/outline/ExpandContentIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/outline/InterestsIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/outline/SaveIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/outline/TableChartIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/outline/index.d.ts +12 -0
- package/dist/cjs/types/icons/material-icon/solid/ChevronDownIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/solid/CollapseContentIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/solid/ContentCopyIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/solid/ContentPasteIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/solid/DataTableIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/solid/ExpandCircleDownIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/solid/ExpandCircleRightIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/solid/ExpandCircleUpIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/solid/ExpandContentIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/solid/InterestsIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/solid/SaveIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/solid/TableChartIcon.d.ts +3 -0
- package/dist/cjs/types/icons/material-icon/solid/index.d.ts +12 -0
- package/dist/cjs/types/icons/materialIconConfig.d.ts +1 -0
- package/dist/cjs/types/icons/type.d.ts +8 -0
- package/dist/cjs/types/icons/utils.d.ts +1 -0
- package/dist/cjs/types/index.d.ts +4 -0
- package/dist/components/ActionButton/ActionButton.js +8 -19
- package/dist/components/ActionButton/ActionButton.stories.js +12 -22
- package/dist/components/ActionButton/ActionButton.styles.js +33 -8
- package/dist/components/AlertDialog/Alert.stories.js +5 -16
- package/dist/components/AlertDialog/AlertDialog.js +27 -38
- package/dist/components/Avatar/Avatar.js +7 -8
- package/dist/components/Avatar/Avatar.stories.js +11 -22
- package/dist/components/Avatar/Avatar.styles.js +1 -1
- package/dist/components/Avatar/AvatarBase.js +9 -20
- package/dist/components/Avatar/AvatarGroup.js +9 -10
- package/dist/components/Avatar/AvatarGroup.stories.js +9 -20
- package/dist/components/Button/Button.js +4 -15
- package/dist/components/Button/Button.styles.js +1 -1
- package/dist/components/Button/Buttons.stories.js +18 -29
- package/dist/components/Calendar/Calendar.js +3 -14
- package/dist/components/Calendar/Calendar.stories.js +6 -17
- package/dist/components/Checkbox/Checkbox.js +3 -14
- package/dist/components/Checkbox/Checkbox.stories.js +12 -23
- package/dist/components/Collapsible/Collapsible.js +14 -17
- package/dist/components/Collapsible/Collapsible.stories.js +9 -20
- package/dist/components/Collapsible/Collapsible.styles.js +4 -4
- package/dist/components/Collapsible/CollapsibleContext.js +9 -10
- package/dist/components/DataTable/DataTable.js +25 -26
- package/dist/components/DataTable/DataTable.stories.js +10 -21
- package/dist/components/DatePicker/DatePicker.js +4 -20
- package/dist/components/DatePicker/DatePicker.stories.js +6 -17
- package/dist/components/Dialog/Dialog.js +22 -33
- package/dist/components/Dialog/Dialog.stories.js +8 -19
- package/dist/components/Dropdown/Dropdown.js +26 -37
- package/dist/components/Dropdown/Dropdown.stories.js +36 -55
- package/dist/components/Dropdown/Dropdown.styles.js +3 -3
- package/dist/components/Form/Form.js +26 -87
- package/dist/components/Form/Text.js +2 -3
- package/dist/components/Form/TextInput.js +2 -3
- package/dist/components/Icon/Icon.js +37 -0
- package/dist/components/Icon/Icon.stories.js +356 -0
- package/dist/components/Icon/Icon.styles.js +25 -0
- package/dist/components/Input/Input.js +9 -20
- package/dist/components/Input/Input.stories.js +6 -17
- package/dist/components/Input/Input.styles.js +1 -1
- package/dist/components/Label/Label.js +3 -14
- package/dist/components/Label/Label.stories.js +5 -16
- package/dist/components/Label/Label.styles.js +1 -1
- package/dist/components/Loading/Loading.js +5 -17
- package/dist/components/Loading/Loading.stories.js +6 -17
- package/dist/components/Navbar/Navbar.js +3 -4
- package/dist/components/Navbar/Navbar.stories.js +8 -19
- package/dist/components/Popover/Popover.js +5 -16
- package/dist/components/Popover/Popover.stories.js +5 -16
- package/dist/components/ProgressBar/ProgressBar.js +8 -9
- package/dist/components/ProgressBar/ProgressBar.stories.js +14 -27
- package/dist/components/RadioGroup/RadioGroup.js +6 -17
- package/dist/components/RadioGroup/RadioGroup.stories.js +9 -20
- package/dist/components/Search/Search.js +2 -13
- package/dist/components/Search/Search.stories.js +10 -21
- package/dist/components/Slider/Slider.js +22 -0
- package/dist/components/Slider/Slider.stories.js +33 -0
- package/dist/components/Switch/Switch.js +22 -0
- package/dist/components/Switch/Switch.stories.js +32 -0
- package/dist/components/Table/Datagrid.js +2 -3
- package/dist/components/Table/Table.js +24 -35
- package/dist/components/Table/Table.stories.js +5 -16
- package/dist/components/Tabs/Tabs.js +57 -10
- package/dist/components/Tabs/Tabs.stories.js +13 -24
- package/dist/components/Text/Text.js +19 -6
- package/dist/components/Text/Text.stories.js +12 -23
- package/dist/components/TextInput/TextInput.js +30 -41
- package/dist/components/TextInput/TextInput.stories.js +17 -28
- package/dist/components/TextInput/TextInput.styles.js +7 -7
- package/dist/components/ThemeToggle.js +3 -3
- package/dist/esm/bundle.css +185 -495
- package/dist/esm/bundle.js +3 -3
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/ActionButton/ActionButton.stories.d.ts +7 -7
- package/dist/esm/types/components/Button/Button.d.ts +1 -1
- package/dist/esm/types/components/Button/Button.styles.d.ts +1 -1
- package/dist/esm/types/components/Button/Buttons.stories.d.ts +13 -13
- package/dist/esm/types/components/Checkbox/Checkbox.stories.d.ts +60 -60
- package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +64 -64
- package/dist/esm/types/components/Icon/Icon.d.ts +11 -0
- package/dist/esm/types/components/Icon/Icon.stories.d.ts +508 -0
- package/dist/esm/types/components/Icon/Icon.styles.d.ts +4 -0
- package/dist/esm/types/components/Input/Input.stories.d.ts +115 -115
- package/dist/esm/types/components/Label/Label.stories.d.ts +51 -51
- package/dist/esm/types/components/RadioGroup/RadioGroup.stories.d.ts +54 -54
- package/dist/esm/types/components/Search/Search.stories.d.ts +64 -64
- package/dist/esm/types/components/Slider/Slider.d.ts +5 -0
- package/dist/esm/types/components/Slider/Slider.stories.d.ts +303 -0
- package/dist/esm/types/components/Switch/Switch.d.ts +4 -0
- package/dist/esm/types/components/Switch/Switch.stories.d.ts +305 -0
- package/dist/esm/types/components/Table/Table.stories.d.ts +7 -7
- package/dist/esm/types/components/Tabs/Tabs.d.ts +12 -3
- package/dist/esm/types/components/Tabs/Tabs.stories.d.ts +18 -0
- package/dist/esm/types/components/Text/Text.d.ts +6 -5
- package/dist/esm/types/components/Text/Text.stories.d.ts +2 -10
- package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +62 -62
- package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +1 -1
- package/dist/esm/types/icons/heroIconConfig.d.ts +1 -0
- package/dist/esm/types/icons/iconConfig.d.ts +2 -0
- package/dist/esm/types/icons/iconRegistry.d.ts +19 -0
- package/dist/esm/types/icons/index.d.ts +1 -0
- package/dist/esm/types/icons/material-icon/outline/ChevronDownIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/outline/CollapseContentIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/outline/ContentCopyIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/outline/ContentPasteIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/outline/DataTableIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/outline/ExpandCircleDownIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/outline/ExpandCircleRightIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/outline/ExpandCircleUpIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/outline/ExpandContentIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/outline/InterestsIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/outline/SaveIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/outline/TableChartIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/outline/index.d.ts +12 -0
- package/dist/esm/types/icons/material-icon/solid/ChevronDownIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/solid/CollapseContentIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/solid/ContentCopyIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/solid/ContentPasteIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/solid/DataTableIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/solid/ExpandCircleDownIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/solid/ExpandCircleRightIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/solid/ExpandCircleUpIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/solid/ExpandContentIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/solid/InterestsIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/solid/SaveIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/solid/TableChartIcon.d.ts +3 -0
- package/dist/esm/types/icons/material-icon/solid/index.d.ts +12 -0
- package/dist/esm/types/icons/materialIconConfig.d.ts +1 -0
- package/dist/esm/types/icons/type.d.ts +8 -0
- package/dist/esm/types/icons/utils.d.ts +1 -0
- package/dist/esm/types/index.d.ts +4 -0
- package/dist/icons/heroIconConfig.js +13 -0
- package/dist/icons/iconConfig.js +2 -0
- package/dist/icons/iconRegistry.js +47 -0
- package/dist/icons/index.js +1 -0
- package/dist/icons/material-icon/outline/ChevronDownIcon.js +3 -0
- package/dist/icons/material-icon/outline/CollapseContentIcon.js +3 -0
- package/dist/icons/material-icon/outline/ContentCopyIcon.js +3 -0
- package/dist/icons/material-icon/outline/ContentPasteIcon.js +3 -0
- package/dist/icons/material-icon/outline/DataTableIcon.js +3 -0
- package/dist/icons/material-icon/outline/ExpandCircleDownIcon.js +3 -0
- package/dist/icons/material-icon/outline/ExpandCircleRightIcon.js +3 -0
- package/dist/icons/material-icon/outline/ExpandCircleUpIcon.js +3 -0
- package/dist/icons/material-icon/outline/ExpandContentIcon.js +3 -0
- package/dist/icons/material-icon/outline/InterestsIcon.js +3 -0
- package/dist/icons/material-icon/outline/SaveIcon.js +3 -0
- package/dist/icons/material-icon/outline/TableChartIcon.js +3 -0
- package/dist/icons/material-icon/outline/index.js +12 -0
- package/dist/icons/material-icon/solid/ChevronDownIcon.js +3 -0
- package/dist/icons/material-icon/solid/CollapseContentIcon.js +3 -0
- package/dist/icons/material-icon/solid/ContentCopyIcon.js +3 -0
- package/dist/icons/material-icon/solid/ContentPasteIcon.js +3 -0
- package/dist/icons/material-icon/solid/DataTableIcon.js +3 -0
- package/dist/icons/material-icon/solid/ExpandCircleDownIcon.js +3 -0
- package/dist/icons/material-icon/solid/ExpandCircleRightIcon.js +3 -0
- package/dist/icons/material-icon/solid/ExpandCircleUpIcon.js +3 -0
- package/dist/icons/material-icon/solid/ExpandContentIcon.js +3 -0
- package/dist/icons/material-icon/solid/InterestsIcon.js +3 -0
- package/dist/icons/material-icon/solid/SaveIcon.js +3 -0
- package/dist/icons/material-icon/solid/TableChartIcon.js +3 -0
- package/dist/icons/material-icon/solid/index.js +12 -0
- package/dist/icons/materialIconConfig.js +13 -0
- package/dist/icons/type.js +1 -0
- package/dist/icons/utils.js +6 -0
- package/dist/index.d.ts +35 -8
- package/dist/index.js +4 -0
- package/dist/src/theme/global.css +245 -619
- package/dist/stories/ColorGroupPreview.js +6 -9
- package/dist/stories/ColorPreview.js +1 -2
- package/dist/theme/main-preset.js +24 -0
- package/dist/theme/plugins/utilities/typography.js +9 -0
- package/dist/theme/presets/colors.js +8 -1
- package/dist/theme/tokens/color.css +1 -0
- package/dist/theme/tokens/typography.css +21 -0
- package/dist/utils/cn.js +1 -5
- package/dist/utils/datetime.js +12 -12
- package/package.json +3 -1
- package/src/components/ActionButton/ActionButton.stories.tsx +32 -13
- package/src/components/ActionButton/ActionButton.styles.ts +33 -8
- package/src/components/Button/Button.tsx +1 -4
- package/src/components/Collapsible/Collapsible.tsx +1 -1
- package/src/components/DataTable/DataTable.tsx +2 -2
- package/src/components/Icon/Icon.stories.tsx +450 -0
- package/src/components/Icon/Icon.styles.ts +26 -0
- package/src/components/Icon/Icon.tsx +67 -0
- package/src/components/Slider/Slider.stories.tsx +47 -0
- package/src/components/Slider/Slider.tsx +31 -0
- package/src/components/Switch/Switch.stories.tsx +46 -0
- package/src/components/Switch/Switch.tsx +32 -0
- package/src/components/Table/Table.tsx +2 -2
- package/src/components/Tabs/Tabs.tsx +100 -13
- package/src/components/Text/Text.tsx +35 -22
- package/src/icons/heroIconConfig.ts +23 -0
- package/src/icons/iconConfig.ts +2 -0
- package/src/icons/iconRegistry.ts +76 -0
- package/src/icons/index.ts +1 -0
- package/src/icons/material-icon/outline/ChevronDownIcon.tsx +22 -0
- package/src/icons/material-icon/outline/CollapseContentIcon.tsx +20 -0
- package/src/icons/material-icon/outline/ContentCopyIcon.tsx +20 -0
- package/src/icons/material-icon/outline/ContentPasteIcon.tsx +20 -0
- package/src/icons/material-icon/outline/DataTableIcon.tsx +20 -0
- package/src/icons/material-icon/outline/ExpandCircleDownIcon.tsx +20 -0
- package/src/icons/material-icon/outline/ExpandCircleRightIcon.tsx +20 -0
- package/src/icons/material-icon/outline/ExpandCircleUpIcon.tsx +20 -0
- package/src/icons/material-icon/outline/ExpandContentIcon.tsx +20 -0
- package/src/icons/material-icon/outline/InterestsIcon.tsx +20 -0
- package/src/icons/material-icon/outline/SaveIcon.tsx +20 -0
- package/src/icons/material-icon/outline/TableChartIcon.tsx +20 -0
- package/src/icons/material-icon/outline/index.ts +12 -0
- package/src/icons/material-icon/solid/ChevronDownIcon.tsx +22 -0
- package/src/icons/material-icon/solid/CollapseContentIcon.tsx +20 -0
- package/src/icons/material-icon/solid/ContentCopyIcon.tsx +20 -0
- package/src/icons/material-icon/solid/ContentPasteIcon.tsx +20 -0
- package/src/icons/material-icon/solid/DataTableIcon.tsx +20 -0
- package/src/icons/material-icon/solid/ExpandCircleDownIcon.tsx +20 -0
- package/src/icons/material-icon/solid/ExpandCircleRightIcon.tsx +20 -0
- package/src/icons/material-icon/solid/ExpandCircleUpIcon.tsx +20 -0
- package/src/icons/material-icon/solid/ExpandContentIcon.tsx +20 -0
- package/src/icons/material-icon/solid/InterestsIcon.tsx +20 -0
- package/src/icons/material-icon/solid/SaveIcon.tsx +20 -0
- package/src/icons/material-icon/solid/TableChartIcon.tsx +20 -0
- package/src/icons/material-icon/solid/index.ts +12 -0
- package/src/icons/materialIconConfig.tsx +23 -0
- package/src/icons/type.ts +11 -0
- package/src/icons/utils.ts +6 -0
- package/src/index.ts +5 -0
- package/src/theme/main-preset.js +24 -0
- package/src/theme/plugins/utilities/typography.js +9 -0
- package/src/theme/presets/colors.js +8 -1
- package/src/theme/tokens/color.css +1 -0
- package/src/theme/tokens/typography.css +21 -0
- package/dist/cjs/types/components/ActionButton/ActionButton.styles copy.d.ts +0 -6
- package/dist/cjs/types/components/Button/Button.styles copy.d.ts +0 -7
- package/dist/components/ActionButton/ActionButton.styles copy.js +0 -90
- package/dist/components/Button/Button.styles copy.js +0 -210
- package/dist/esm/types/components/ActionButton/ActionButton.styles copy.d.ts +0 -6
- package/dist/esm/types/components/Button/Button.styles copy.d.ts +0 -7
- package/src/_theme/global copy.css +0 -761
- package/src/_theme/global.css +0 -39
- package/src/_theme/main-preset.js +0 -239
- package/src/_theme/plugins/utilities/typography.js +0 -81
- package/src/_theme/presets/colors copy 2.js +0 -319
- package/src/_theme/presets/colors copy.js +0 -229
- package/src/_theme/presets/colors.js +0 -94
- package/src/_theme/theme.d.ts +0 -69
- package/src/_theme/variables/base/button.css +0 -334
- package/src/_theme/variables/base/components copy.css +0 -19
- package/src/_theme/variables/default/colors.css +0 -292
- package/src/_theme/variables/default/typography.css +0 -178
- package/src/_theme/variables/xspector/colors.css +0 -468
- package/src/_theme/variables/xspector/typography.css +0 -178
- package/src/components/ActionButton/ActionButton.styles copy.ts +0 -95
- package/src/components/Button/Button.styles copy.ts +0 -214
|
@@ -1,18 +1,7 @@
|
|
|
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
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import Button from "./Button";
|
|
14
3
|
// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
|
|
15
|
-
|
|
4
|
+
const meta = {
|
|
16
5
|
title: "Components/Button",
|
|
17
6
|
component: Button,
|
|
18
7
|
tags: ["autodocs"],
|
|
@@ -21,54 +10,54 @@ var meta = {
|
|
|
21
10
|
layout: "fullscreen",
|
|
22
11
|
},
|
|
23
12
|
decorators: [
|
|
24
|
-
|
|
13
|
+
(Story) => (_jsx("div", { className: "p-5", children: _jsx(Story, {}) })),
|
|
25
14
|
],
|
|
26
15
|
};
|
|
27
16
|
export default meta;
|
|
28
|
-
export
|
|
17
|
+
export const Solid = {
|
|
29
18
|
args: {
|
|
30
19
|
title: "Button",
|
|
31
20
|
disabled: false,
|
|
32
21
|
isLoading: false,
|
|
33
22
|
},
|
|
34
|
-
render:
|
|
35
|
-
|
|
36
|
-
return (_jsxs("div", { className: "flex items-start gap-2", children: [_jsx(Button,
|
|
23
|
+
render: (args) => {
|
|
24
|
+
const props = Object.assign(Object.assign({}, args), { className: "capitalize" });
|
|
25
|
+
return (_jsxs("div", { className: "flex items-start gap-2", children: [_jsx(Button, Object.assign({ color: "primary" }, props, { title: "primary" })), _jsx(Button, Object.assign({ color: "secondary" }, props, { title: "secondary" })), _jsx(Button, Object.assign({ color: "tertiary" }, props, { title: "tertiary" })), _jsx(Button, Object.assign({ color: "info" }, props, { title: "info" })), _jsx(Button, Object.assign({ color: "success" }, props, { title: "success" })), _jsx(Button, Object.assign({ color: "warning" }, props, { title: "warning" })), _jsx(Button, Object.assign({ color: "error" }, props, { title: "error" }))] }));
|
|
37
26
|
},
|
|
38
27
|
};
|
|
39
|
-
export
|
|
28
|
+
export const Outline = {
|
|
40
29
|
args: {
|
|
41
30
|
title: "Button",
|
|
42
31
|
variant: "outline",
|
|
43
32
|
disabled: false,
|
|
44
33
|
isLoading: false,
|
|
45
34
|
},
|
|
46
|
-
render:
|
|
47
|
-
|
|
48
|
-
return (_jsxs("div", { className: "flex gap-2", children: [_jsx(Button,
|
|
35
|
+
render: (args) => {
|
|
36
|
+
const props = Object.assign(Object.assign({}, args), { className: "capitalize" });
|
|
37
|
+
return (_jsxs("div", { className: "flex gap-2", children: [_jsx(Button, Object.assign({ color: "primary" }, props, { title: "primary" })), _jsx(Button, Object.assign({ color: "secondary" }, props, { title: "secondary" })), _jsx(Button, Object.assign({ color: "tertiary" }, props, { title: "tertiary" })), _jsx(Button, Object.assign({ color: "info" }, props, { title: "info" })), _jsx(Button, Object.assign({ color: "success" }, props, { title: "success" })), _jsx(Button, Object.assign({ color: "warning" }, props, { title: "warning" })), _jsx(Button, Object.assign({ color: "error" }, props, { title: "error" }))] }));
|
|
49
38
|
},
|
|
50
39
|
};
|
|
51
|
-
export
|
|
40
|
+
export const Flat = {
|
|
52
41
|
args: {
|
|
53
42
|
title: "Button",
|
|
54
43
|
variant: "flat",
|
|
55
44
|
disabled: false,
|
|
56
45
|
isLoading: false,
|
|
57
46
|
},
|
|
58
|
-
render:
|
|
59
|
-
|
|
60
|
-
return (_jsxs("div", { className: "flex gap-2", children: [_jsx(Button,
|
|
47
|
+
render: (args) => {
|
|
48
|
+
const props = Object.assign(Object.assign({}, args), { className: "capitalize" });
|
|
49
|
+
return (_jsxs("div", { className: "flex gap-2", children: [_jsx(Button, Object.assign({ color: "primary" }, props, { title: "primary" })), _jsx(Button, Object.assign({ color: "secondary" }, props, { title: "secondary" })), _jsx(Button, Object.assign({ color: "tertiary" }, props, { title: "tertiary" })), _jsx(Button, Object.assign({ color: "info" }, props, { title: "info" })), _jsx(Button, Object.assign({ color: "success" }, props, { title: "success" })), _jsx(Button, Object.assign({ color: "warning" }, props, { title: "warning" })), _jsx(Button, Object.assign({ color: "error" }, props, { title: "error" }))] }));
|
|
61
50
|
},
|
|
62
51
|
};
|
|
63
|
-
export
|
|
52
|
+
export const Link = {
|
|
64
53
|
args: {
|
|
65
54
|
title: "Button",
|
|
66
55
|
variant: "link",
|
|
67
56
|
disabled: false,
|
|
68
57
|
isLoading: false,
|
|
69
58
|
},
|
|
70
|
-
render:
|
|
71
|
-
|
|
72
|
-
return (_jsxs("div", { className: "flex gap-2", children: [_jsx(Button,
|
|
59
|
+
render: (args) => {
|
|
60
|
+
const props = Object.assign(Object.assign({}, args), { className: "capitalize" });
|
|
61
|
+
return (_jsxs("div", { className: "flex gap-2", children: [_jsx(Button, Object.assign({ color: "primary" }, props, { title: "primary" })), _jsx(Button, Object.assign({ color: "secondary" }, props, { title: "secondary" })), _jsx(Button, Object.assign({ color: "tertiary" }, props, { title: "tertiary" })), _jsx(Button, Object.assign({ color: "info" }, props, { title: "info" })), _jsx(Button, Object.assign({ color: "success" }, props, { title: "success" })), _jsx(Button, Object.assign({ color: "warning" }, props, { title: "warning" })), _jsx(Button, Object.assign({ color: "error" }, props, { title: "error" }))] }));
|
|
73
62
|
},
|
|
74
63
|
};
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
3
|
var t = {};
|
|
15
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -26,9 +15,9 @@ import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
|
26
15
|
// import "react-day-picker/dist/style.css";
|
|
27
16
|
import { cn } from "@/utils/cn";
|
|
28
17
|
function Calendar(_a) {
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
return (_jsx(DayPicker,
|
|
18
|
+
var { className, classNames, showOutsideDays = true } = _a, props = __rest(_a, ["className", "classNames", "showOutsideDays"]);
|
|
19
|
+
const defaultClassNames = getDefaultClassNames();
|
|
20
|
+
return (_jsx(DayPicker, Object.assign({ showOutsideDays: showOutsideDays, captionLayout: "dropdown-years" }, props, { className: cn("bg-surface text-surface-foreground border-surface", className), classNames: Object.assign(Object.assign(Object.assign({}, defaultClassNames), { day_button: cn(defaultClassNames.day_button, "size-9 "), day: "typography-subtitile1 ", today: "text-bold text-surface-foreground [&_button]:rounded-full [&_button]:!border-primary [&_button]:!border [&_button]:!border-solid", selected: "bg-primary !text-primary-foreground rounded-full ", weekdays: "text-gray-400", month_caption: cn(defaultClassNames.month_caption, "h-[54px]"), outside: "text-gray-400", nav: cn(defaultClassNames.nav, "gap-6 absolute flex right-0"), chevron: "fill-primary", root: cn(defaultClassNames.root, "px-6 py-4"), caption_label: cn(defaultClassNames.caption_label, "gap-2 flex items-center"), months: "flex flex-col relative" }), classNames), styles: {
|
|
32
21
|
caption_label: {
|
|
33
22
|
zIndex: 1,
|
|
34
23
|
position: "relative",
|
|
@@ -1,21 +1,10 @@
|
|
|
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
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import React from "react";
|
|
14
3
|
import Calendar from "./Calendar";
|
|
15
4
|
import ThemeToggle from "../ThemeToggle";
|
|
16
5
|
import Button from "../Button/Button";
|
|
17
6
|
// import { Popover, PopoverTrigger, PopoverContent } from "./Popover";
|
|
18
|
-
|
|
7
|
+
const meta = {
|
|
19
8
|
title: "Components/Calendar",
|
|
20
9
|
component: Calendar,
|
|
21
10
|
tags: ["autodocs"],
|
|
@@ -23,16 +12,16 @@ var meta = {
|
|
|
23
12
|
layout: "fullscreen",
|
|
24
13
|
},
|
|
25
14
|
decorators: [
|
|
26
|
-
|
|
15
|
+
(Story) => (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })),
|
|
27
16
|
],
|
|
28
17
|
};
|
|
29
18
|
export default meta;
|
|
30
|
-
export
|
|
19
|
+
export const Default = {
|
|
31
20
|
args: {},
|
|
32
|
-
render:
|
|
21
|
+
render: (args) => {
|
|
33
22
|
console.log("args ", args);
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
const props = Object.assign({}, args);
|
|
24
|
+
const [date, setDate] = React.useState(new Date());
|
|
36
25
|
return (_jsxs("div", { className: "flex flex-row gap-4 w-full", children: [_jsx(ThemeToggle, {}), _jsx(Button, { children: "Text" }), _jsx(Calendar, { mode: "single", selected: date, onSelect: setDate, className: "rounded-md border" })] }));
|
|
37
26
|
},
|
|
38
27
|
};
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
3
|
var t = {};
|
|
15
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -26,9 +15,9 @@ import * as React from "react";
|
|
|
26
15
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
27
16
|
import { CheckIcon } from "@heroicons/react/16/solid";
|
|
28
17
|
import { cn } from "@/utils/cn";
|
|
29
|
-
|
|
30
|
-
var className = _a
|
|
31
|
-
return (_jsx(CheckboxPrimitive.Root,
|
|
18
|
+
const Checkbox = React.forwardRef((_a, ref) => {
|
|
19
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
20
|
+
return (_jsx(CheckboxPrimitive.Root, Object.assign({ ref: ref, className: cn("peer h-4 w-4 shrink-0 rounded-sm border border-primary-30 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:border-state-disable-solid", {
|
|
32
21
|
"data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground": !props.disabled,
|
|
33
22
|
"bg-grey2-300": props.checked && props.disabled,
|
|
34
23
|
}, className) }, props, { children: _jsx(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current"), children: _jsx(CheckIcon, { className: "h-4 w-4" }) }) })));
|
|
@@ -1,17 +1,6 @@
|
|
|
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
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { Checkbox } from "./Checkbox";
|
|
14
|
-
|
|
3
|
+
const meta = {
|
|
15
4
|
title: "Components/Checkbox",
|
|
16
5
|
component: Checkbox,
|
|
17
6
|
tags: ["autodocs"],
|
|
@@ -19,31 +8,31 @@ var meta = {
|
|
|
19
8
|
layout: "fullscreen",
|
|
20
9
|
},
|
|
21
10
|
decorators: [
|
|
22
|
-
|
|
11
|
+
(Story) => (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })),
|
|
23
12
|
],
|
|
24
13
|
};
|
|
25
14
|
export default meta;
|
|
26
|
-
export
|
|
15
|
+
export const Default = {
|
|
27
16
|
args: {
|
|
28
17
|
checked: false,
|
|
29
18
|
disabled: false,
|
|
30
19
|
},
|
|
31
|
-
render:
|
|
32
|
-
|
|
33
|
-
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(Checkbox,
|
|
20
|
+
render: (args) => {
|
|
21
|
+
const props = Object.assign({}, args);
|
|
22
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(Checkbox, Object.assign({ id: "terms" }, props)), _jsx("label", { htmlFor: "terms", className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: "Accept terms and conditions" })] }) }));
|
|
34
23
|
},
|
|
35
24
|
};
|
|
36
|
-
export
|
|
25
|
+
export const WithText = {
|
|
37
26
|
args: {},
|
|
38
|
-
render:
|
|
39
|
-
|
|
27
|
+
render: (args) => {
|
|
28
|
+
const props = Object.assign({}, args);
|
|
40
29
|
return (_jsxs("div", { className: "items-top flex space-x-2", children: [_jsx(Checkbox, { id: "terms1" }), _jsxs("div", { className: "grid gap-1.5 leading-none", children: [_jsx("label", { htmlFor: "terms1", className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: "Accept terms and conditions" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "You agree to our Terms of Service and Privacy Policy." })] })] }));
|
|
41
30
|
},
|
|
42
31
|
};
|
|
43
|
-
export
|
|
32
|
+
export const Diabled = {
|
|
44
33
|
args: {},
|
|
45
|
-
render:
|
|
46
|
-
|
|
34
|
+
render: (args) => {
|
|
35
|
+
const props = Object.assign({}, args);
|
|
47
36
|
return (_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(Checkbox, { id: "terms2", disabled: true }), _jsx("label", { htmlFor: "terms2", className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: "Accept terms and conditions" })] }));
|
|
48
37
|
},
|
|
49
38
|
};
|
|
@@ -4,31 +4,28 @@ import { ChevronDownIcon } from "@heroicons/react/16/solid";
|
|
|
4
4
|
import { CollapsibleProvider, useCollapsible } from "./CollapsibleContext";
|
|
5
5
|
import { cn } from "@/utils/cn";
|
|
6
6
|
import { collapseButtonVariants, collapseContainerVariants, collapseIconVariants, collapsePanelVariants, } from "./Collapsible.styles";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var collapseIconClassName = collapseIconVariants({ isExpand: isExpand, size: size });
|
|
7
|
+
const CollapsibleButton = forwardRef(({ children, className, hideExpandIcon = false }, ref) => {
|
|
8
|
+
const { toggle, isExpand, size } = useCollapsible();
|
|
9
|
+
const collapseButtonClassName = collapseButtonVariants({ size });
|
|
10
|
+
const collapseIconClassName = collapseIconVariants({ isExpand, size });
|
|
12
11
|
return (_jsxs("button", { onClick: toggle, className: cn(collapseButtonClassName, className), ref: ref, children: [_jsx("span", { className: "flex flex-1", children: children }), !hideExpandIcon && (_jsx("span", { className: cn(collapseIconClassName), children: _jsx(ChevronDownIcon, { className: cn("size-full") }) }))] }));
|
|
13
12
|
});
|
|
14
13
|
CollapsibleButton.displayName = "CollapsibleButton";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
useEffect(function () {
|
|
14
|
+
const CollapsiblePanel = forwardRef(({ children, className }, ref) => {
|
|
15
|
+
const { isExpand, size } = useCollapsible();
|
|
16
|
+
const collapsePanelClassName = collapsePanelVariants({ size });
|
|
17
|
+
const [height, setHeight] = useState("0px");
|
|
18
|
+
const contentRef = useRef(null);
|
|
19
|
+
useEffect(() => {
|
|
22
20
|
if (contentRef.current) {
|
|
23
|
-
setHeight(isExpand ?
|
|
21
|
+
setHeight(isExpand ? `${contentRef.current.scrollHeight}px` : "0px");
|
|
24
22
|
}
|
|
25
23
|
}, [isExpand, children]); // Add `children` to the dependency array to recalculate height on content change
|
|
26
|
-
return (_jsx("div", { ref: ref, className: cn("overflow-hidden transition-all ease-in-out"), style: { height
|
|
24
|
+
return (_jsx("div", { ref: ref, className: cn("overflow-hidden transition-all ease-in-out"), style: { height }, children: _jsx("div", { ref: contentRef, className: cn(collapsePanelClassName, className), children: children }) }));
|
|
27
25
|
});
|
|
28
26
|
CollapsiblePanel.displayName = "CollapsiblePanel";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var collapseContainerClassName = collapseContainerVariants();
|
|
27
|
+
const Collapsible = forwardRef(({ children, isExpand, size, className, onToggle }, ref) => {
|
|
28
|
+
const collapseContainerClassName = collapseContainerVariants();
|
|
32
29
|
return (_jsx(CollapsibleProvider, { size: size, isExpandControlled: isExpand, onToggle: onToggle, children: _jsx("div", { ref: ref, className: cn(collapseContainerClassName, className), children: children }) }));
|
|
33
30
|
});
|
|
34
31
|
Collapsible.displayName = "Collapsible";
|
|
@@ -1,18 +1,7 @@
|
|
|
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
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { useEffect } from "react";
|
|
14
3
|
import Collapsible from "./Collapsible";
|
|
15
|
-
|
|
4
|
+
const meta = {
|
|
16
5
|
title: "Components/Collapsible",
|
|
17
6
|
component: Collapsible,
|
|
18
7
|
tags: ["autodocs"],
|
|
@@ -20,25 +9,25 @@ var meta = {
|
|
|
20
9
|
layout: "fullscreen",
|
|
21
10
|
},
|
|
22
11
|
decorators: [
|
|
23
|
-
|
|
12
|
+
(Story) => (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })),
|
|
24
13
|
],
|
|
25
14
|
};
|
|
26
15
|
export default meta;
|
|
27
|
-
|
|
28
|
-
useEffect(
|
|
16
|
+
const Test = () => {
|
|
17
|
+
useEffect(() => {
|
|
29
18
|
console.log("Mont");
|
|
30
|
-
return
|
|
19
|
+
return () => {
|
|
31
20
|
console.log("UnMont");
|
|
32
21
|
};
|
|
33
22
|
}, []);
|
|
34
23
|
return _jsx("p", { children: "This is the content of section 1." });
|
|
35
24
|
};
|
|
36
|
-
export
|
|
25
|
+
export const Default = {
|
|
37
26
|
args: {
|
|
38
27
|
size: "md",
|
|
39
28
|
},
|
|
40
|
-
render:
|
|
41
|
-
|
|
42
|
-
return (_jsxs("div", { className: "flex flex-col gap-1 w-full ", children: [_jsxs(Collapsible,
|
|
29
|
+
render: (args) => {
|
|
30
|
+
const props = Object.assign({}, args);
|
|
31
|
+
return (_jsxs("div", { className: "flex flex-col gap-1 w-full ", children: [_jsxs(Collapsible, Object.assign({ isExpand: true }, props, { children: [_jsx(Collapsible.Button, { children: "Section 1" }), _jsx(Collapsible.Panel, { children: "This is the content of section 1." })] })), _jsxs(Collapsible, { children: [_jsx(Collapsible.Button, { children: "Section 2" }), _jsx(Collapsible.Panel, { children: _jsx("p", { children: "This is the content of section 2." }) })] }), _jsxs(Collapsible, { children: [_jsx(Collapsible.Button, { children: "Section 3" }), _jsx(Collapsible.Panel, { children: _jsx("p", { children: "This is the content of section 3." }) })] })] }));
|
|
43
32
|
},
|
|
44
33
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
export
|
|
2
|
+
export const collapseButtonVariants = cva([
|
|
3
3
|
"flex flex-1 bg-secondary-default hover:bg-secondary-hover text-secondary-foreground",
|
|
4
4
|
"focus:outline-none focus-visible:ring focus-visible:ring-gray-500 focus-visible:ring-opacity-75",
|
|
5
5
|
], {
|
|
@@ -14,7 +14,7 @@ export var collapseButtonVariants = cva([
|
|
|
14
14
|
size: "md",
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
|
-
export
|
|
17
|
+
export const collapseIconVariants = cva(["transition-all flex content-center justify-center "], {
|
|
18
18
|
variants: {
|
|
19
19
|
size: {
|
|
20
20
|
sm: "size-5",
|
|
@@ -30,7 +30,7 @@ export var collapseIconVariants = cva(["transition-all flex content-center justi
|
|
|
30
30
|
isExpand: false,
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
|
-
export
|
|
33
|
+
export const collapsePanelVariants = cva([
|
|
34
34
|
"flex flex-1 border-t border-t-secondary",
|
|
35
35
|
"transition ease-in-out delay-150 duration-300",
|
|
36
36
|
], {
|
|
@@ -45,6 +45,6 @@ export var collapsePanelVariants = cva([
|
|
|
45
45
|
size: "md",
|
|
46
46
|
},
|
|
47
47
|
});
|
|
48
|
-
export
|
|
48
|
+
export const collapseContainerVariants = cva([
|
|
49
49
|
"flex flex-col border border-secondary rounded overflow-hidden",
|
|
50
50
|
]);
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useContext, useState, useEffect, } from "react";
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
3
|
+
const CollapsibleContext = createContext(undefined);
|
|
4
|
+
export const useCollapsible = () => {
|
|
5
|
+
const context = useContext(CollapsibleContext);
|
|
6
6
|
if (!context) {
|
|
7
7
|
throw new Error("useCollapsible must be used within a CollapsibleProvider");
|
|
8
8
|
}
|
|
9
9
|
return context;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
setIsExpand(function (prev) { return !prev; });
|
|
11
|
+
export const CollapsibleProvider = ({ size, children, isExpandControlled, onToggle, }) => {
|
|
12
|
+
const [isExpand, setIsExpand] = useState(false);
|
|
13
|
+
const toggle = () => {
|
|
14
|
+
setIsExpand((prev) => !prev);
|
|
16
15
|
if (onToggle)
|
|
17
16
|
onToggle(!isExpand);
|
|
18
17
|
};
|
|
19
|
-
useEffect(
|
|
18
|
+
useEffect(() => {
|
|
20
19
|
if (isExpandControlled !== undefined) {
|
|
21
20
|
setIsExpand(isExpandControlled);
|
|
22
21
|
}
|
|
23
22
|
}, [isExpandControlled]);
|
|
24
|
-
return (_jsx(CollapsibleContext.Provider, { value: { size
|
|
23
|
+
return (_jsx(CollapsibleContext.Provider, { value: { size, isExpand, toggle, setIsExpand }, children: children }));
|
|
25
24
|
};
|
|
@@ -5,18 +5,17 @@ getSortedRowModel, useReactTable, } from "@tanstack/react-table";
|
|
|
5
5
|
import { useEffect, useRef, useState } from "react";
|
|
6
6
|
import { ArrowDownIcon, ArrowUpIcon, ArrowsUpDownIcon, ClipboardDocumentListIcon, } from "@heroicons/react/16/solid";
|
|
7
7
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "../Table/Table";
|
|
8
|
-
export function DataTable(
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
manualSorting: manualSorting,
|
|
8
|
+
export function DataTable({ data, columns, manualSorting = false, onSorting, fetchMoreData, }) {
|
|
9
|
+
var _a;
|
|
10
|
+
const tableBodyRef = useRef(null);
|
|
11
|
+
const [sorting, setSorting] = useState([]);
|
|
12
|
+
const [columnFilters, setColumnFilters] = useState([]);
|
|
13
|
+
const [columnVisibility, setColumnVisibility] = useState({});
|
|
14
|
+
const [rowSelection, setRowSelection] = useState({});
|
|
15
|
+
const table = useReactTable({
|
|
16
|
+
data,
|
|
17
|
+
columns,
|
|
18
|
+
manualSorting,
|
|
20
19
|
onSortingChange: setSorting,
|
|
21
20
|
onColumnFiltersChange: setColumnFilters,
|
|
22
21
|
getCoreRowModel: getCoreRowModel(),
|
|
@@ -26,46 +25,46 @@ export function DataTable(_a) {
|
|
|
26
25
|
onColumnVisibilityChange: setColumnVisibility,
|
|
27
26
|
onRowSelectionChange: setRowSelection,
|
|
28
27
|
state: {
|
|
29
|
-
sorting
|
|
30
|
-
columnFilters
|
|
31
|
-
columnVisibility
|
|
32
|
-
rowSelection
|
|
28
|
+
sorting,
|
|
29
|
+
columnFilters,
|
|
30
|
+
columnVisibility,
|
|
31
|
+
rowSelection,
|
|
33
32
|
// pagination: {
|
|
34
33
|
// pageSize: 100,
|
|
35
34
|
// pageIndex: 0,
|
|
36
35
|
// },
|
|
37
36
|
},
|
|
38
37
|
});
|
|
39
|
-
useEffect(
|
|
38
|
+
useEffect(() => {
|
|
40
39
|
onSorting === null || onSorting === void 0 ? void 0 : onSorting(sorting);
|
|
41
40
|
}, [sorting, onSorting]);
|
|
42
|
-
useEffect(
|
|
43
|
-
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
const handleScroll = () => {
|
|
44
43
|
if (tableBodyRef.current) {
|
|
45
|
-
|
|
44
|
+
const { scrollTop, scrollHeight, clientHeight } = tableBodyRef.current;
|
|
46
45
|
if (scrollTop + clientHeight >= scrollHeight - 10) {
|
|
47
46
|
fetchMoreData === null || fetchMoreData === void 0 ? void 0 : fetchMoreData();
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
};
|
|
51
|
-
|
|
50
|
+
const tableBodyElement = tableBodyRef.current;
|
|
52
51
|
if (tableBodyElement) {
|
|
53
52
|
tableBodyElement.addEventListener("scroll", handleScroll);
|
|
54
53
|
}
|
|
55
|
-
return
|
|
54
|
+
return () => {
|
|
56
55
|
if (tableBodyElement) {
|
|
57
56
|
tableBodyElement.removeEventListener("scroll", handleScroll);
|
|
58
57
|
}
|
|
59
58
|
};
|
|
60
59
|
}, [fetchMoreData]);
|
|
61
|
-
|
|
62
|
-
return (_jsx("div", { className: "flex w-full h-full rounded-xl overflow-hidden border border-primary-10", children: _jsxs(Table, { className: isEmpty ? "h-full" : "", rootRef: tableBodyRef, children: [_jsx(TableHeader, { className: "sticky top-0", children: table.getHeaderGroups().map(
|
|
60
|
+
const isEmpty = ((_a = table.getRowModel().rows) === null || _a === void 0 ? void 0 : _a.length) === 0;
|
|
61
|
+
return (_jsx("div", { className: "flex w-full h-full rounded-xl overflow-hidden border border-primary-10", children: _jsxs(Table, { className: isEmpty ? "h-full" : "", rootRef: tableBodyRef, children: [_jsx(TableHeader, { className: "sticky top-0", children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { className: "", children: headerGroup.headers.map((header, i) => {
|
|
63
62
|
var _a;
|
|
64
63
|
return (_jsx(TableHead, { children: _jsxs("div", { className: "flex flex-row items-center cursor-pointer", onClick: header.column.getToggleSortingHandler(), children: [header.isPlaceholder
|
|
65
64
|
? null
|
|
66
65
|
: flexRender(header.column.columnDef.header, header.getContext()), (_a = {
|
|
67
66
|
asc: _jsx(ArrowUpIcon, { className: "ml-3 h-4 w-4" }),
|
|
68
67
|
desc: _jsx(ArrowDownIcon, { className: "ml-3 h-4 w-4" }),
|
|
69
|
-
}[header.column.getIsSorted()]) !== null && _a !== void 0 ? _a : (header.column.getCanSort() ? (_jsx(ArrowsUpDownIcon, { className: "ml-3 h-4 w-4 text-
|
|
70
|
-
}) }, headerGroup.id))
|
|
68
|
+
}[header.column.getIsSorted()]) !== null && _a !== void 0 ? _a : (header.column.getCanSort() ? (_jsx(ArrowsUpDownIcon, { className: "ml-3 h-4 w-4 text-text-grey-light" })) : null)] }) }, header.id));
|
|
69
|
+
}) }, headerGroup.id))) }), _jsx(TableBody, { className: "overflow-y-scroll", children: !isEmpty ? (table.getRowModel().rows.map((row) => (_jsx(TableRow, { "data-state": row.getIsSelected() && "selected", className: "", children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) : (_jsx(TableRow, { className: "h-full self-stretch", children: _jsx(TableCell, { colSpan: columns.length, className: "typography-body1 text-text-grey-medium text-center h-full", children: _jsxs("div", { className: "flex flex-1 h-full flex-col items-center justify-center gap-3", children: [_jsx(ClipboardDocumentListIcon, { className: "w-8 text-secondary-120" }), "There is no information yet."] }) }) })) })] }) }));
|
|
71
70
|
}
|
|
@@ -1,17 +1,6 @@
|
|
|
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
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import { DataTable } from "./DataTable";
|
|
14
|
-
|
|
3
|
+
const meta = {
|
|
15
4
|
title: "Components/DataTable",
|
|
16
5
|
component: DataTable,
|
|
17
6
|
tags: ["autodocs"],
|
|
@@ -19,11 +8,11 @@ var meta = {
|
|
|
19
8
|
layout: "fullscreen",
|
|
20
9
|
},
|
|
21
10
|
decorators: [
|
|
22
|
-
|
|
11
|
+
(Story) => (_jsx("div", { className: "p-5 flex flex-1 h-full w-full ", style: { height: "100vh" }, children: _jsx(Story, {}) })),
|
|
23
12
|
],
|
|
24
13
|
};
|
|
25
14
|
export default meta;
|
|
26
|
-
|
|
15
|
+
const columns = [
|
|
27
16
|
{
|
|
28
17
|
accessorKey: "amount",
|
|
29
18
|
},
|
|
@@ -34,12 +23,12 @@ var columns = [
|
|
|
34
23
|
accessorKey: "email",
|
|
35
24
|
},
|
|
36
25
|
];
|
|
37
|
-
export
|
|
26
|
+
export const Default = {
|
|
38
27
|
args: {},
|
|
39
|
-
render:
|
|
28
|
+
render: (args) => {
|
|
40
29
|
console.log("args ", args);
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
const props = Object.assign({}, args);
|
|
31
|
+
const data = new Array(20).fill(0).map((__, i) => ({
|
|
43
32
|
id: "m5gr84i9",
|
|
44
33
|
amount: i + 1,
|
|
45
34
|
status: "success",
|
|
@@ -47,10 +36,10 @@ export var Default = {
|
|
|
47
36
|
email1: "ken99@yahoo.com",
|
|
48
37
|
email2: "ken99@yahoo.com",
|
|
49
38
|
email3: "ken99@yahoo.com",
|
|
50
|
-
})
|
|
51
|
-
return (_jsx("div", { className: "flex flex-1 h-full flex-row gap-4 w-full", children: _jsx(DataTable, { columns: columns, data: data, onSorting:
|
|
39
|
+
}));
|
|
40
|
+
return (_jsx("div", { className: "flex flex-1 h-full flex-row gap-4 w-full", children: _jsx(DataTable, { columns: columns, data: data, onSorting: (sorting) => {
|
|
52
41
|
console.log("sorting ", sorting);
|
|
53
|
-
}, fetchMoreData:
|
|
42
|
+
}, fetchMoreData: () => {
|
|
54
43
|
console.log("fetchMoreData");
|
|
55
44
|
} }) }));
|
|
56
45
|
},
|