@rovula/ui 0.0.21 → 0.0.22
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 +155 -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/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 +56 -9
- package/dist/components/Tabs/Tabs.stories.js +13 -24
- package/dist/components/Text/Text.js +3 -4
- 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 +155 -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/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 +30 -4
- package/dist/index.js +4 -0
- package/dist/src/theme/global.css +187 -619
- package/dist/stories/ColorGroupPreview.js +6 -9
- package/dist/stories/ColorPreview.js +1 -2
- package/dist/theme/presets/colors.js +2 -1
- 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/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 +32 -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 +99 -12
- 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/presets/colors.js +2 -1
- 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,8 @@
|
|
|
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 ActionButton from "./ActionButton";
|
|
14
3
|
import { ArrowsUpDownIcon } from "@heroicons/react/16/solid";
|
|
15
|
-
|
|
4
|
+
import Icon from "../Icon/Icon";
|
|
5
|
+
const meta = {
|
|
16
6
|
title: "Components/ActionButton",
|
|
17
7
|
component: ActionButton,
|
|
18
8
|
tags: ["autodocs"],
|
|
@@ -20,26 +10,26 @@ var meta = {
|
|
|
20
10
|
layout: "fullscreen",
|
|
21
11
|
},
|
|
22
12
|
decorators: [
|
|
23
|
-
|
|
13
|
+
(Story) => (_jsx("div", { className: "p-5", children: _jsx(Story, {}) })),
|
|
24
14
|
],
|
|
25
15
|
};
|
|
26
16
|
export default meta;
|
|
27
|
-
export
|
|
17
|
+
export const Default = {
|
|
28
18
|
args: {
|
|
29
19
|
variant: "solid",
|
|
30
|
-
size: "
|
|
20
|
+
size: "md",
|
|
31
21
|
},
|
|
32
|
-
render:
|
|
22
|
+
render: (args) => {
|
|
33
23
|
console.log("args ", args);
|
|
34
|
-
|
|
35
|
-
return (_jsx("div", { className: "flex flex-row
|
|
24
|
+
const props = Object.assign({}, args);
|
|
25
|
+
return (_jsx("div", { className: "flex flex-row gap-2 items-start", children: _jsx(ActionButton, Object.assign({}, props, { children: _jsx(Icon, { type: "heroicons", name: "arrow-left" }) })) }));
|
|
36
26
|
},
|
|
37
27
|
};
|
|
38
|
-
export
|
|
28
|
+
export const Preview = {
|
|
39
29
|
args: {},
|
|
40
|
-
render:
|
|
30
|
+
render: (args) => {
|
|
41
31
|
console.log("args ", args);
|
|
42
|
-
|
|
43
|
-
return (_jsxs("div", { className: "flex flex-col gap-2 w-full p-20", children: [_jsxs("div", { className: "flex flex-row justify-between items-center", children: [_jsx("h6", { className: "w-[20px] text-white", children: "Default:" }), _jsxs("div", { className: "flex flex-row gap-2 ", children: [_jsx(ActionButton, { variant: "solid", size: "lg", children: _jsx(
|
|
32
|
+
const props = Object.assign({}, args);
|
|
33
|
+
return (_jsxs("div", { className: "flex flex-col gap-2 w-full p-20", children: [_jsxs("div", { className: "flex flex-row justify-between items-center", children: [_jsx("h6", { className: "w-[20px] text-white", children: "Default:" }), _jsxs("div", { className: "flex flex-row gap-2 items-start ", children: [_jsx(ActionButton, { variant: "solid", size: "lg", children: _jsx(Icon, { type: "heroicons", name: "arrows-up-down" }) }), _jsx(ActionButton, { variant: "solid", size: "md", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "sm", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "xs", children: _jsx(ArrowsUpDownIcon, {}) })] }), _jsxs("div", { className: "flex flex-row gap-2 items-start", children: [_jsx(ActionButton, { variant: "outline", size: "lg", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "md", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "sm", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "xs", children: _jsx(ArrowsUpDownIcon, {}) })] }), _jsxs("div", { className: "flex flex-row gap-2 items-start", children: [_jsx(ActionButton, { variant: "icon", size: "lg", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "md", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "sm", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "xs", children: _jsx(ArrowsUpDownIcon, {}) })] })] }), _jsxs("div", { className: "flex flex-row justify-between", children: [_jsx("h6", { className: "w-[20px] text-white", children: "Active:" }), _jsxs("div", { className: "flex flex-row gap-2 items-start", children: [_jsx(ActionButton, { variant: "solid", size: "lg", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "md", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "sm", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "xs", active: true, children: _jsx(ArrowsUpDownIcon, {}) })] }), _jsxs("div", { className: "flex flex-row gap-2 items-start", children: [_jsx(ActionButton, { variant: "outline", size: "lg", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "md", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "sm", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "xs", active: true, children: _jsx(ArrowsUpDownIcon, {}) })] }), _jsxs("div", { className: "flex flex-row gap-2 items-start", children: [_jsx(ActionButton, { variant: "icon", size: "lg", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "md", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "sm", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "xs", active: true, children: _jsx(ArrowsUpDownIcon, {}) })] })] }), _jsxs("div", { className: "flex flex-row justify-between", children: [_jsx("h6", { className: "w-[20px] text-white", children: "Disabled:" }), _jsxs("div", { className: "flex flex-row gap-2 items-start", children: [_jsx(ActionButton, { variant: "solid", size: "lg", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "md", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "sm", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "xs", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) })] }), _jsxs("div", { className: "flex flex-row gap-2 items-start", children: [_jsx(ActionButton, { variant: "outline", size: "lg", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "md", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "sm", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "xs", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) })] }), _jsxs("div", { className: "flex flex-row gap-2 items-start", children: [_jsx(ActionButton, { variant: "icon", size: "lg", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "md", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "sm", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "xs", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) })] })] })] }));
|
|
44
34
|
},
|
|
45
35
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
export
|
|
2
|
+
export const actionButtonVariants = cva(["box-border flex items-center justify-center"], {
|
|
3
3
|
variants: {
|
|
4
4
|
variant: {
|
|
5
5
|
solid: [
|
|
@@ -21,10 +21,10 @@ export var actionButtonVariants = cva(["rounded-md box-border flex items-center
|
|
|
21
21
|
],
|
|
22
22
|
},
|
|
23
23
|
size: {
|
|
24
|
-
xs: "
|
|
25
|
-
sm: "
|
|
26
|
-
md: "
|
|
27
|
-
lg: "
|
|
24
|
+
xs: "",
|
|
25
|
+
sm: "",
|
|
26
|
+
md: "",
|
|
27
|
+
lg: "",
|
|
28
28
|
},
|
|
29
29
|
disabled: {
|
|
30
30
|
false: "",
|
|
@@ -61,20 +61,45 @@ export var actionButtonVariants = cva(["rounded-md box-border flex items-center
|
|
|
61
61
|
"active:bg-action-button-icon-active-pressed active:border-action-button-icon-active-pressed active:text-action-button-icon-active-pressed active:fill-action-button-icon-active-pressed",
|
|
62
62
|
],
|
|
63
63
|
},
|
|
64
|
+
{
|
|
65
|
+
size: "lg",
|
|
66
|
+
variant: ["solid", "outline"],
|
|
67
|
+
className: "px-lg py-md [&_svg]:size-[32px] rounded-md",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
size: "md",
|
|
71
|
+
variant: ["solid", "outline"],
|
|
72
|
+
className: "px-md py-sm [&_svg]:size-[22px] rounded-md",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
size: "sm",
|
|
76
|
+
variant: ["solid", "outline"],
|
|
77
|
+
className: "px-sm py-xs [&_svg]:size-[22px] rounded-sm",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
size: "xs",
|
|
81
|
+
variant: ["solid", "outline"],
|
|
82
|
+
className: "px-xs py-xxs [&_svg]:size-[14px] rounded-xs",
|
|
83
|
+
},
|
|
64
84
|
{
|
|
65
85
|
size: "lg",
|
|
66
86
|
variant: "icon",
|
|
67
|
-
className: "
|
|
87
|
+
className: "px-lg py-lg [&_svg]:size-[32px] rounded-full",
|
|
68
88
|
},
|
|
69
89
|
{
|
|
70
90
|
size: "md",
|
|
71
91
|
variant: "icon",
|
|
72
|
-
className: "
|
|
92
|
+
className: "px-md py-md [&_svg]:size-[22px] rounded-full",
|
|
73
93
|
},
|
|
74
94
|
{
|
|
75
95
|
size: "sm",
|
|
76
96
|
variant: "icon",
|
|
77
|
-
className: "
|
|
97
|
+
className: "px-xs py-xs [&_svg]:size-[22px] rounded-full",
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
size: "xs",
|
|
101
|
+
variant: "icon",
|
|
102
|
+
className: "px-xxs py-xxs [&_svg]:size-[14px] rounded-full",
|
|
78
103
|
},
|
|
79
104
|
{
|
|
80
105
|
variant: "solid",
|
|
@@ -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 { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "./AlertDialog";
|
|
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/Alert",
|
|
17
6
|
component: AlertDialog,
|
|
18
7
|
tags: ["autodocs"],
|
|
@@ -21,19 +10,19 @@ var meta = {
|
|
|
21
10
|
layout: "fullscreen",
|
|
22
11
|
},
|
|
23
12
|
decorators: [
|
|
24
|
-
|
|
13
|
+
(Story) => (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })),
|
|
25
14
|
],
|
|
26
15
|
};
|
|
27
16
|
export default meta;
|
|
28
|
-
export
|
|
17
|
+
export const Default = {
|
|
29
18
|
args: {
|
|
30
19
|
// label: "Lorem Ipsum",
|
|
31
20
|
// value: "Lorem Ipsum",
|
|
32
21
|
// fullwidth: true,
|
|
33
22
|
},
|
|
34
|
-
render:
|
|
23
|
+
render: (args) => {
|
|
35
24
|
console.log("args ", args);
|
|
36
|
-
|
|
25
|
+
const props = Object.assign({}, args);
|
|
37
26
|
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsxs(AlertDialog, { children: [_jsx(AlertDialogTrigger, { children: "Open" }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Are you absolutely sure?" }), _jsx(AlertDialogDescription, { children: "This action cannot be undone. This will permanently delete your account and remove your data from our servers." })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Cancel" }), _jsx(AlertDialogAction, { children: "Continue" })] })] })] }) }));
|
|
38
27
|
},
|
|
39
28
|
};
|
|
@@ -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,48 +15,48 @@ import * as React from "react";
|
|
|
26
15
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
27
16
|
import { cn } from "@/utils/cn";
|
|
28
17
|
import { buttonVariants } from "../Button/Button.styles";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var className = _a
|
|
34
|
-
return (_jsx(AlertDialogPrimitive.Overlay,
|
|
18
|
+
const AlertDialog = AlertDialogPrimitive.Root;
|
|
19
|
+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
20
|
+
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
21
|
+
const AlertDialogOverlay = React.forwardRef((_a, ref) => {
|
|
22
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
23
|
+
return (_jsx(AlertDialogPrimitive.Overlay, Object.assign({ className: cn("fixed inset-0 bg-base-popup-curtain z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className) }, props, { ref: ref })));
|
|
35
24
|
});
|
|
36
25
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
37
|
-
|
|
38
|
-
var className = _a
|
|
39
|
-
return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content,
|
|
26
|
+
const AlertDialogContent = React.forwardRef((_a, ref) => {
|
|
27
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
28
|
+
return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, Object.assign({ ref: ref, className: cn("fixed text-base-popup-foreground left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-6 border border-base-popup bg-base-popup p-8 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-md", className) }, props))] }));
|
|
40
29
|
});
|
|
41
30
|
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
42
|
-
|
|
43
|
-
var className = _a
|
|
44
|
-
return (_jsx("div",
|
|
31
|
+
const AlertDialogHeader = (_a) => {
|
|
32
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
33
|
+
return (_jsx("div", Object.assign({ className: cn("flex flex-col space-y-2 text-center sm:text-left", className) }, props)));
|
|
45
34
|
};
|
|
46
35
|
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
47
|
-
|
|
48
|
-
var className = _a
|
|
49
|
-
return (_jsx("div",
|
|
36
|
+
const AlertDialogFooter = (_a) => {
|
|
37
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
38
|
+
return (_jsx("div", Object.assign({ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className) }, props)));
|
|
50
39
|
};
|
|
51
40
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
52
|
-
|
|
53
|
-
var className = _a
|
|
54
|
-
return (_jsx(AlertDialogPrimitive.Title,
|
|
41
|
+
const AlertDialogTitle = React.forwardRef((_a, ref) => {
|
|
42
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
43
|
+
return (_jsx(AlertDialogPrimitive.Title, Object.assign({ ref: ref, className: cn("typography-h5", className) }, props)));
|
|
55
44
|
});
|
|
56
45
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
57
|
-
|
|
58
|
-
var className = _a
|
|
59
|
-
return (_jsx(AlertDialogPrimitive.Description,
|
|
46
|
+
const AlertDialogDescription = React.forwardRef((_a, ref) => {
|
|
47
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
48
|
+
return (_jsx(AlertDialogPrimitive.Description, Object.assign({ ref: ref, className: cn("text-sm", className) }, props)));
|
|
60
49
|
});
|
|
61
50
|
AlertDialogDescription.displayName =
|
|
62
51
|
AlertDialogPrimitive.Description.displayName;
|
|
63
|
-
|
|
64
|
-
var className = _a
|
|
65
|
-
return (_jsx(AlertDialogPrimitive.Action,
|
|
52
|
+
const AlertDialogAction = React.forwardRef((_a, ref) => {
|
|
53
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
54
|
+
return (_jsx(AlertDialogPrimitive.Action, Object.assign({ ref: ref, className: cn(buttonVariants({ fullwidth: false }), className) }, props)));
|
|
66
55
|
});
|
|
67
56
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
68
|
-
|
|
69
|
-
var className = _a
|
|
70
|
-
return (_jsx(AlertDialogPrimitive.Cancel,
|
|
57
|
+
const AlertDialogCancel = React.forwardRef((_a, ref) => {
|
|
58
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
59
|
+
return (_jsx(AlertDialogPrimitive.Cancel, Object.assign({ ref: ref, className: cn(buttonVariants({ fullwidth: false, variant: "outline" }), "mt-2 sm:mt-0", className) }, props)));
|
|
71
60
|
});
|
|
72
61
|
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
73
62
|
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
@@ -3,18 +3,17 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { cn } from "@/utils/cn";
|
|
4
4
|
import { AvatarBase, AvatarFallback, AvatarImage } from "./AvatarBase";
|
|
5
5
|
import { avatarVariants } from "./Avatar.styles";
|
|
6
|
-
export
|
|
6
|
+
export const formatAvatarName = (text) => {
|
|
7
7
|
var _a, _b, _c;
|
|
8
8
|
if (!text.length)
|
|
9
9
|
return "-";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return
|
|
10
|
+
const spitWithSpace = text.split(" ");
|
|
11
|
+
const first = text === null || text === void 0 ? void 0 : text.charAt(0);
|
|
12
|
+
const last = (_c = (_b = (_a = spitWithSpace === null || spitWithSpace === void 0 ? void 0 : spitWithSpace[1]) === null || _a === void 0 ? void 0 : _a.charAt(0)) !== null && _b !== void 0 ? _b : text === null || text === void 0 ? void 0 : text.charAt(1)) !== null && _c !== void 0 ? _c : "";
|
|
13
|
+
return `${first}${last}`;
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var avatarClassname = avatarVariants({ size: size, rounded: rounded });
|
|
15
|
+
const Avatar = ({ text, imageUrl, icon, fallback, size, rounded, className, imageClassName, fallbackClassName, type = "text", children, style, }) => {
|
|
16
|
+
const avatarClassname = avatarVariants({ size, rounded });
|
|
18
17
|
return (_jsx(AvatarBase, { className: cn(avatarClassname, className), style: style, children: children || (_jsxs(_Fragment, { children: [type === "image" && (_jsxs(_Fragment, { children: [_jsx(AvatarImage, { src: imageUrl, className: cn(imageClassName) }), _jsx(AvatarFallback, { className: cn(fallbackClassName), children: typeof fallback === "string"
|
|
19
18
|
? formatAvatarName(fallback)
|
|
20
19
|
: fallback })] })), type === "text" && formatAvatarName(text !== null && text !== void 0 ? text : ""), type === "icon" && icon] })) }));
|
|
@@ -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 Avatar from "./Avatar";
|
|
14
|
-
|
|
3
|
+
const meta = {
|
|
15
4
|
title: "Components/Avatar/Avatar",
|
|
16
5
|
component: Avatar,
|
|
17
6
|
tags: ["autodocs"],
|
|
@@ -19,29 +8,29 @@ var meta = {
|
|
|
19
8
|
layout: "fullscreen",
|
|
20
9
|
},
|
|
21
10
|
decorators: [
|
|
22
|
-
|
|
11
|
+
(Story) => (_jsx("div", { className: "p-5", children: _jsx(Story, {}) })),
|
|
23
12
|
],
|
|
24
13
|
};
|
|
25
14
|
export default meta;
|
|
26
|
-
export
|
|
15
|
+
export const Default = {
|
|
27
16
|
args: {
|
|
28
17
|
imageUrl: "",
|
|
29
18
|
text: "AN",
|
|
30
19
|
size: "lg",
|
|
31
20
|
rounded: "full",
|
|
32
21
|
},
|
|
33
|
-
render:
|
|
22
|
+
render: (args) => {
|
|
34
23
|
console.log("args ", args);
|
|
35
|
-
|
|
36
|
-
return (_jsx("div", { className: "flex flex-row justify-between", children: _jsx(Avatar,
|
|
24
|
+
const props = Object.assign({}, args);
|
|
25
|
+
return (_jsx("div", { className: "flex flex-row justify-between", children: _jsx(Avatar, Object.assign({}, props)) }));
|
|
37
26
|
},
|
|
38
27
|
};
|
|
39
|
-
export
|
|
28
|
+
export const Preview = {
|
|
40
29
|
args: {},
|
|
41
|
-
render:
|
|
30
|
+
render: (args) => {
|
|
42
31
|
console.log("args ", args);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return (_jsxs("div", { className: "flex flex-col gap-2 w-full bg-black p-20", children: [BORDER.map(
|
|
32
|
+
const props = Object.assign({}, args);
|
|
33
|
+
const BORDER = ["full", "normal", "none"];
|
|
34
|
+
return (_jsxs("div", { className: "flex flex-col gap-2 w-full bg-black p-20", children: [BORDER.map((rounded) => (_jsxs("div", { className: "flex flex-row items-center gap-3", children: [_jsx(Avatar, { size: "xxs", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "xs", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "sm", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "md", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "lg", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" })] }, rounded))), BORDER.map((rounded) => (_jsxs("div", { className: "flex flex-row items-center gap-3", children: [_jsx(Avatar, { size: "xxs", rounded: rounded, type: "text", text: "AS" }), _jsx(Avatar, { size: "xs", rounded: rounded, type: "text", text: "AS" }), _jsx(Avatar, { size: "sm", rounded: rounded, type: "text", text: "AS" }), _jsx(Avatar, { size: "md", rounded: rounded, type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: rounded, type: "text", text: "AS" })] }, rounded)))] }));
|
|
46
35
|
},
|
|
47
36
|
};
|
|
@@ -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)
|
|
@@ -25,19 +14,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
25
14
|
import * as React from "react";
|
|
26
15
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
27
16
|
import { cn } from "@/utils/cn";
|
|
28
|
-
|
|
29
|
-
var className = _a
|
|
30
|
-
return (_jsx(AvatarPrimitive.Root,
|
|
17
|
+
const AvatarBase = React.forwardRef((_a, ref) => {
|
|
18
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
19
|
+
return (_jsx(AvatarPrimitive.Root, Object.assign({ ref: ref, className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className) }, props)));
|
|
31
20
|
});
|
|
32
21
|
AvatarBase.displayName = AvatarPrimitive.Root.displayName;
|
|
33
|
-
|
|
34
|
-
var className = _a
|
|
35
|
-
return (_jsx(AvatarPrimitive.Image,
|
|
22
|
+
const AvatarImage = React.forwardRef((_a, ref) => {
|
|
23
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
24
|
+
return (_jsx(AvatarPrimitive.Image, Object.assign({ ref: ref, className: cn("aspect-square h-full w-full", className) }, props)));
|
|
36
25
|
});
|
|
37
26
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
38
|
-
|
|
39
|
-
var className = _a
|
|
40
|
-
return (_jsx(AvatarPrimitive.Fallback,
|
|
27
|
+
const AvatarFallback = React.forwardRef((_a, ref) => {
|
|
28
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
29
|
+
return (_jsx(AvatarPrimitive.Fallback, Object.assign({ ref: ref, className: cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className) }, props)));
|
|
41
30
|
});
|
|
42
31
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
43
32
|
export { AvatarBase, AvatarImage, AvatarFallback };
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Children, cloneElement } from "react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var remainingComp = remainingAvatar ||
|
|
4
|
+
const AvatarGroup = ({ borderWidth = 2, borderColor = "white", maxDisplay = 4, children, remainingText, remainingAvatar, }) => {
|
|
5
|
+
const avatars = Children.toArray(children);
|
|
6
|
+
const displayAvatars = avatars.slice(0, maxDisplay);
|
|
7
|
+
const remainingCount = Math.max(0, avatars.length - maxDisplay);
|
|
8
|
+
const remainingComp = remainingAvatar ||
|
|
10
9
|
cloneElement(displayAvatars[0], {
|
|
11
|
-
style: { borderWidth
|
|
10
|
+
style: { borderWidth, borderColor },
|
|
12
11
|
className: "relative z-0",
|
|
13
|
-
children: remainingText ||
|
|
12
|
+
children: remainingText || `+${remainingCount}`,
|
|
14
13
|
});
|
|
15
|
-
return (_jsxs("div", { className: "flex items-center -space-x-2", children: [displayAvatars.map(
|
|
14
|
+
return (_jsxs("div", { className: "flex items-center -space-x-2", children: [displayAvatars.map((avatar, index) => {
|
|
16
15
|
return (_jsx("div", { className: "relative", style: { zIndex: avatars.length - index }, children: cloneElement(avatar, {
|
|
17
|
-
style: { borderWidth
|
|
16
|
+
style: { borderWidth, borderColor },
|
|
18
17
|
}) }, index));
|
|
19
18
|
}), remainingCount > 0 && remainingComp] }));
|
|
20
19
|
};
|
|
@@ -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 AvatarGroup from "./AvatarGroup";
|
|
14
3
|
import Avatar from "./Avatar";
|
|
15
|
-
|
|
4
|
+
const meta = {
|
|
16
5
|
title: "Components/Avatar/AvatarGroup",
|
|
17
6
|
component: AvatarGroup,
|
|
18
7
|
tags: ["autodocs"],
|
|
@@ -20,28 +9,28 @@ var meta = {
|
|
|
20
9
|
layout: "fullscreen",
|
|
21
10
|
},
|
|
22
11
|
decorators: [
|
|
23
|
-
|
|
12
|
+
(Story) => (_jsx("div", { className: "p-5", children: _jsx(Story, {}) })),
|
|
24
13
|
],
|
|
25
14
|
};
|
|
26
15
|
export default meta;
|
|
27
|
-
export
|
|
16
|
+
export const Default = {
|
|
28
17
|
args: {
|
|
29
18
|
imageUrl: "",
|
|
30
19
|
text: "AN",
|
|
31
20
|
size: "lg",
|
|
32
21
|
rounded: "full",
|
|
33
22
|
},
|
|
34
|
-
render:
|
|
23
|
+
render: (args) => {
|
|
35
24
|
console.log("args ", args);
|
|
36
|
-
|
|
37
|
-
return (_jsx("div", { className: "flex flex-row justify-between", children: _jsxs(AvatarGroup,
|
|
25
|
+
const props = Object.assign({}, args);
|
|
26
|
+
return (_jsx("div", { className: "flex flex-row justify-between", children: _jsxs(AvatarGroup, Object.assign({}, props, { children: [_jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" })] })) }));
|
|
38
27
|
},
|
|
39
28
|
};
|
|
40
|
-
export
|
|
29
|
+
export const Preview = {
|
|
41
30
|
args: {},
|
|
42
|
-
render:
|
|
31
|
+
render: (args) => {
|
|
43
32
|
console.log("args ", args);
|
|
44
|
-
|
|
33
|
+
const props = Object.assign({}, args);
|
|
45
34
|
return (_jsx("div", { className: "flex flex-col gap-2 w-full bg-black p-20", children: _jsx("div", { className: "flex flex-row items-center gap-3", children: _jsxs(AvatarGroup, { children: [_jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" })] }) }) }));
|
|
46
35
|
},
|
|
47
36
|
};
|
|
@@ -1,14 +1,3 @@
|
|
|
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
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
2
|
var t = {};
|
|
14
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -25,9 +14,9 @@ import { forwardRef } from "react";
|
|
|
25
14
|
import { buttonVariants } from "./Button.styles";
|
|
26
15
|
import { cn } from "@/utils/cn";
|
|
27
16
|
import Loading from "../Loading/Loading";
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
return (_jsx("button",
|
|
17
|
+
const Button = forwardRef((_a, ref) => {
|
|
18
|
+
var { size = "md", color = "primary", variant = "solid", title, children, startIcon, endIcon, disabled = false, fullwidth = false, isLoading = false, className } = _a, props = __rest(_a, ["size", "color", "variant", "title", "children", "startIcon", "endIcon", "disabled", "fullwidth", "isLoading", "className"]);
|
|
19
|
+
const isDisabled = disabled || isLoading;
|
|
20
|
+
return (_jsx("button", Object.assign({ type: "button" }, props, { ref: ref, "aria-disabled": isDisabled || undefined, "data-loading": isLoading || undefined, tabIndex: isDisabled ? -1 : 0, className: cn(buttonVariants({ size, color, variant, disabled, fullwidth }), className), disabled: isDisabled, children: _jsxs(_Fragment, { children: [isLoading && _jsx(Loading, {}), startIcon, children || title, endIcon] }) })));
|
|
32
21
|
});
|
|
33
22
|
export default Button;
|