@agility/plenum-ui 2.0.0-rc5 → 2.0.0-rc51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -31
- package/build.js +30 -25
- package/dist/index.d.ts +219 -96
- package/dist/index.js +1 -6103
- package/dist/index.js.map +4 -4
- package/dist/{lib/tailwind.css → tailwind.css} +3732 -8116
- package/dist/types/stories/atoms/buttons/Button/Alternative/Alternative.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Button/Button.d.ts +3 -7
- package/dist/types/stories/atoms/buttons/Button/Danger/Danger.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Button/Primary/Primary.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Button/Secondary/Secondary.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Capsule/Capsule.d.ts +1 -1
- package/dist/types/stories/atoms/icons/DynamicIcon.d.ts +2 -2
- package/dist/types/stories/atoms/icons/TablerIcon.d.ts +1 -1
- package/dist/types/stories/index.d.ts +4 -4
- package/dist/types/stories/molecules/index.d.ts +3 -3
- package/dist/types/stories/molecules/inputs/InputField/InputField.d.ts +8 -8
- package/dist/types/stories/molecules/inputs/TextInput/TextInput.d.ts +1 -1
- package/dist/types/stories/molecules/inputs/index.d.ts +4 -4
- package/dist/types/stories/molecules/inputs/select/Select.d.ts +4 -2
- package/dist/types/stories/molecules/inputs/textArea/TextArea.d.ts +34 -21
- package/dist/types/stories/molecules/inputs/textArea/TextArea.stories.d.ts +4 -4
- package/dist/types/stories/molecules/inputs/textArea/index.d.ts +3 -3
- package/dist/types/stories/molecules/inputs/toggleSwitch/ToggleSwitch.d.ts +10 -7
- package/dist/types/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.d.ts +3 -5
- package/dist/types/stories/organisms/AnimatedLabelInput/index.d.ts +1 -1
- package/dist/types/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.d.ts +12 -0
- package/dist/types/stories/organisms/AnimatedLabelTextArea/index.d.ts +3 -0
- package/dist/types/stories/organisms/DropdownComponent/DropdownComponent.d.ts +24 -13
- package/dist/types/stories/organisms/DropdownComponent/index.d.ts +2 -2
- package/dist/types/stories/organisms/EmptySectionPlaceholder/index.d.ts +1 -1
- package/dist/types/stories/organisms/TextInputSelect/InputSelect.d.ts +16 -0
- package/dist/types/stories/organisms/TextInputSelect/TextInputSelect.d.ts +48 -0
- package/dist/types/stories/organisms/TextInputSelect/index.d.ts +3 -0
- package/dist/types/stories/organisms/index.d.ts +5 -3
- package/local.sh +100 -0
- package/package.json +35 -18
- package/rollup.config.mjs +42 -0
- package/stories/atoms/badges/Badge.tsx +1 -1
- package/stories/atoms/buttons/Button/Alternative/Alternative.stories.ts +10 -0
- package/stories/atoms/buttons/Button/Button.tsx +110 -24
- package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +14 -2
- package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +14 -2
- package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +13 -1
- package/stories/atoms/buttons/Button/defaultArgs.ts +1 -1
- package/stories/atoms/buttons/Capsule/Capsule.tsx +2 -1
- package/stories/atoms/icons/DynamicIcon.stories.ts +1 -1
- package/stories/atoms/icons/DynamicIcon.tsx +7 -7
- package/stories/atoms/icons/IconWithShadow.stories.ts +3 -3
- package/stories/atoms/icons/TablerIcon.tsx +1 -1
- package/stories/atoms/loaders/Loader.tsx +12 -6
- package/stories/atoms/loaders/NProgress/RadialProgress.tsx +0 -2
- package/stories/index.ts +22 -10
- package/stories/molecules/index.ts +22 -6
- package/stories/molecules/inputs/InputField/InputField.tsx +31 -28
- package/stories/molecules/inputs/TextInput/TextInput.tsx +6 -3
- package/stories/molecules/inputs/checkbox/Checkbox.stories.ts +1 -1
- package/stories/molecules/inputs/checkbox/Checkbox.tsx +1 -2
- package/stories/molecules/inputs/combobox/ComboBox.tsx +126 -135
- package/stories/molecules/inputs/index.ts +5 -4
- package/stories/molecules/inputs/radio/Radio.stories.ts +2 -2
- package/stories/molecules/inputs/select/Select.tsx +10 -2
- package/stories/molecules/inputs/textArea/TextArea.stories.ts +7 -5
- package/stories/molecules/inputs/textArea/TextArea.tsx +139 -48
- package/stories/molecules/inputs/textArea/index.ts +3 -3
- package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.stories.tsx +15 -16
- package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx +63 -57
- package/stories/molecules/tabs/index.tsx +2 -3
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.stories.tsx +10 -1
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +43 -37
- package/stories/organisms/AnimatedLabelInput/index.tsx +1 -1
- package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.stories.tsx +26 -0
- package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.tsx +61 -0
- package/stories/organisms/AnimatedLabelTextArea/index.tsx +3 -0
- package/stories/organisms/ButtonDropdown/ButtonDropdown.stories.tsx +65 -58
- package/stories/organisms/ButtonDropdown/ButtonDropdown.tsx +26 -21
- package/stories/organisms/DropdownComponent/Dropdown.stories.tsx +26 -2
- package/stories/organisms/DropdownComponent/DropdownComponent.tsx +225 -179
- package/stories/organisms/DropdownComponent/dropdownItems.ts +30 -9
- package/stories/organisms/DropdownComponent/index.ts +2 -2
- package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.stories.tsx +3 -3
- package/stories/organisms/EmptySectionPlaceholder/index.tsx +2 -1
- package/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx +1 -1
- package/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +7 -2
- package/stories/organisms/TextInputSelect/InputSelect.tsx +59 -0
- package/stories/organisms/TextInputSelect/TextInputSelect.stories.tsx +33 -0
- package/stories/organisms/TextInputSelect/TextInputSelect.tsx +186 -0
- package/stories/organisms/TextInputSelect/index.tsx +3 -0
- package/stories/organisms/index.ts +15 -4
- package/tailwind.config.js +81 -37
- package/tsconfig.lib.json +13 -6
- package/watch.js +49 -0
- package/.yarnrc.yml +0 -1
- package/dist/types/stories/layouts/index.d.ts +0 -0
- package/stories/layouts/CardLayout/CardLayout.stories.tsx +0 -18
- package/stories/layouts/CardLayout/CardLayout.tsx +0 -22
- package/stories/layouts/CardLayout/index.tsx +0 -3
- package/stories/layouts/ModalLayout/ModalLayout.stories.tsx +0 -18
- package/stories/layouts/ModalLayout/ModalLayout.tsx +0 -22
- package/stories/layouts/ModalLayout/index.tsx +0 -3
- package/stories/layouts/index.ts +0 -0
- package/stories/organisms/DropdownComponent/Dropdown.test.tsx +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { FC, useState } from "react"
|
|
2
|
+
import { default as cn } from "classnames"
|
|
3
|
+
|
|
4
|
+
export type SelectOptions = {
|
|
5
|
+
label: string
|
|
6
|
+
value: string
|
|
7
|
+
}
|
|
8
|
+
export interface InputSelectProps {
|
|
9
|
+
align: "left" | "right"
|
|
10
|
+
/** Show the CTA without Background color and a border seperator */
|
|
11
|
+
inputOptions: SelectOptions[]
|
|
12
|
+
/** Onclick callback */
|
|
13
|
+
onSelectOption?(value: string): void
|
|
14
|
+
className?: string
|
|
15
|
+
isDisabled?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Comment */
|
|
19
|
+
export const InputSelect: FC<InputSelectProps> = ({
|
|
20
|
+
inputOptions,
|
|
21
|
+
onSelectOption,
|
|
22
|
+
align = "right",
|
|
23
|
+
className,
|
|
24
|
+
isDisabled
|
|
25
|
+
}: InputSelectProps): JSX.Element | null => {
|
|
26
|
+
const [selectedOption, setSelectedOption] = useState<string>(inputOptions[0].value)
|
|
27
|
+
|
|
28
|
+
const handleChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
|
|
29
|
+
const targetValue = e.target.value
|
|
30
|
+
onSelectOption && onSelectOption(targetValue)
|
|
31
|
+
setSelectedOption(targetValue)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (!inputOptions?.length) return null
|
|
35
|
+
return (
|
|
36
|
+
<select
|
|
37
|
+
className={cn(
|
|
38
|
+
"relative z-10 inline-flex items-center space-x-2 border border-gray-300 bg-white px-4 py-2 pr-7 text-sm font-medium",
|
|
39
|
+
"focus:border-purple-500 focus:outline-none focus:ring-1 focus:ring-purple-500",
|
|
40
|
+
align === "right"
|
|
41
|
+
? "-ml-px rounded-r border-l-white text-gray-700"
|
|
42
|
+
: align === "left"
|
|
43
|
+
? "-mr-px rounded-l border-r-white text-gray-500 focus-within:z-10"
|
|
44
|
+
: "",
|
|
45
|
+
!onSelectOption ? "cursor-default" : "",
|
|
46
|
+
className
|
|
47
|
+
)}
|
|
48
|
+
onChange={handleChange}
|
|
49
|
+
value={selectedOption}
|
|
50
|
+
disabled={isDisabled}
|
|
51
|
+
>
|
|
52
|
+
{inputOptions.map((option) => (
|
|
53
|
+
<option key={option.value} value={option.value}>
|
|
54
|
+
{option.label}
|
|
55
|
+
</option>
|
|
56
|
+
))}
|
|
57
|
+
</select>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import TextInputSelect from "."
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof TextInputSelect> = {
|
|
5
|
+
title: "Design System/organisms/TextInputSelect",
|
|
6
|
+
component: TextInputSelect,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default meta
|
|
12
|
+
type Story = StoryObj<typeof TextInputSelect>
|
|
13
|
+
export const DefaultTextInputSelectStory: Story = {
|
|
14
|
+
args: {
|
|
15
|
+
isFocused: false,
|
|
16
|
+
isError: false,
|
|
17
|
+
id: "input",
|
|
18
|
+
name: "input",
|
|
19
|
+
defaultValue: "",
|
|
20
|
+
isRequired: false,
|
|
21
|
+
isDisabled: false,
|
|
22
|
+
isShowCounter: false,
|
|
23
|
+
label: "Currency",
|
|
24
|
+
placeholder: "420.69",
|
|
25
|
+
type: "currency",
|
|
26
|
+
inputOptions: [
|
|
27
|
+
{ label: "USD", value: "USD" },
|
|
28
|
+
{ label: "CAD", value: "CAD" },
|
|
29
|
+
{ label: "EUR", value: "EUR" }
|
|
30
|
+
],
|
|
31
|
+
prefix: "$"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import React, { FC, useEffect, useId, useRef, useState } from "react"
|
|
2
|
+
import { default as cn } from "classnames"
|
|
3
|
+
|
|
4
|
+
import { InputSelect } from "./InputSelect"
|
|
5
|
+
import { AcceptedInputTypes, InputField } from "@/stories/molecules"
|
|
6
|
+
import InputCounter from "@/stories/molecules/inputs/InputCounter"
|
|
7
|
+
|
|
8
|
+
export type SelectOptions = {
|
|
9
|
+
label: string
|
|
10
|
+
value: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ITextInputSelectProps {
|
|
14
|
+
/** Input type*/
|
|
15
|
+
type: AcceptedInputTypes
|
|
16
|
+
/** Input ID */
|
|
17
|
+
id?: string
|
|
18
|
+
/** Input Name */
|
|
19
|
+
name?: string
|
|
20
|
+
/** Label for the input */
|
|
21
|
+
label?: string
|
|
22
|
+
/** placeholder for the input */
|
|
23
|
+
placeholder?: string
|
|
24
|
+
/** Force the focus state on the input */
|
|
25
|
+
isFocused?: boolean
|
|
26
|
+
/** Error state */
|
|
27
|
+
isError?: boolean
|
|
28
|
+
/** If field is required */
|
|
29
|
+
isRequired?: boolean
|
|
30
|
+
/** Disabled state */
|
|
31
|
+
isDisabled?: boolean
|
|
32
|
+
/** Set default value */
|
|
33
|
+
defaultValue?: string
|
|
34
|
+
/** Set value */
|
|
35
|
+
value: string
|
|
36
|
+
/** Message shown under the text field */
|
|
37
|
+
message?: string
|
|
38
|
+
/** Input character counter */
|
|
39
|
+
isShowCounter?: boolean
|
|
40
|
+
/** Max length of input character */
|
|
41
|
+
maxLength?: number
|
|
42
|
+
/** Select input location */
|
|
43
|
+
selectLocation?: "left" | "right"
|
|
44
|
+
/** Prefix */
|
|
45
|
+
prefix?: string
|
|
46
|
+
/** List of options to show on the select field */
|
|
47
|
+
inputOptions?: SelectOptions[]
|
|
48
|
+
/** Callback on base input */
|
|
49
|
+
onChange?(value: string): void
|
|
50
|
+
/** Callback on input select field */
|
|
51
|
+
onSelectOption?(value: string): void
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const TextInputSelect: FC<ITextInputSelectProps> = ({
|
|
55
|
+
label,
|
|
56
|
+
isFocused,
|
|
57
|
+
isError,
|
|
58
|
+
id,
|
|
59
|
+
name,
|
|
60
|
+
isRequired,
|
|
61
|
+
type,
|
|
62
|
+
defaultValue,
|
|
63
|
+
isDisabled,
|
|
64
|
+
message,
|
|
65
|
+
isShowCounter,
|
|
66
|
+
maxLength,
|
|
67
|
+
placeholder,
|
|
68
|
+
inputOptions,
|
|
69
|
+
selectLocation = "right",
|
|
70
|
+
prefix,
|
|
71
|
+
onChange,
|
|
72
|
+
onSelectOption,
|
|
73
|
+
value: externalValue
|
|
74
|
+
}: ITextInputSelectProps) => {
|
|
75
|
+
const [isFocus, setIsFocus] = useState<boolean>(Boolean(isFocused))
|
|
76
|
+
const [value, setValue] = useState<string>(defaultValue || "")
|
|
77
|
+
const inputRef = useRef<HTMLInputElement>(null)
|
|
78
|
+
|
|
79
|
+
const uniqueID = useId()
|
|
80
|
+
if (!id) id = `select-${uniqueID}`
|
|
81
|
+
if (!name) name = id
|
|
82
|
+
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
setValue(externalValue)
|
|
85
|
+
}, [externalValue])
|
|
86
|
+
|
|
87
|
+
// set force focus
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
const input = inputRef.current
|
|
90
|
+
if (!input || isFocus === undefined || isFocused === undefined || isDisabled) return
|
|
91
|
+
if (isFocus || isFocused) {
|
|
92
|
+
input.focus()
|
|
93
|
+
} else {
|
|
94
|
+
input.blur()
|
|
95
|
+
}
|
|
96
|
+
}, [isFocus, isFocused])
|
|
97
|
+
|
|
98
|
+
// set label as active if default value is set
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
const input = inputRef.current
|
|
101
|
+
if (!input || defaultValue === undefined || defaultValue === "") return
|
|
102
|
+
}, [defaultValue])
|
|
103
|
+
|
|
104
|
+
const handleInputFocus = (): void => {
|
|
105
|
+
setIsFocus(true)
|
|
106
|
+
// add other focus effects here
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const handleInputBlur = (): void => {
|
|
110
|
+
setIsFocus(false)
|
|
111
|
+
// add other focus effects here
|
|
112
|
+
}
|
|
113
|
+
const labelStyles = cn("block inline-block font-medium transition-all text-sm text-gray-700 mb-1", {
|
|
114
|
+
"text-red-500 bg-white": isError
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
const discriptionStyles = cn("text-sm mt-1 block", { "text-gray-500": !isError }, { "text-red-500": isError })
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<div>
|
|
121
|
+
{label && (
|
|
122
|
+
<label htmlFor={id} className={labelStyles}>
|
|
123
|
+
{label}
|
|
124
|
+
{isRequired && <span className="text-red-500"> *</span>}
|
|
125
|
+
</label>
|
|
126
|
+
)}
|
|
127
|
+
<div className="flex">
|
|
128
|
+
{inputOptions?.length && selectLocation === "left" && (
|
|
129
|
+
<InputSelect
|
|
130
|
+
inputOptions={inputOptions}
|
|
131
|
+
align="left"
|
|
132
|
+
onSelectOption={onSelectOption}
|
|
133
|
+
className={cn(isError ? "border-red-500" : "")}
|
|
134
|
+
isDisabled={isDisabled}
|
|
135
|
+
/>
|
|
136
|
+
)}
|
|
137
|
+
<div className="relative flex-grow focus-within:z-20">
|
|
138
|
+
{prefix && (
|
|
139
|
+
<div className="pointer-events-none pr-10 absolute inset-y-0 left-0 flex items-center pl-3">
|
|
140
|
+
<span className="text-gray-500 sm:text-sm">{prefix}</span>
|
|
141
|
+
</div>
|
|
142
|
+
)}
|
|
143
|
+
<InputField
|
|
144
|
+
onFocus={handleInputFocus}
|
|
145
|
+
onBlur={handleInputBlur}
|
|
146
|
+
handleChange={(v) => onChange && onChange(v)}
|
|
147
|
+
ref={inputRef}
|
|
148
|
+
type={type}
|
|
149
|
+
name={name}
|
|
150
|
+
id={id}
|
|
151
|
+
className={cn(
|
|
152
|
+
"w-full border border-gray-300 py-2 px-3 text-sm font-normal leading-5",
|
|
153
|
+
"focus:border-purple-500 focus:outline-none focus:ring-1 focus:ring-purple-500 sm:text-sm",
|
|
154
|
+
selectLocation === "right" ? `rounded-l` : `rounded-r`,
|
|
155
|
+
isError ? "border-red-500" : "",
|
|
156
|
+
prefix ? `pl-7` : ""
|
|
157
|
+
)}
|
|
158
|
+
isDisabled={isDisabled}
|
|
159
|
+
defaultValue={defaultValue}
|
|
160
|
+
value={value}
|
|
161
|
+
maxLength={maxLength}
|
|
162
|
+
placeholder={placeholder}
|
|
163
|
+
/>
|
|
164
|
+
</div>
|
|
165
|
+
{inputOptions?.length && selectLocation === "right" && (
|
|
166
|
+
<InputSelect
|
|
167
|
+
inputOptions={inputOptions}
|
|
168
|
+
align={"right"}
|
|
169
|
+
onSelectOption={onSelectOption}
|
|
170
|
+
isDisabled={isDisabled}
|
|
171
|
+
className={cn(isError ? "border-red-500" : "")}
|
|
172
|
+
/>
|
|
173
|
+
)}
|
|
174
|
+
</div>
|
|
175
|
+
<div className="flex flex-row space-x-3">
|
|
176
|
+
<div className="grow">{message && <span className={discriptionStyles}>{message}</span>}</div>
|
|
177
|
+
{isShowCounter && (
|
|
178
|
+
<div className="shrink-0">
|
|
179
|
+
<InputCounter current={Number(value?.length)} limit={maxLength} />
|
|
180
|
+
</div>
|
|
181
|
+
)}
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
export default TextInputSelect
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import AnimatedLabelInput, { IAnimatedLabelInputProps } from "./AnimatedLabelInput"
|
|
2
|
+
import AnimatedLabelTextArea, { IAnimatedLabelTextAreaProps } from "./AnimatedLabelTextArea"
|
|
2
3
|
import ButtonDropdown, { IButtonDropdownProps } from "./ButtonDropdown"
|
|
3
|
-
import Dropdown, {
|
|
4
|
+
import Dropdown, { IDropdownProps, IItemProp } from "./DropdownComponent"
|
|
4
5
|
import EmptySectionPlaceholder, { IEmptySectionPlaceholderProps } from "./EmptySectionPlaceholder"
|
|
5
6
|
import FormInputWithAddons, { IFormInputWithAddonsProps } from "./FormInputWithAddons"
|
|
7
|
+
import TextInputSelect, { ITextInputSelectProps } from "./TextInputSelect"
|
|
6
8
|
|
|
7
9
|
export type {
|
|
8
10
|
IAnimatedLabelInputProps,
|
|
11
|
+
IAnimatedLabelTextAreaProps,
|
|
9
12
|
IButtonDropdownProps,
|
|
10
|
-
IDropdownClassnames,
|
|
11
13
|
IDropdownProps,
|
|
12
14
|
IEmptySectionPlaceholderProps,
|
|
13
15
|
IItemProp,
|
|
14
|
-
IFormInputWithAddonsProps
|
|
16
|
+
IFormInputWithAddonsProps,
|
|
17
|
+
ITextInputSelectProps
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
AnimatedLabelInput,
|
|
21
|
+
AnimatedLabelTextArea,
|
|
22
|
+
ButtonDropdown,
|
|
23
|
+
Dropdown,
|
|
24
|
+
EmptySectionPlaceholder,
|
|
25
|
+
FormInputWithAddons,
|
|
26
|
+
TextInputSelect
|
|
15
27
|
}
|
|
16
|
-
export { AnimatedLabelInput, ButtonDropdown, Dropdown, EmptySectionPlaceholder, FormInputWithAddons }
|
package/tailwind.config.js
CHANGED
|
@@ -48,6 +48,28 @@ module.exports = {
|
|
|
48
48
|
header: "max-content 1fr 1fr"
|
|
49
49
|
},
|
|
50
50
|
colors: {
|
|
51
|
+
"transparent-white-05": "rgba(255, 255, 255, 0.05)",
|
|
52
|
+
"transparent-white-10": "rgba(255, 255, 255, 0.1)",
|
|
53
|
+
"transparent-white-20": "rgba(255, 255, 255, 0.2)",
|
|
54
|
+
"transparent-white-30": "rgba(255, 255, 255, 0.3)",
|
|
55
|
+
"transparent-white-40": "rgba(255, 255, 255, 0.4)",
|
|
56
|
+
"transparent-white-50": "rgba(255, 255, 255, 0.5)",
|
|
57
|
+
"transparent-white-60": "rgba(255, 255, 255, 0.6)",
|
|
58
|
+
"transparent-white-70": "rgba(255, 255, 255, 0.7)",
|
|
59
|
+
"transparent-white-80": "rgba(255, 255, 255, 0.8)",
|
|
60
|
+
"transparent-white-90": "rgba(255, 255, 255, 0.9)",
|
|
61
|
+
|
|
62
|
+
"transparent-black-05": "rgba(0, 0, 0, 0.05)",
|
|
63
|
+
"transparent-black-10": "rgba(0, 0, 0, 0.1)",
|
|
64
|
+
"transparent-black-20": "rgba(0, 0, 0, 0.2)",
|
|
65
|
+
"transparent-black-30": "rgba(0, 0, 0, 0.3)",
|
|
66
|
+
"transparent-black-40": "rgba(0, 0, 0, 0.4)",
|
|
67
|
+
"transparent-black-50": "rgba(0, 0, 0, 0.5)",
|
|
68
|
+
"transparent-black-60": "rgba(0, 0, 0, 0.6)",
|
|
69
|
+
"transparent-black-70": "rgba(0, 0, 0, 0.7)",
|
|
70
|
+
"transparent-black-80": "rgba(0, 0, 0, 0.8)",
|
|
71
|
+
"transparent-black-90": "rgba(0, 0, 0, 0.9)",
|
|
72
|
+
|
|
51
73
|
"gray-50": "#F9FAFB",
|
|
52
74
|
"gray-100": "#F3F4F6",
|
|
53
75
|
"gray-200": "#E5E7EB",
|
|
@@ -56,7 +78,6 @@ module.exports = {
|
|
|
56
78
|
"gray-500": "#6B7280",
|
|
57
79
|
"gray-600": "#4B5563",
|
|
58
80
|
"gray-700": "#374151",
|
|
59
|
-
"gray-800": "#1F2937",
|
|
60
81
|
"gray-900": "#111827",
|
|
61
82
|
|
|
62
83
|
"red-50": "#FEF2F2",
|
|
@@ -92,6 +113,17 @@ module.exports = {
|
|
|
92
113
|
"yellow-800": "#997A18",
|
|
93
114
|
"yellow-900": "#806614",
|
|
94
115
|
|
|
116
|
+
"green-50": "#ECFDF5",
|
|
117
|
+
"green-100": "#D1FAE5",
|
|
118
|
+
"green-200": "#A7F3D0",
|
|
119
|
+
"green-300": "#6EE7B7",
|
|
120
|
+
"green-400": "#34D399",
|
|
121
|
+
"green-500": "#10B981",
|
|
122
|
+
"green-600": "#059669",
|
|
123
|
+
"green-700": "#047857",
|
|
124
|
+
"green-800": "#065F46",
|
|
125
|
+
"green-900": "#064E3B",
|
|
126
|
+
|
|
95
127
|
"teal-50": "#F0FDFA",
|
|
96
128
|
"teal-100": "#CCFBF1",
|
|
97
129
|
"teal-200": "#99F6E4",
|
|
@@ -103,33 +135,33 @@ module.exports = {
|
|
|
103
135
|
"teal-800": "#115E59",
|
|
104
136
|
"teal-900": "#134E4A",
|
|
105
137
|
|
|
106
|
-
"cyan-50": "#
|
|
107
|
-
"cyan-100": "#
|
|
108
|
-
"cyan-200": "#
|
|
109
|
-
"cyan-300": "#
|
|
110
|
-
"cyan-400": "#
|
|
138
|
+
"cyan-50": "#ECFEFF",
|
|
139
|
+
"cyan-100": "#CFFAFE",
|
|
140
|
+
"cyan-200": "#A5F3FC",
|
|
141
|
+
"cyan-300": "#67E8F9",
|
|
142
|
+
"cyan-400": "#22D3EE",
|
|
111
143
|
"cyan-500": "#06B6D4",
|
|
112
144
|
"cyan-600": "#0891B2",
|
|
113
145
|
"cyan-700": "#0E7490",
|
|
114
146
|
"cyan-800": "#155E75",
|
|
115
147
|
"cyan-900": "#164E63",
|
|
116
148
|
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
149
|
+
"lightBlue-50": "#F0F9FF",
|
|
150
|
+
"lightBlue-100": "#E0F2FE",
|
|
151
|
+
"lightBlue-200": "#BAE6FD",
|
|
152
|
+
"lightBlue-300": "#7DD3FC",
|
|
153
|
+
"lightBlue-400": "#38BDF8",
|
|
154
|
+
"lightBlue-500": "#0EA5E9",
|
|
155
|
+
"lightBlue-600": "#0284C7",
|
|
156
|
+
"lightBlue-700": "#0369A1",
|
|
157
|
+
"lightBlue-800": "#075985",
|
|
158
|
+
"lightBlue-900": "#0C4A6E",
|
|
127
159
|
|
|
128
|
-
"blue-50": "#
|
|
129
|
-
"blue-100": "#
|
|
130
|
-
"blue-200": "#
|
|
131
|
-
"blue-300": "#
|
|
132
|
-
"blue-400": "#
|
|
160
|
+
"blue-50": "#EFF6FF",
|
|
161
|
+
"blue-100": "#DBEAFE",
|
|
162
|
+
"blue-200": "#BFDBFE",
|
|
163
|
+
"blue-300": "#93C5FD",
|
|
164
|
+
"blue-400": "#60A5FA",
|
|
133
165
|
"blue-500": "#3B82F6",
|
|
134
166
|
"blue-600": "#2563EB",
|
|
135
167
|
"blue-700": "#1D4ED8",
|
|
@@ -147,20 +179,21 @@ module.exports = {
|
|
|
147
179
|
"purple-800": "#4F00BF",
|
|
148
180
|
"purple-900": "#4600AA",
|
|
149
181
|
|
|
150
|
-
"violet-50": "#
|
|
151
|
-
"violet-100": "#
|
|
152
|
-
"violet-200": "#
|
|
153
|
-
"violet-300": "#
|
|
154
|
-
"violet-400": "#
|
|
182
|
+
"violet-50": "#F5F3FF",
|
|
183
|
+
"violet-100": "#EDE9FE",
|
|
184
|
+
"violet-200": "#DDD6FE",
|
|
185
|
+
"violet-300": "#C4B5FD",
|
|
186
|
+
"violet-400": "#A78BFA",
|
|
155
187
|
"violet-500": "#8B5CF6",
|
|
156
188
|
"violet-600": "#7C3AED",
|
|
157
189
|
"violet-700": "#6D28D9",
|
|
158
190
|
"violet-800": "#5B21B6",
|
|
159
191
|
"violet-900": "#4C1D95",
|
|
160
192
|
|
|
161
|
-
"pink-50": "#
|
|
193
|
+
"pink-50": "#FDF2F8",
|
|
162
194
|
"pink-100": "#FCE7F3",
|
|
163
195
|
"pink-200": "#FBCFE8",
|
|
196
|
+
"pink-300": "#F9A8D4",
|
|
164
197
|
"pink-400": "#F472B6",
|
|
165
198
|
"pink-500": "#EC4899",
|
|
166
199
|
"pink-600": "#DB2777",
|
|
@@ -168,11 +201,11 @@ module.exports = {
|
|
|
168
201
|
"pink-800": "#9D174D",
|
|
169
202
|
"pink-900": "#831843",
|
|
170
203
|
|
|
171
|
-
"rose-50": "#
|
|
172
|
-
"rose-100": "#
|
|
173
|
-
"rose-200": "#
|
|
174
|
-
"rose-300": "#
|
|
175
|
-
"rose-400": "#
|
|
204
|
+
"rose-50": "#FFF1F2",
|
|
205
|
+
"rose-100": "#FFE4E6",
|
|
206
|
+
"rose-200": "#FECDD3",
|
|
207
|
+
"rose-300": "#FDA4AF",
|
|
208
|
+
"rose-400": "#FB7185",
|
|
176
209
|
"rose-500": "#F43F5E",
|
|
177
210
|
"rose-600": "#E11D48",
|
|
178
211
|
"rose-700": "#BE123C",
|
|
@@ -181,12 +214,23 @@ module.exports = {
|
|
|
181
214
|
},
|
|
182
215
|
fontWeight: {
|
|
183
216
|
medium: 600
|
|
217
|
+
},
|
|
218
|
+
fontSize: {
|
|
219
|
+
xs: ["0.75rem", "1rem"],
|
|
220
|
+
sm: ["0.875rem", "1.25rem"],
|
|
221
|
+
base: ["1rem", "1.5rem"],
|
|
222
|
+
lg: ["1.125rem", "1.75rem"],
|
|
223
|
+
xl: ["1.25rem", "1.75rem"],
|
|
224
|
+
"2xl": ["1.5rem", "2rem"],
|
|
225
|
+
"3xl": ["1.875rem", "2.25rem"],
|
|
226
|
+
"4xl": ["2.25rem", "2.5rem"],
|
|
227
|
+
"5xl": ["3rem", "3rem"],
|
|
228
|
+
"6xl": ["3.75rem", "3.75rem"],
|
|
229
|
+
"7xl": ["4.5rem", "4.5rem"],
|
|
230
|
+
"8xl": ["6rem", "6rem"],
|
|
231
|
+
"9xl": ["8rem", "8rem"]
|
|
184
232
|
}
|
|
185
233
|
}
|
|
186
234
|
},
|
|
187
|
-
plugins: [
|
|
188
|
-
require("@tailwindcss/forms"),
|
|
189
|
-
require("@tailwindcss/typography"),
|
|
190
|
-
require("@headlessui/tailwindcss")
|
|
191
|
-
]
|
|
235
|
+
plugins: [require("@tailwindcss/forms"), require("@tailwindcss/typography"), require("@headlessui/tailwindcss")]
|
|
192
236
|
}
|
package/tsconfig.lib.json
CHANGED
|
@@ -3,17 +3,24 @@
|
|
|
3
3
|
"declaration": true,
|
|
4
4
|
"declarationDir": "./dist/types",
|
|
5
5
|
"outDir": "./dist",
|
|
6
|
-
"module": "
|
|
6
|
+
"module": "ESNext",
|
|
7
7
|
"rootDir": "./",
|
|
8
|
-
"target": "
|
|
8
|
+
"target": "ESNext",
|
|
9
9
|
"esModuleInterop": true,
|
|
10
10
|
"moduleResolution": "node",
|
|
11
11
|
"baseUrl": ".",
|
|
12
12
|
"paths": {
|
|
13
|
-
"@/*": [
|
|
13
|
+
"@/*": [
|
|
14
|
+
"./*"
|
|
15
|
+
]
|
|
14
16
|
},
|
|
15
17
|
"jsx": "react-jsx"
|
|
16
18
|
},
|
|
17
|
-
"include": [
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
"include": [
|
|
20
|
+
"stories/**/*.ts",
|
|
21
|
+
"utils/**/*.ts"
|
|
22
|
+
],
|
|
23
|
+
"exclude": [
|
|
24
|
+
"node_modules"
|
|
25
|
+
]
|
|
26
|
+
}
|
package/watch.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const esbuild = require("esbuild")
|
|
3
|
+
|
|
4
|
+
const context = {
|
|
5
|
+
logLevel: "info",
|
|
6
|
+
entryPoints: [path.resolve(__dirname, "stories/index.ts")],
|
|
7
|
+
bundle: true,
|
|
8
|
+
platform: "browser",
|
|
9
|
+
target: ["esnext"],
|
|
10
|
+
minify: true,
|
|
11
|
+
pure: ["React.createElement"],
|
|
12
|
+
jsx: 'transform',
|
|
13
|
+
loader: { '.js': 'jsx' },
|
|
14
|
+
outdir: path.resolve(__dirname, "dist"),
|
|
15
|
+
sourcemap: true,
|
|
16
|
+
external: [
|
|
17
|
+
"react",
|
|
18
|
+
"react-dom",
|
|
19
|
+
"@floating-ui/react",
|
|
20
|
+
"@headlessui/react",
|
|
21
|
+
"@headlessui/tailwindcss",
|
|
22
|
+
"@heroicons/react",
|
|
23
|
+
"@tabler/icons",
|
|
24
|
+
"@tabler/icons-react",
|
|
25
|
+
"classnames",
|
|
26
|
+
"react-icons",
|
|
27
|
+
"@storybook/react",
|
|
28
|
+
"@storybook/addon-designs",
|
|
29
|
+
"@storybook/addon-essentials",
|
|
30
|
+
"@storybook/addon-interactions",
|
|
31
|
+
"@storybook/addon-links",
|
|
32
|
+
"@storybook/blocks",
|
|
33
|
+
"@storybook/manager-api",
|
|
34
|
+
"@storybook/nextjs",
|
|
35
|
+
"@storybook/react",
|
|
36
|
+
"@storybook/testing-library",
|
|
37
|
+
"@storybook/theming",
|
|
38
|
+
"storybook"
|
|
39
|
+
],
|
|
40
|
+
format: "esm"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function watch() {
|
|
44
|
+
const ctx = await esbuild.context(context)
|
|
45
|
+
ctx.watch()
|
|
46
|
+
console.log(`Watching....`)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
watch()
|
package/.yarnrc.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodeLinker: node-modules
|
|
File without changes
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react"
|
|
3
|
-
import CardLayout, { ICardLayoutProps } from "./CardLayout"
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof CardLayout> = {
|
|
6
|
-
title: "Design System/layouts/CardLayout",
|
|
7
|
-
component: CardLayout,
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
argTypes: {}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default meta
|
|
13
|
-
type Story = StoryObj<typeof CardLayout>
|
|
14
|
-
export const DefaultCardLayoutStory: Story = {
|
|
15
|
-
args: {
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import React from "react"
|
|
3
|
-
import EmptySectionPlaceholder from "@/stories/organisms/EmptySectionPlaceholder"
|
|
4
|
-
|
|
5
|
-
export interface ICardLayoutProps {}
|
|
6
|
-
|
|
7
|
-
const CardLayout: React.FC<ICardLayoutProps> = ({}) => {
|
|
8
|
-
return (
|
|
9
|
-
<EmptySectionPlaceholder
|
|
10
|
-
{...{
|
|
11
|
-
icon: {
|
|
12
|
-
icon: "IconCode"
|
|
13
|
-
},
|
|
14
|
-
mutedText: "Coming Soon! 🚧",
|
|
15
|
-
primaryMessage: "We're working on this component. Be sure to check back soon!",
|
|
16
|
-
actions: []
|
|
17
|
-
}}
|
|
18
|
-
/>
|
|
19
|
-
)
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default CardLayout;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react"
|
|
3
|
-
import ModalLayout, { IModalLayoutProps } from "./ModalLayout"
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof ModalLayout> = {
|
|
6
|
-
title: "Design System/layouts/ModalLayout",
|
|
7
|
-
component: ModalLayout,
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
argTypes: {}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default meta
|
|
13
|
-
type Story = StoryObj<typeof ModalLayout>
|
|
14
|
-
export const DefaultModalLayoutStory: Story = {
|
|
15
|
-
args: {
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import React from "react"
|
|
3
|
-
import EmptySectionPlaceholder from "@/stories/organisms/EmptySectionPlaceholder"
|
|
4
|
-
|
|
5
|
-
export interface IModalLayoutProps {}
|
|
6
|
-
|
|
7
|
-
const ModalLayout: React.FC<IModalLayoutProps> = ({}) => {
|
|
8
|
-
return (
|
|
9
|
-
<EmptySectionPlaceholder
|
|
10
|
-
{...{
|
|
11
|
-
icon: {
|
|
12
|
-
icon: "IconCode"
|
|
13
|
-
},
|
|
14
|
-
mutedText: "Coming Soon! 🚧",
|
|
15
|
-
primaryMessage: "We're working on this component. Be sure to check back soon!",
|
|
16
|
-
actions: []
|
|
17
|
-
}}
|
|
18
|
-
/>
|
|
19
|
-
)
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default ModalLayout;
|
package/stories/layouts/index.ts
DELETED
|
File without changes
|