@rovula/ui 0.0.19 → 0.0.21
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 +3220 -1382
- 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 +4 -4
- package/dist/cjs/types/components/ActionButton/ActionButton.styles copy.d.ts +6 -0
- package/dist/cjs/types/components/Button/Button.styles copy.d.ts +7 -0
- package/dist/cjs/types/components/Button/Button.styles.d.ts +1 -0
- package/dist/cjs/types/components/Button/Buttons.stories.d.ts +12 -4
- package/dist/cjs/types/components/Calendar/Calendar.d.ts +0 -1
- package/dist/cjs/types/components/Calendar/Calendar.stories.d.ts +7 -7
- package/dist/cjs/types/components/Checkbox/Checkbox.stories.d.ts +6 -6
- package/dist/cjs/types/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/cjs/types/components/DatePicker/DatePicker.stories.d.ts +2 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +8 -6
- package/dist/cjs/types/components/Input/Input.stories.d.ts +12 -12
- package/dist/cjs/types/components/Label/Label.stories.d.ts +6 -6
- package/dist/cjs/types/components/Loading/Loading.d.ts +14 -0
- package/dist/cjs/types/components/Loading/Loading.stories.d.ts +35 -0
- package/dist/cjs/types/components/ProgressBar/ProgressBar.d.ts +13 -0
- package/dist/cjs/types/components/ProgressBar/ProgressBar.stories.d.ts +37 -0
- package/dist/cjs/types/components/RadioGroup/RadioGroup.stories.d.ts +5 -5
- package/dist/cjs/types/components/Search/Search.d.ts +22 -1
- package/dist/cjs/types/components/Search/Search.stories.d.ts +338 -7
- package/dist/cjs/types/components/Table/Table.stories.d.ts +4 -4
- package/dist/cjs/types/components/Text/Text.d.ts +1 -1
- package/dist/cjs/types/components/Text/Text.stories.d.ts +1 -1
- package/dist/cjs/types/components/TextInput/TextInput.d.ts +4 -0
- package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +11 -6
- package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +8 -0
- package/dist/cjs/types/index.d.ts +3 -0
- package/dist/cjs/types/stories/ColorGroupPreview.d.ts +1 -0
- package/dist/cjs/types/stories/ColorPreview.d.ts +5 -0
- package/dist/components/ActionButton/ActionButton.js +1 -1
- package/dist/components/ActionButton/ActionButton.stories.js +1 -1
- package/dist/components/ActionButton/ActionButton.styles copy.js +90 -0
- package/dist/components/ActionButton/ActionButton.styles.js +54 -15
- package/dist/components/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/Avatar/Avatar.styles.js +1 -1
- package/dist/components/Button/Button.js +3 -2
- package/dist/components/Button/Button.styles copy.js +210 -0
- package/dist/components/Button/Button.styles.js +203 -43
- package/dist/components/Button/Buttons.stories.js +9 -1
- package/dist/components/Calendar/Calendar.js +39 -2
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Collapsible/Collapsible.styles.js +6 -3
- package/dist/components/DatePicker/DatePicker.js +13 -2
- package/dist/components/Dialog/Dialog.js +4 -4
- package/dist/components/Dropdown/Dropdown.js +9 -7
- package/dist/components/Dropdown/Dropdown.styles.js +1 -1
- package/dist/components/Input/Input.js +8 -1
- package/dist/components/Input/Input.stories.js +3 -2
- package/dist/components/Input/Input.styles.js +13 -5
- package/dist/components/Loading/Loading.js +23 -0
- package/dist/components/Loading/Loading.stories.js +37 -0
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +22 -0
- package/dist/components/ProgressBar/ProgressBar.stories.js +52 -0
- package/dist/components/RadioGroup/RadioGroup.js +2 -2
- package/dist/components/Search/Search.js +6 -7
- package/dist/components/Search/Search.stories.js +8 -5
- package/dist/components/Text/Text.js +17 -2
- package/dist/components/Text/Text.stories.js +5 -1
- package/dist/components/TextInput/TextInput.js +14 -5
- package/dist/components/TextInput/TextInput.stories.js +3 -2
- package/dist/components/TextInput/TextInput.styles.js +120 -18
- package/dist/esm/bundle.css +3220 -1382
- 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 +4 -4
- package/dist/esm/types/components/ActionButton/ActionButton.styles copy.d.ts +6 -0
- package/dist/esm/types/components/Button/Button.styles copy.d.ts +7 -0
- package/dist/esm/types/components/Button/Button.styles.d.ts +1 -0
- package/dist/esm/types/components/Button/Buttons.stories.d.ts +12 -4
- package/dist/esm/types/components/Calendar/Calendar.d.ts +0 -1
- package/dist/esm/types/components/Calendar/Calendar.stories.d.ts +7 -7
- package/dist/esm/types/components/Checkbox/Checkbox.stories.d.ts +6 -6
- package/dist/esm/types/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/esm/types/components/DatePicker/DatePicker.stories.d.ts +2 -0
- package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +8 -6
- package/dist/esm/types/components/Input/Input.stories.d.ts +12 -12
- package/dist/esm/types/components/Label/Label.stories.d.ts +6 -6
- package/dist/esm/types/components/Loading/Loading.d.ts +14 -0
- package/dist/esm/types/components/Loading/Loading.stories.d.ts +35 -0
- package/dist/esm/types/components/ProgressBar/ProgressBar.d.ts +13 -0
- package/dist/esm/types/components/ProgressBar/ProgressBar.stories.d.ts +37 -0
- package/dist/esm/types/components/RadioGroup/RadioGroup.stories.d.ts +5 -5
- package/dist/esm/types/components/Search/Search.d.ts +22 -1
- package/dist/esm/types/components/Search/Search.stories.d.ts +338 -7
- package/dist/esm/types/components/Table/Table.stories.d.ts +4 -4
- package/dist/esm/types/components/Text/Text.d.ts +1 -1
- package/dist/esm/types/components/Text/Text.stories.d.ts +1 -1
- package/dist/esm/types/components/TextInput/TextInput.d.ts +4 -0
- package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +11 -6
- package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +8 -0
- package/dist/esm/types/index.d.ts +3 -0
- package/dist/esm/types/stories/ColorGroupPreview.d.ts +1 -0
- package/dist/esm/types/stories/ColorPreview.d.ts +5 -0
- package/dist/index.d.ts +53 -2
- package/dist/index.js +3 -0
- package/dist/src/theme/global.css +5078 -918
- package/dist/stories/ColorGroupPreview.js +478 -0
- package/dist/stories/ColorPreview.js +8 -0
- package/dist/theme/global.css +7 -227
- package/dist/theme/main-preset.js +131 -67
- package/dist/theme/plugins/utilities/typography.js +12 -0
- package/dist/theme/presets/colors.js +101 -220
- package/dist/theme/theme.d.ts +69 -0
- package/dist/theme/themes/xspector/baseline.css +7 -0
- package/dist/theme/themes/xspector/color.css +67 -0
- package/dist/theme/themes/xspector/components/action-button.css +98 -0
- package/dist/theme/themes/xspector/components/loading.css +11 -0
- package/dist/theme/themes/xspector/palette.css +122 -0
- package/dist/theme/themes/xspector/state.css +89 -0
- package/dist/theme/themes/xspector/transparent.css +68 -0
- package/dist/theme/themes/xspector/typography.css +27 -0
- package/dist/theme/tokens/baseline.css +10 -0
- package/dist/theme/tokens/color.css +63 -0
- package/dist/theme/tokens/components/action-button.css +127 -0
- package/dist/theme/tokens/components/button.css +512 -0
- package/dist/theme/tokens/components/loading.css +11 -0
- package/dist/theme/tokens/components/navbar.css +8 -0
- package/dist/theme/tokens/components/progress-bar.css +8 -0
- package/dist/theme/tokens/palette.css +122 -0
- package/dist/theme/tokens/state.css +82 -0
- package/dist/theme/tokens/transparent.css +68 -0
- package/dist/theme/tokens/typography.css +178 -0
- package/dist/theme/tokens/variables.css +28 -0
- package/dist/theme/utils.js +98 -0
- package/package.json +1 -1
- package/src/_theme/global copy.css +761 -0
- package/src/_theme/global.css +39 -0
- package/src/_theme/main-preset.js +239 -0
- package/src/_theme/plugins/utilities/typography.js +81 -0
- package/src/_theme/presets/colors copy 2.js +319 -0
- package/src/_theme/presets/colors copy.js +229 -0
- package/src/_theme/presets/colors.js +94 -0
- package/src/_theme/theme.d.ts +69 -0
- package/src/_theme/variables/base/button.css +334 -0
- package/src/_theme/variables/base/components copy.css +19 -0
- package/src/_theme/variables/default/colors.css +292 -0
- package/src/_theme/variables/default/typography.css +178 -0
- package/src/_theme/variables/xspector/colors.css +468 -0
- package/src/_theme/variables/xspector/typography.css +178 -0
- package/src/components/ActionButton/ActionButton.stories.tsx +1 -1
- package/src/components/ActionButton/ActionButton.styles copy.ts +95 -0
- package/src/components/ActionButton/ActionButton.styles.ts +54 -19
- package/src/components/ActionButton/ActionButton.tsx +1 -1
- package/src/components/AlertDialog/AlertDialog.tsx +2 -2
- package/src/components/Avatar/Avatar.styles.ts +1 -1
- package/src/components/Button/Button.styles copy.ts +214 -0
- package/src/components/Button/Button.styles.ts +203 -47
- package/src/components/Button/Button.tsx +4 -0
- package/src/components/Button/Buttons.stories.tsx +9 -1
- package/src/components/Calendar/Calendar.tsx +49 -7
- package/src/components/Checkbox/Checkbox.tsx +1 -1
- package/src/components/Collapsible/Collapsible.styles.ts +6 -3
- package/src/components/DatePicker/DatePicker.tsx +8 -2
- package/src/components/Dialog/Dialog.tsx +5 -5
- package/src/components/Dropdown/Dropdown.styles.ts +1 -1
- package/src/components/Dropdown/Dropdown.tsx +14 -12
- package/src/components/Input/Input.stories.tsx +3 -2
- package/src/components/Input/Input.styles.tsx +13 -6
- package/src/components/Input/Input.tsx +8 -1
- package/src/components/Loading/Loading.stories.tsx +43 -0
- package/src/components/Loading/Loading.tsx +72 -0
- package/src/components/Popover/Popover.tsx +1 -1
- package/src/components/ProgressBar/ProgressBar.stories.tsx +78 -0
- package/src/components/ProgressBar/ProgressBar.tsx +62 -0
- package/src/components/RadioGroup/RadioGroup.tsx +2 -2
- package/src/components/Search/Search.stories.tsx +13 -13
- package/src/components/Search/Search.tsx +14 -19
- package/src/components/Text/Text.stories.tsx +6 -4
- package/src/components/Text/Text.tsx +27 -3
- package/src/components/TextInput/TextInput.stories.tsx +3 -2
- package/src/components/TextInput/TextInput.styles.ts +124 -19
- package/src/components/TextInput/TextInput.tsx +34 -4
- package/src/index.ts +3 -0
- package/src/stories/ColorGroupPreview.tsx +494 -0
- package/src/stories/ColorPreview.tsx +45 -0
- package/src/stories/Colors.mdx +14 -0
- package/src/stories/Typography.mdx +7 -151
- package/src/theme/global.css +7 -227
- package/src/theme/main-preset.js +131 -67
- package/src/theme/plugins/utilities/typography.js +12 -0
- package/src/theme/presets/colors.js +101 -220
- package/src/theme/theme.d.ts +69 -0
- package/src/theme/themes/xspector/baseline.css +7 -0
- package/src/theme/themes/xspector/color.css +67 -0
- package/src/theme/themes/xspector/components/action-button.css +98 -0
- package/src/theme/themes/xspector/components/loading.css +11 -0
- package/src/theme/themes/xspector/palette.css +122 -0
- package/src/theme/themes/xspector/state.css +89 -0
- package/src/theme/themes/xspector/transparent.css +68 -0
- package/src/theme/themes/xspector/typography.css +27 -0
- package/src/theme/tokens/baseline.css +10 -0
- package/src/theme/tokens/color.css +63 -0
- package/src/theme/tokens/components/action-button.css +127 -0
- package/src/theme/tokens/components/button.css +512 -0
- package/src/theme/tokens/components/loading.css +11 -0
- package/src/theme/tokens/components/navbar.css +8 -0
- package/src/theme/tokens/components/progress-bar.css +8 -0
- package/src/theme/tokens/palette.css +122 -0
- package/src/theme/tokens/state.css +82 -0
- package/src/theme/tokens/transparent.css +68 -0
- package/src/theme/tokens/typography.css +178 -0
- package/src/theme/tokens/variables.css +28 -0
- package/src/theme/utils.js +98 -0
|
@@ -55,7 +55,7 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
|
|
|
55
55
|
(
|
|
56
56
|
{
|
|
57
57
|
id,
|
|
58
|
-
options,
|
|
58
|
+
options = [],
|
|
59
59
|
value,
|
|
60
60
|
label,
|
|
61
61
|
size = "md",
|
|
@@ -115,7 +115,7 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
|
|
|
115
115
|
}, [options, filterMode, textValue]);
|
|
116
116
|
|
|
117
117
|
const renderOptions = () => (
|
|
118
|
-
<ul className="absolute mt-1 w-full bg-
|
|
118
|
+
<ul className="absolute mt-1 w-full bg-base-popup border border-base-popup text-base-popup-foreground rounded-md shadow-md z-10 max-h-60 overflow-y-auto">
|
|
119
119
|
{optionsFiltered.map((option) => {
|
|
120
120
|
if (option.renderLabel) {
|
|
121
121
|
return (
|
|
@@ -135,8 +135,10 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
|
|
|
135
135
|
<li
|
|
136
136
|
key={option.value}
|
|
137
137
|
onMouseDown={() => handleOptionClick(option)}
|
|
138
|
-
className={`px-4 py-2 hover:bg-
|
|
139
|
-
selectedOption?.value === option.value
|
|
138
|
+
className={`px-4 py-2 hover:bg-primary-hover-bg cursor-pointer ${
|
|
139
|
+
selectedOption?.value === option.value
|
|
140
|
+
? "bg-base-popup-highligh"
|
|
141
|
+
: ""
|
|
140
142
|
}`}
|
|
141
143
|
>
|
|
142
144
|
{option.label}
|
|
@@ -208,6 +210,14 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
|
|
|
208
210
|
return (
|
|
209
211
|
<div className={`relative ${fullwidth ? "w-full" : ""}`}>
|
|
210
212
|
<TextInput
|
|
213
|
+
hasClearIcon={false}
|
|
214
|
+
endIcon={
|
|
215
|
+
<div className={iconWrapperVariant({ size })}>
|
|
216
|
+
<ChevronDownIcon
|
|
217
|
+
className={dropdownIconVariant({ size, isFocus: isFocused })}
|
|
218
|
+
/>
|
|
219
|
+
</div>
|
|
220
|
+
}
|
|
211
221
|
{...props}
|
|
212
222
|
ref={ref}
|
|
213
223
|
readOnly={!filterMode}
|
|
@@ -225,19 +235,11 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
|
|
|
225
235
|
required={required}
|
|
226
236
|
id={_id}
|
|
227
237
|
disabled={disabled}
|
|
228
|
-
hasClearIcon={false}
|
|
229
238
|
size={size}
|
|
230
239
|
className={customInputVariant({ size })}
|
|
231
240
|
onFocus={handleOnFocus}
|
|
232
241
|
onBlur={handleOnBlur}
|
|
233
242
|
onKeyDown={handleOnKeyDown}
|
|
234
|
-
endIcon={
|
|
235
|
-
<div className={iconWrapperVariant({ size })}>
|
|
236
|
-
<ChevronDownIcon
|
|
237
|
-
className={dropdownIconVariant({ size, isFocus: isFocused })}
|
|
238
|
-
/>
|
|
239
|
-
</div>
|
|
240
|
-
}
|
|
241
243
|
/>
|
|
242
244
|
{isFocused && renderOptions()}
|
|
243
245
|
</div>
|
|
@@ -11,7 +11,7 @@ const meta = {
|
|
|
11
11
|
},
|
|
12
12
|
decorators: [
|
|
13
13
|
(Story) => (
|
|
14
|
-
<div className="p-5 flex w-full">
|
|
14
|
+
<div className="p-5 flex w-full ">
|
|
15
15
|
<Story />
|
|
16
16
|
</div>
|
|
17
17
|
),
|
|
@@ -24,7 +24,8 @@ type Story = StoryObj<typeof meta>;
|
|
|
24
24
|
|
|
25
25
|
export const Default = {
|
|
26
26
|
args: {
|
|
27
|
-
//
|
|
27
|
+
// disabled: true,
|
|
28
|
+
// value: "Aaaaa",
|
|
28
29
|
},
|
|
29
30
|
render: (args) => {
|
|
30
31
|
console.log("args ", args);
|
|
@@ -4,7 +4,7 @@ export const inputVariants = cva(
|
|
|
4
4
|
[
|
|
5
5
|
"border-0 outline-none",
|
|
6
6
|
"p-1 flex w-auto h-fit box-border",
|
|
7
|
-
"peer text-
|
|
7
|
+
"peer text-input-filled-text placeholder:text-input-default-text bg-transparent caret-primary",
|
|
8
8
|
],
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
@@ -20,10 +20,13 @@ export const inputVariants = cva(
|
|
|
20
20
|
},
|
|
21
21
|
variant: {
|
|
22
22
|
flat: "",
|
|
23
|
-
outline:
|
|
24
|
-
"ring-1 ring-inset ring-input-
|
|
23
|
+
outline: [
|
|
24
|
+
"ring-1 ring-inset ring-input-default-stroke",
|
|
25
|
+
"hover:ring-input-active-stroke hover:text-input-filled-text",
|
|
26
|
+
"focus:ring-1 focus:ring-inset focus:ring-input-active-stroke focus:text-input-filled-text active:text-input-filled-text",
|
|
27
|
+
],
|
|
25
28
|
underline:
|
|
26
|
-
"border-b-2 border-input-stroke transition-colors hover:border-input-stroke
|
|
29
|
+
"border-b-2 border-input-default-stroke transition-colors hover:border-input-active-stroke focus:border-input-default-stroke",
|
|
27
30
|
},
|
|
28
31
|
hiddenPlaceholder: {
|
|
29
32
|
true: "placeholder:text-transparent",
|
|
@@ -32,10 +35,14 @@ export const inputVariants = cva(
|
|
|
32
35
|
true: "w-full",
|
|
33
36
|
},
|
|
34
37
|
disabled: {
|
|
35
|
-
true:
|
|
38
|
+
true: [
|
|
39
|
+
"text-input-disable-text ring-input-disable-stroke bg-input-disable-bg placeholder:text-input-disable-text",
|
|
40
|
+
"hover:text-input-disable-text hover:ring-input-disable-stroke hover:bg-input-disable-bg hover:placeholder:text-input-disable-text",
|
|
41
|
+
"active:text-input-disable-text active:ring-input-disable-stroke active:bg-input-disable-bg active:placeholder:text-input-disable-text",
|
|
42
|
+
],
|
|
36
43
|
},
|
|
37
44
|
error: {
|
|
38
|
-
true: "ring-error focus:ring-error",
|
|
45
|
+
true: "ring-input-error focus:ring-input-error",
|
|
39
46
|
},
|
|
40
47
|
},
|
|
41
48
|
defaultVariants: {
|
|
@@ -34,7 +34,14 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
|
34
34
|
<input
|
|
35
35
|
type={type}
|
|
36
36
|
className={cn(
|
|
37
|
-
inputVariants({
|
|
37
|
+
inputVariants({
|
|
38
|
+
size,
|
|
39
|
+
variant,
|
|
40
|
+
fullwidth,
|
|
41
|
+
error,
|
|
42
|
+
hiddenPlaceholder,
|
|
43
|
+
disabled,
|
|
44
|
+
}),
|
|
38
45
|
className
|
|
39
46
|
)}
|
|
40
47
|
ref={ref}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import Loading from "./Loading";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/Loading",
|
|
8
|
+
component: Loading,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "fullscreen",
|
|
12
|
+
},
|
|
13
|
+
decorators: [
|
|
14
|
+
(Story) => (
|
|
15
|
+
<div className="p-5 flex w-full">
|
|
16
|
+
<Story />
|
|
17
|
+
</div>
|
|
18
|
+
),
|
|
19
|
+
],
|
|
20
|
+
} satisfies Meta<typeof Loading>;
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
|
|
24
|
+
export const Default = {
|
|
25
|
+
args: {
|
|
26
|
+
// Loading: "Lorem Ipsum",
|
|
27
|
+
// value: "Lorem Ipsum",
|
|
28
|
+
// fullwidth: true,
|
|
29
|
+
},
|
|
30
|
+
render: (args) => {
|
|
31
|
+
console.log("args ", args);
|
|
32
|
+
const props: typeof args = {
|
|
33
|
+
...args,
|
|
34
|
+
};
|
|
35
|
+
return (
|
|
36
|
+
<div className="flex flex-row gap-4 w-full">
|
|
37
|
+
<div className="flex items-center space-x-2">
|
|
38
|
+
<Loading {...props} />
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
} satisfies StoryObj;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { cn } from "@/utils/cn";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
type LoadingProps = {
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
trackColor?: string;
|
|
8
|
+
strokeWidth?: number;
|
|
9
|
+
percentage?: number;
|
|
10
|
+
animate?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
progressClassName?: string;
|
|
13
|
+
trackClassName?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const Loading: React.FC<LoadingProps> = ({
|
|
17
|
+
size = 16,
|
|
18
|
+
color = "",
|
|
19
|
+
trackColor = "",
|
|
20
|
+
strokeWidth = 2,
|
|
21
|
+
percentage = 75,
|
|
22
|
+
animate = true,
|
|
23
|
+
className,
|
|
24
|
+
progressClassName,
|
|
25
|
+
trackClassName,
|
|
26
|
+
}) => {
|
|
27
|
+
const radius = (size - strokeWidth * 2) / 2;
|
|
28
|
+
const circumference = 2 * Math.PI * radius;
|
|
29
|
+
const offset = circumference - (percentage / 100) * circumference;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<svg
|
|
33
|
+
className={cn(
|
|
34
|
+
{
|
|
35
|
+
"animate-spin": animate,
|
|
36
|
+
},
|
|
37
|
+
className
|
|
38
|
+
)}
|
|
39
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
40
|
+
fill="none"
|
|
41
|
+
viewBox={`0 0 ${size} ${size}`}
|
|
42
|
+
width={size}
|
|
43
|
+
height={size}
|
|
44
|
+
role="status"
|
|
45
|
+
aria-live="polite"
|
|
46
|
+
>
|
|
47
|
+
<circle
|
|
48
|
+
className={cn("text-[var(--loading-track-color)]", trackClassName)}
|
|
49
|
+
style={{ ...(trackColor ? { color: trackColor } : {}) }}
|
|
50
|
+
cx={size / 2}
|
|
51
|
+
cy={size / 2}
|
|
52
|
+
r={radius}
|
|
53
|
+
stroke="currentColor"
|
|
54
|
+
strokeWidth={strokeWidth}
|
|
55
|
+
/>
|
|
56
|
+
<circle
|
|
57
|
+
className={cn("text-[var(--loading-process-color)]", progressClassName)}
|
|
58
|
+
style={{ ...(color ? { color: color } : {}) }}
|
|
59
|
+
cx={size / 2}
|
|
60
|
+
cy={size / 2}
|
|
61
|
+
r={radius}
|
|
62
|
+
stroke="currentColor"
|
|
63
|
+
strokeWidth={strokeWidth}
|
|
64
|
+
strokeDasharray={circumference}
|
|
65
|
+
strokeDashoffset={offset}
|
|
66
|
+
strokeLinecap="round"
|
|
67
|
+
/>
|
|
68
|
+
</svg>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default Loading;
|
|
@@ -19,7 +19,7 @@ const PopoverContent = React.forwardRef<
|
|
|
19
19
|
align={align}
|
|
20
20
|
sideOffset={sideOffset}
|
|
21
21
|
className={cn(
|
|
22
|
-
"z-50 min-w-72 rounded-md border bg-popup-
|
|
22
|
+
"z-50 min-w-72 rounded-md border bg-base-popup-highlight border-none overflow-hidden p-0 text-popover-foreground shadow-md outline-none 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
23
23
|
className
|
|
24
24
|
)}
|
|
25
25
|
{...props}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import ProgressBar from "./ProgressBar";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/ProgressBar",
|
|
8
|
+
component: ProgressBar,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "fullscreen",
|
|
12
|
+
},
|
|
13
|
+
decorators: [
|
|
14
|
+
(Story) => (
|
|
15
|
+
<div className="p-5 flex w-full">
|
|
16
|
+
<Story />
|
|
17
|
+
</div>
|
|
18
|
+
),
|
|
19
|
+
],
|
|
20
|
+
} satisfies Meta<typeof ProgressBar>;
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
|
|
24
|
+
export const Default = {
|
|
25
|
+
args: {},
|
|
26
|
+
render: (args) => {
|
|
27
|
+
const props: typeof args = {
|
|
28
|
+
...args,
|
|
29
|
+
};
|
|
30
|
+
return (
|
|
31
|
+
<div className="p-4 space-y-4 w-full">
|
|
32
|
+
<ProgressBar {...props} />
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
},
|
|
36
|
+
} satisfies StoryObj;
|
|
37
|
+
|
|
38
|
+
export const Preview = {
|
|
39
|
+
args: {},
|
|
40
|
+
render: (args) => {
|
|
41
|
+
console.log("args ", args);
|
|
42
|
+
const [progress, setProgress] = useState(0);
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
const timer = setInterval(() => {
|
|
46
|
+
setProgress((prevProgress) =>
|
|
47
|
+
prevProgress >= 100 ? 0 : prevProgress + 10
|
|
48
|
+
);
|
|
49
|
+
}, 1000);
|
|
50
|
+
|
|
51
|
+
return () => {
|
|
52
|
+
clearInterval(timer);
|
|
53
|
+
};
|
|
54
|
+
}, []);
|
|
55
|
+
|
|
56
|
+
const props: typeof args = {
|
|
57
|
+
...args,
|
|
58
|
+
};
|
|
59
|
+
return (
|
|
60
|
+
<div className="p-4 space-y-4 w-full">
|
|
61
|
+
{/* Single color progress bar */}
|
|
62
|
+
<ProgressBar
|
|
63
|
+
progress={progress}
|
|
64
|
+
color="#3b82f6"
|
|
65
|
+
animationDuration={0.7}
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
{/* Gradient progress bar */}
|
|
69
|
+
<ProgressBar
|
|
70
|
+
progress={progress}
|
|
71
|
+
gradientStart="#8a8a8a"
|
|
72
|
+
gradientEnd="#c0c0c0"
|
|
73
|
+
animationDuration={0.7}
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
},
|
|
78
|
+
} satisfies StoryObj;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { cn } from "@/utils/cn";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
|
|
4
|
+
type ProgressBarProps = {
|
|
5
|
+
progress?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
gradientStart?: string;
|
|
8
|
+
gradientEnd?: string;
|
|
9
|
+
animationDuration?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
trackClassName?: string;
|
|
12
|
+
progressClassName?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const ProgressBar: React.FC<ProgressBarProps> = ({
|
|
16
|
+
progress = 0,
|
|
17
|
+
color,
|
|
18
|
+
gradientStart,
|
|
19
|
+
gradientEnd,
|
|
20
|
+
animationDuration = 0.5,
|
|
21
|
+
height = 8,
|
|
22
|
+
trackClassName,
|
|
23
|
+
progressClassName,
|
|
24
|
+
}) => {
|
|
25
|
+
const [width, setWidth] = useState<number>(0);
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
setWidth(progress);
|
|
29
|
+
}, [progress]);
|
|
30
|
+
|
|
31
|
+
const getBackgroundStyle = (): string | undefined => {
|
|
32
|
+
if (gradientStart && gradientEnd) {
|
|
33
|
+
return `linear-gradient(to right, ${gradientStart}, ${gradientEnd})`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return color;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div
|
|
41
|
+
className={cn(
|
|
42
|
+
"w-full bg-grey2-transparent-16 rounded-full overflow-hidden",
|
|
43
|
+
trackClassName
|
|
44
|
+
)}
|
|
45
|
+
style={{ height: `${height}px` }}
|
|
46
|
+
>
|
|
47
|
+
<div
|
|
48
|
+
className={cn(
|
|
49
|
+
"h-full rounded-full transition-all ease-out bg-primary",
|
|
50
|
+
progressClassName
|
|
51
|
+
)}
|
|
52
|
+
style={{
|
|
53
|
+
width: `${width}%`,
|
|
54
|
+
background: getBackgroundStyle(),
|
|
55
|
+
transition: `width ${animationDuration}s ease-out`,
|
|
56
|
+
}}
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default ProgressBar;
|
|
@@ -27,11 +27,11 @@ const RadioGroupItem = React.forwardRef<
|
|
|
27
27
|
<RadioGroupPrimitive.Item
|
|
28
28
|
ref={ref}
|
|
29
29
|
className={cn(
|
|
30
|
-
"aspect-square h-4 w-4 rounded-full border text-primary disabled:fill-
|
|
30
|
+
"aspect-square h-4 w-4 rounded-full border text-primary disabled:fill-state-disable-solid ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:state-disable-solid",
|
|
31
31
|
{
|
|
32
32
|
"border-primary-30 data-[state=checked]:border-primary":
|
|
33
33
|
!props.disabled,
|
|
34
|
-
"border-
|
|
34
|
+
"border-state-disable-solid data-disabled:border-state-disable-solid text-state-disable-solid fill-state-disable-solid":
|
|
35
35
|
props.disabled,
|
|
36
36
|
},
|
|
37
37
|
className
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
3
|
import { Search } from "./Search";
|
|
4
|
-
import {
|
|
4
|
+
import { Options } from "../Dropdown/Dropdown";
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
7
|
title: "Components/Search",
|
|
@@ -21,24 +21,24 @@ const meta = {
|
|
|
21
21
|
|
|
22
22
|
export default meta;
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const options: Options[] = new Array(100).fill("").map((__, index) => ({
|
|
25
|
+
value: `option${index + 1}`,
|
|
26
|
+
label: `Option ${index + 1}`,
|
|
27
|
+
}));
|
|
25
28
|
|
|
26
29
|
export const Default = {
|
|
27
30
|
args: {
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
label: "Choose an option:",
|
|
32
|
+
fullwidth: true,
|
|
33
|
+
options,
|
|
30
34
|
},
|
|
31
35
|
render: (args) => {
|
|
32
|
-
console.log("args ", args);
|
|
33
|
-
const props: typeof args = {
|
|
34
|
-
...args,
|
|
35
|
-
};
|
|
36
36
|
return (
|
|
37
|
-
<div className="flex flex-row gap-4">
|
|
38
|
-
<Search id="1" size="lg"
|
|
39
|
-
<Search id="2" size="md"
|
|
40
|
-
<Search id="3" size="sm"
|
|
37
|
+
<div className="flex flex-row gap-4 w-full">
|
|
38
|
+
<Search id="1" size="lg" options={options} {...args} />
|
|
39
|
+
<Search id="2" size="md" options={options} {...args} />
|
|
40
|
+
<Search id="3" size="sm" options={options} {...args} />
|
|
41
41
|
</div>
|
|
42
42
|
);
|
|
43
43
|
},
|
|
44
|
-
} satisfies
|
|
44
|
+
} satisfies StoryObj;
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { Label } from "../Label/Label";
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import Dropdown, { DropdownProps } from "../Dropdown/Dropdown";
|
|
4
3
|
|
|
5
|
-
type SearchProps =
|
|
4
|
+
export type SearchProps = DropdownProps;
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
const Search = forwardRef<HTMLInputElement, SearchProps>((props, ref) => {
|
|
8
7
|
return (
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
>
|
|
19
|
-
Search
|
|
20
|
-
</Label>
|
|
21
|
-
</div>
|
|
8
|
+
<Dropdown
|
|
9
|
+
{...props}
|
|
10
|
+
ref={ref}
|
|
11
|
+
hasClearIcon
|
|
12
|
+
hasSearchIcon
|
|
13
|
+
label="Search"
|
|
14
|
+
endIcon={null}
|
|
15
|
+
filterMode
|
|
16
|
+
/>
|
|
22
17
|
);
|
|
23
|
-
}
|
|
18
|
+
});
|
|
24
19
|
|
|
25
20
|
export { Search };
|
|
@@ -43,8 +43,12 @@ const variant: any = [
|
|
|
43
43
|
"small1",
|
|
44
44
|
"small2",
|
|
45
45
|
"small3",
|
|
46
|
+
"small4",
|
|
47
|
+
"small5",
|
|
46
48
|
"label1",
|
|
47
49
|
"label2",
|
|
50
|
+
"buttonL",
|
|
51
|
+
"buttonMS",
|
|
48
52
|
];
|
|
49
53
|
|
|
50
54
|
const color = [
|
|
@@ -68,12 +72,10 @@ export const Default = {
|
|
|
68
72
|
{variant.map((value: any) => (
|
|
69
73
|
<div key={value} className="flex flex-row ">
|
|
70
74
|
<div className="w-[200px]">
|
|
71
|
-
<Text variant={value}
|
|
72
|
-
{value}
|
|
73
|
-
</Text>
|
|
75
|
+
<Text variant={value}>{value}</Text>
|
|
74
76
|
</div>
|
|
75
77
|
<div className="w-full">
|
|
76
|
-
<Text variant={value}
|
|
78
|
+
<Text variant={value}>
|
|
77
79
|
Lorem ipsum dolor sit amet, adipiscing elit.
|
|
78
80
|
</Text>
|
|
79
81
|
</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cn } from "@/utils/cn";
|
|
2
2
|
import React, { FC, forwardRef } from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
3
4
|
|
|
4
5
|
export type TextProps = {
|
|
5
6
|
variant?:
|
|
@@ -22,8 +23,12 @@ export type TextProps = {
|
|
|
22
23
|
| "small1"
|
|
23
24
|
| "small2"
|
|
24
25
|
| "small3"
|
|
26
|
+
| "small4"
|
|
27
|
+
| "small5"
|
|
25
28
|
| "label1"
|
|
26
|
-
| "label2"
|
|
29
|
+
| "label2"
|
|
30
|
+
| "buttonL"
|
|
31
|
+
| "buttonMS";
|
|
27
32
|
color?:
|
|
28
33
|
| "primary"
|
|
29
34
|
| "secondary"
|
|
@@ -39,18 +44,37 @@ export type TextProps = {
|
|
|
39
44
|
id?: string;
|
|
40
45
|
};
|
|
41
46
|
|
|
47
|
+
const textVariants = cva(["text-foreground"], {
|
|
48
|
+
variants: {
|
|
49
|
+
color: {
|
|
50
|
+
primary: "text-primary",
|
|
51
|
+
secondary: "text-secondary",
|
|
52
|
+
success: "text-success",
|
|
53
|
+
tertiary: "text-tertiary",
|
|
54
|
+
info: "text-info",
|
|
55
|
+
warning: "text-warning",
|
|
56
|
+
error: "text-error",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// TODO font, fontBold, elipt
|
|
42
62
|
const Text = forwardRef<TextProps["tag"], TextProps>(
|
|
43
63
|
({
|
|
44
64
|
variant = "body1",
|
|
45
65
|
tag: Tag = "p",
|
|
46
66
|
children,
|
|
47
|
-
className,
|
|
67
|
+
className = "",
|
|
48
68
|
color,
|
|
49
69
|
style,
|
|
50
70
|
}) => {
|
|
51
71
|
return (
|
|
52
72
|
<Tag
|
|
53
|
-
className={cn(
|
|
73
|
+
className={cn(
|
|
74
|
+
`typography-${variant}`,
|
|
75
|
+
textVariants({ color }),
|
|
76
|
+
className
|
|
77
|
+
)}
|
|
54
78
|
style={style}
|
|
55
79
|
>
|
|
56
80
|
{children}
|
|
@@ -14,7 +14,7 @@ const meta = {
|
|
|
14
14
|
},
|
|
15
15
|
decorators: [
|
|
16
16
|
(Story) => (
|
|
17
|
-
<div className="p-5 flex w-full bg-[rgb(var(--
|
|
17
|
+
<div className="p-5 flex w-full bg-[rgb(var(--base-bg-2))] ">
|
|
18
18
|
<Story />
|
|
19
19
|
</div>
|
|
20
20
|
),
|
|
@@ -92,7 +92,8 @@ export const CustomLabel = {
|
|
|
92
92
|
export const FuctionInput = {
|
|
93
93
|
args: {
|
|
94
94
|
label: "Placeholder Text",
|
|
95
|
-
|
|
95
|
+
value: "dsdsds",
|
|
96
|
+
disabled: true,
|
|
96
97
|
},
|
|
97
98
|
render: (args) => {
|
|
98
99
|
console.log("args ", args);
|