@agility/plenum-ui 2.1.27 → 2.2.1
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/.storybook/preview.tsx +7 -6
- package/dist/index.d.ts +130 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/tailwind.css +106 -1
- package/dist/types/stories/atoms/Typography/Heading/Heading.d.ts +8 -0
- package/dist/types/stories/atoms/Typography/Heading/Heading.stories.d.ts +12 -0
- package/dist/types/stories/atoms/Typography/Heading/index.d.ts +3 -0
- package/dist/types/stories/atoms/Typography/Label/Label.d.ts +10 -0
- package/dist/types/stories/atoms/Typography/Label/Label.stories.d.ts +12 -0
- package/dist/types/stories/atoms/Typography/Label/index.d.ts +3 -0
- package/dist/types/stories/atoms/Typography/Paragraph/Paragraph.d.ts +10 -0
- package/dist/types/stories/atoms/Typography/Paragraph/Paragraph.stories.d.ts +11 -0
- package/dist/types/stories/atoms/Typography/Paragraph/index.d.ts +3 -0
- package/dist/types/stories/atoms/buttons/Button/Button.d.ts +1 -1
- package/dist/types/stories/atoms/buttons/Button/DangerSecondary/DangerSecondary.stories.d.ts +15 -0
- package/dist/types/stories/atoms/index.d.ts +5 -2
- package/dist/types/stories/index.d.ts +3 -3
- package/dist/types/stories/molecules/inputs/TextInput/TextInput.d.ts +4 -0
- package/package.json +1 -1
- package/stories/atoms/Typography/Heading/Heading.stories.ts +40 -0
- package/stories/atoms/Typography/Heading/Heading.tsx +26 -0
- package/stories/atoms/Typography/Heading/index.ts +3 -0
- package/stories/atoms/Typography/Label/Label.stories.ts +40 -0
- package/stories/atoms/Typography/Label/Label.tsx +25 -0
- package/stories/atoms/Typography/Label/index.ts +3 -0
- package/stories/atoms/Typography/Paragraph/Paragraph.stories.ts +36 -0
- package/stories/atoms/Typography/Paragraph/Paragraph.tsx +24 -0
- package/stories/atoms/Typography/Paragraph/index.ts +3 -0
- package/stories/atoms/buttons/Button/Button.tsx +39 -38
- package/stories/atoms/buttons/Button/DangerSecondary/DangerSecondary.stories.ts +90 -0
- package/stories/atoms/buttons/Button/tests/Button.test.tsx +0 -37
- package/stories/atoms/index.ts +16 -8
- package/stories/index.ts +15 -3
- package/stories/molecules/inputs/TextInput/TextInput.tsx +59 -46
- package/tailwind.config.js +1 -1
package/dist/tailwind.css
CHANGED
|
@@ -67985,6 +67985,34 @@ select {
|
|
|
67985
67985
|
line-height: 3.75rem;
|
|
67986
67986
|
}
|
|
67987
67987
|
|
|
67988
|
+
.text-\[10px\] {
|
|
67989
|
+
font-size: 10px;
|
|
67990
|
+
}
|
|
67991
|
+
|
|
67992
|
+
.text-\[20px\] {
|
|
67993
|
+
font-size: 20px;
|
|
67994
|
+
}
|
|
67995
|
+
|
|
67996
|
+
.text-\[24px\] {
|
|
67997
|
+
font-size: 24px;
|
|
67998
|
+
}
|
|
67999
|
+
|
|
68000
|
+
.text-\[28px\] {
|
|
68001
|
+
font-size: 28px;
|
|
68002
|
+
}
|
|
68003
|
+
|
|
68004
|
+
.text-\[32px\] {
|
|
68005
|
+
font-size: 32px;
|
|
68006
|
+
}
|
|
68007
|
+
|
|
68008
|
+
.text-\[36px\] {
|
|
68009
|
+
font-size: 36px;
|
|
68010
|
+
}
|
|
68011
|
+
|
|
68012
|
+
.text-\[40px\] {
|
|
68013
|
+
font-size: 40px;
|
|
68014
|
+
}
|
|
68015
|
+
|
|
67988
68016
|
.text-base {
|
|
67989
68017
|
font-size: 1rem;
|
|
67990
68018
|
line-height: 1.5rem;
|
|
@@ -68031,7 +68059,7 @@ select {
|
|
|
68031
68059
|
}
|
|
68032
68060
|
|
|
68033
68061
|
.font-medium {
|
|
68034
|
-
font-weight:
|
|
68062
|
+
font-weight: 500;
|
|
68035
68063
|
}
|
|
68036
68064
|
|
|
68037
68065
|
.font-normal {
|
|
@@ -68058,10 +68086,46 @@ select {
|
|
|
68058
68086
|
line-height: 1.25rem;
|
|
68059
68087
|
}
|
|
68060
68088
|
|
|
68089
|
+
.leading-\[14px\] {
|
|
68090
|
+
line-height: 14px;
|
|
68091
|
+
}
|
|
68092
|
+
|
|
68093
|
+
.leading-\[20px\] {
|
|
68094
|
+
line-height: 20px;
|
|
68095
|
+
}
|
|
68096
|
+
|
|
68097
|
+
.leading-\[28px\] {
|
|
68098
|
+
line-height: 28px;
|
|
68099
|
+
}
|
|
68100
|
+
|
|
68101
|
+
.leading-\[32px\] {
|
|
68102
|
+
line-height: 32px;
|
|
68103
|
+
}
|
|
68104
|
+
|
|
68105
|
+
.leading-\[36px\] {
|
|
68106
|
+
line-height: 36px;
|
|
68107
|
+
}
|
|
68108
|
+
|
|
68109
|
+
.leading-\[40px\] {
|
|
68110
|
+
line-height: 40px;
|
|
68111
|
+
}
|
|
68112
|
+
|
|
68113
|
+
.leading-\[44px\] {
|
|
68114
|
+
line-height: 44px;
|
|
68115
|
+
}
|
|
68116
|
+
|
|
68117
|
+
.leading-\[48px\] {
|
|
68118
|
+
line-height: 48px;
|
|
68119
|
+
}
|
|
68120
|
+
|
|
68061
68121
|
.leading-none {
|
|
68062
68122
|
line-height: 1;
|
|
68063
68123
|
}
|
|
68064
68124
|
|
|
68125
|
+
.tracking-\[-0\.8px\] {
|
|
68126
|
+
letter-spacing: -0.8px;
|
|
68127
|
+
}
|
|
68128
|
+
|
|
68065
68129
|
.\!text-gray-500 {
|
|
68066
68130
|
--tw-text-opacity: 1 !important;
|
|
68067
68131
|
color: rgb(107 114 128 / var(--tw-text-opacity, 1)) !important;
|
|
@@ -79050,6 +79114,11 @@ select {
|
|
|
79050
79114
|
background-color: rgb(88 0 212 / var(--tw-bg-opacity, 1));
|
|
79051
79115
|
}
|
|
79052
79116
|
|
|
79117
|
+
.hover\:bg-red-50:hover {
|
|
79118
|
+
--tw-bg-opacity: 1;
|
|
79119
|
+
background-color: rgb(254 242 242 / var(--tw-bg-opacity, 1));
|
|
79120
|
+
}
|
|
79121
|
+
|
|
79053
79122
|
.hover\:bg-red-700:hover {
|
|
79054
79123
|
--tw-bg-opacity: 1;
|
|
79055
79124
|
background-color: rgb(185 28 28 / var(--tw-bg-opacity, 1));
|
|
@@ -79216,6 +79285,16 @@ select {
|
|
|
79216
79285
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
79217
79286
|
}
|
|
79218
79287
|
|
|
79288
|
+
.focus-visible\:\!ring-red-500:focus-visible {
|
|
79289
|
+
--tw-ring-opacity: 1 !important;
|
|
79290
|
+
--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1)) !important;
|
|
79291
|
+
}
|
|
79292
|
+
|
|
79293
|
+
.focus-visible\:\!ring-yellow-500:focus-visible {
|
|
79294
|
+
--tw-ring-opacity: 1 !important;
|
|
79295
|
+
--tw-ring-color: rgb(255 203 40 / var(--tw-ring-opacity, 1)) !important;
|
|
79296
|
+
}
|
|
79297
|
+
|
|
79219
79298
|
.focus-visible\:ring-purple-600:focus-visible {
|
|
79220
79299
|
--tw-ring-opacity: 1;
|
|
79221
79300
|
--tw-ring-color: rgb(105 26 216 / var(--tw-ring-opacity, 1));
|
|
@@ -79250,6 +79329,11 @@ select {
|
|
|
79250
79329
|
background-color: rgb(188 153 238 / var(--tw-bg-opacity, 1));
|
|
79251
79330
|
}
|
|
79252
79331
|
|
|
79332
|
+
.active\:bg-red-100:active {
|
|
79333
|
+
--tw-bg-opacity: 1;
|
|
79334
|
+
background-color: rgb(254 226 226 / var(--tw-bg-opacity, 1));
|
|
79335
|
+
}
|
|
79336
|
+
|
|
79253
79337
|
.active\:bg-violet-800:active {
|
|
79254
79338
|
--tw-bg-opacity: 1;
|
|
79255
79339
|
background-color: rgb(91 33 182 / var(--tw-bg-opacity, 1));
|
|
@@ -79276,6 +79360,11 @@ select {
|
|
|
79276
79360
|
--tw-ring-color: rgb(105 26 216 / var(--tw-ring-opacity, 1));
|
|
79277
79361
|
}
|
|
79278
79362
|
|
|
79363
|
+
.active\:ring-red-500:active {
|
|
79364
|
+
--tw-ring-opacity: 1;
|
|
79365
|
+
--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1));
|
|
79366
|
+
}
|
|
79367
|
+
|
|
79279
79368
|
.active\:ring-offset-2:active {
|
|
79280
79369
|
--tw-ring-offset-width: 2px;
|
|
79281
79370
|
}
|
|
@@ -79315,6 +79404,11 @@ select {
|
|
|
79315
79404
|
background-color: rgb(167 139 250 / var(--tw-bg-opacity, 1));
|
|
79316
79405
|
}
|
|
79317
79406
|
|
|
79407
|
+
.disabled\:bg-white:disabled {
|
|
79408
|
+
--tw-bg-opacity: 1;
|
|
79409
|
+
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
|
|
79410
|
+
}
|
|
79411
|
+
|
|
79318
79412
|
.disabled\:bg-yellow-300:disabled {
|
|
79319
79413
|
--tw-bg-opacity: 1;
|
|
79320
79414
|
background-color: rgb(255 224 126 / var(--tw-bg-opacity, 1));
|
|
@@ -79340,6 +79434,11 @@ select {
|
|
|
79340
79434
|
color: rgb(188 153 238 / var(--tw-text-opacity, 1));
|
|
79341
79435
|
}
|
|
79342
79436
|
|
|
79437
|
+
.disabled\:text-red-300:disabled {
|
|
79438
|
+
--tw-text-opacity: 1;
|
|
79439
|
+
color: rgb(252 165 165 / var(--tw-text-opacity, 1));
|
|
79440
|
+
}
|
|
79441
|
+
|
|
79343
79442
|
.disabled\:text-transparent-black-30:disabled {
|
|
79344
79443
|
color: rgba(0, 0, 0, 0.3);
|
|
79345
79444
|
}
|
|
@@ -79353,6 +79452,12 @@ select {
|
|
|
79353
79452
|
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
|
|
79354
79453
|
}
|
|
79355
79454
|
|
|
79455
|
+
.disabled\:\!ring-0:disabled {
|
|
79456
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;
|
|
79457
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;
|
|
79458
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000) !important;
|
|
79459
|
+
}
|
|
79460
|
+
|
|
79356
79461
|
.disabled\:focus-visible\:ring-0:focus-visible:disabled {
|
|
79357
79462
|
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
79358
79463
|
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
2
|
+
export interface HeadingProps {
|
|
3
|
+
level: HeadingLevel;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export default function Heading({ level, children, className }: HeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Heading from "./Heading";
|
|
3
|
+
declare const meta: Meta<typeof Heading>;
|
|
4
|
+
type Story = StoryObj<typeof Heading>;
|
|
5
|
+
export declare const Heading1: Story;
|
|
6
|
+
export declare const Heading2: Story;
|
|
7
|
+
export declare const Heading3: Story;
|
|
8
|
+
export declare const Heading4: Story;
|
|
9
|
+
export declare const Heading5: Story;
|
|
10
|
+
export declare const Heading6: Story;
|
|
11
|
+
export declare const HeadingWithCustomClassName: Story;
|
|
12
|
+
export default meta;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type LabelAs = "span" | "p" | "label" | "strong" | "em";
|
|
2
|
+
type LabelSize = "xl" | "lg" | "md" | "sm" | "xs";
|
|
3
|
+
export interface LabelProps {
|
|
4
|
+
as?: LabelAs;
|
|
5
|
+
size?: LabelSize;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export default function Label({ as, size, children, className }: LabelProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Label from "./Label";
|
|
3
|
+
declare const meta: Meta<typeof Label>;
|
|
4
|
+
type Story = StoryObj<typeof Label>;
|
|
5
|
+
export declare const DefaultLabel: Story;
|
|
6
|
+
export declare const ExtraLargeLabel: Story;
|
|
7
|
+
export declare const LargeLabel: Story;
|
|
8
|
+
export declare const MediumLabel: Story;
|
|
9
|
+
export declare const SmallLabel: Story;
|
|
10
|
+
export declare const ExtraSmallLabel: Story;
|
|
11
|
+
export declare const LabelWithCustomStyle: Story;
|
|
12
|
+
export default meta;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type ParagraphAs = "span" | "p" | "label" | "strong" | "em";
|
|
2
|
+
type ParagraphSize = "lg" | "md" | "sm" | "xs";
|
|
3
|
+
export interface ParagraphProps {
|
|
4
|
+
as?: ParagraphAs;
|
|
5
|
+
size?: ParagraphSize;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export default function Paragraph({ as, size, children, className }: ParagraphProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Paragraph from "./Paragraph";
|
|
3
|
+
declare const meta: Meta<typeof Paragraph>;
|
|
4
|
+
type Story = StoryObj<typeof Paragraph>;
|
|
5
|
+
export declare const DefaultParagraph: Story;
|
|
6
|
+
export declare const LargeParagraph: Story;
|
|
7
|
+
export declare const MediumParagraph: Story;
|
|
8
|
+
export declare const SmallParagraph: Story;
|
|
9
|
+
export declare const ExtraSmallParagraph: Story;
|
|
10
|
+
export declare const ParagraphWithCustomStyle: Story;
|
|
11
|
+
export default meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { HTMLAttributeAnchorTarget } from "react";
|
|
2
2
|
import { UnifiedIconName, IDynamicIconProps } from "../../icons";
|
|
3
|
-
export type BTNActionType = "primary" | "secondary" | "alternative" | "danger" | "warning";
|
|
3
|
+
export type BTNActionType = "primary" | "secondary" | "alternative" | "danger" | "danger-secondary" | "warning";
|
|
4
4
|
export interface IButtonProps extends Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> {
|
|
5
5
|
/** Is the button a Primary CTA, alternative or danger button? */
|
|
6
6
|
actionType?: BTNActionType;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Button from "../Button";
|
|
3
|
+
declare const meta: Meta<typeof Button>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Button>;
|
|
6
|
+
export declare const DangerSecondary: Story;
|
|
7
|
+
export declare const DangerSecondaryDisabled: Story;
|
|
8
|
+
export declare const DangerSecondaryTrailingIcon: Story;
|
|
9
|
+
export declare const DangerSecondaryLeadingIcon: Story;
|
|
10
|
+
export declare const DangerSecondarySimpleIconName: Story;
|
|
11
|
+
export declare const DangerSecondaryExtraSmall: Story;
|
|
12
|
+
export declare const DangerSecondarySmall: Story;
|
|
13
|
+
export declare const DangerSecondaryMedium: Story;
|
|
14
|
+
export declare const DangerSecondaryLarge: Story;
|
|
15
|
+
export declare const DangerSecondaryExtraLarge: Story;
|
|
@@ -3,5 +3,8 @@ import Badge, { IBadgeProps } from "./badges";
|
|
|
3
3
|
import { Button, Capsule, BTNActionType, IButtonProps, ICapsuleProps } from "./buttons";
|
|
4
4
|
import { DynamicIcon, FAIconName, IDynamicIconProps, IIconWithShadowProps, IconName, IconWithShadow, UnifiedIconName, isFAIcon, isHeroIcon, isTablerIcon, isUnifiedIconName } from "./icons";
|
|
5
5
|
import { ILoaderProps, IRadialProgressProps, Loader, RadialProgress } from "./loaders";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { Heading, HeadingProps } from "./Typography/Heading";
|
|
7
|
+
import { Label, LabelProps } from "./Typography/Label";
|
|
8
|
+
import { Paragraph, ParagraphProps } from "./Typography/Paragraph";
|
|
9
|
+
export type { IAvatarProps, IBadgeProps, IButtonProps, ICapsuleProps, IDynamicIconProps, IIconWithShadowProps, ILoaderProps, IRadialProgressProps, HeadingProps, LabelProps, ParagraphProps, UnifiedIconName, IconName, FAIconName, BTNActionType };
|
|
10
|
+
export { Avatar, Badge, Button, Capsule, DynamicIcon, IconWithShadow, Loader, RadialProgress, Heading, Label, Paragraph, isFAIcon, isHeroIcon, isTablerIcon, isUnifiedIconName };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IAvatarProps, IBadgeProps, IButtonProps, ICapsuleProps, IDynamicIconProps, IIconWithShadowProps, ILoaderProps, IRadialProgressProps, UnifiedIconName, IconName, FAIconName, BTNActionType, Avatar, Badge, Button, Capsule, DynamicIcon, IconWithShadow, Loader, RadialProgress, isFAIcon, isHeroIcon, isTablerIcon, isUnifiedIconName } from "./atoms";
|
|
1
|
+
import { IAvatarProps, IBadgeProps, IButtonProps, ICapsuleProps, IDynamicIconProps, IIconWithShadowProps, ILoaderProps, IRadialProgressProps, UnifiedIconName, IconName, FAIconName, BTNActionType, Avatar, Badge, Button, Capsule, DynamicIcon, IconWithShadow, Loader, RadialProgress, isFAIcon, isHeroIcon, isTablerIcon, isUnifiedIconName, Heading, HeadingProps, Label, LabelProps, Paragraph, ParagraphProps } from "./atoms";
|
|
2
2
|
import { ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps, ITextareaProps, IToggleSwitchProps, AcceptedInputTypes, Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, Textarea, ToggleSwitch, TextInput, ITextInputProps, ISimpleSelectOptions } from "./molecules";
|
|
3
3
|
import { IAnimatedLabelInputProps, AnimatedLabelTextArea, IAnimatedLabelTextAreaProps, IButtonDropdownProps, IDropdownProps, IEmptySectionPlaceholderProps, IItemProp, IFormInputWithAddonsProps, AnimatedLabelInput, ButtonDropdown, Dropdown, EmptySectionPlaceholder, FormInputWithAddons, TextInputSelect, ITextInputSelectProps, IAnimatedFormInputWithAddons, AnimatedFormInputWithAddons, DropdownWithMultiSelect, MultiSelectItemProps } from "./organisms";
|
|
4
|
-
export type { IAvatarProps, IBadgeProps, IButtonProps, ICapsuleProps, ITextInputSelectProps, IDynamicIconProps, IIconWithShadowProps, ILoaderProps, IRadialProgressProps, ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps, ITextareaProps, IToggleSwitchProps, AcceptedInputTypes, IAnimatedLabelInputProps, IAnimatedLabelTextAreaProps, IButtonDropdownProps, IDropdownProps, IEmptySectionPlaceholderProps, IItemProp, IFormInputWithAddonsProps, UnifiedIconName, IconName, FAIconName, BTNActionType, ITextInputProps, ISimpleSelectOptions, IAnimatedFormInputWithAddons, MultiSelectItemProps };
|
|
5
|
-
export { Avatar, Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, Textarea, ToggleSwitch, AnimatedLabelInput, AnimatedLabelTextArea, ButtonDropdown, Dropdown, EmptySectionPlaceholder, FormInputWithAddons, Badge, Button, Capsule, DynamicIcon, IconWithShadow, Loader, RadialProgress, isFAIcon, isHeroIcon, isTablerIcon, isUnifiedIconName, TextInput, TextInputSelect, AnimatedFormInputWithAddons, DropdownWithMultiSelect };
|
|
4
|
+
export type { IAvatarProps, IBadgeProps, IButtonProps, ICapsuleProps, ITextInputSelectProps, IDynamicIconProps, IIconWithShadowProps, ILoaderProps, IRadialProgressProps, ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps, ITextareaProps, IToggleSwitchProps, AcceptedInputTypes, IAnimatedLabelInputProps, IAnimatedLabelTextAreaProps, IButtonDropdownProps, IDropdownProps, IEmptySectionPlaceholderProps, IItemProp, IFormInputWithAddonsProps, UnifiedIconName, IconName, FAIconName, BTNActionType, ITextInputProps, ISimpleSelectOptions, IAnimatedFormInputWithAddons, MultiSelectItemProps, HeadingProps, LabelProps, ParagraphProps };
|
|
5
|
+
export { Avatar, Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, Textarea, ToggleSwitch, AnimatedLabelInput, AnimatedLabelTextArea, ButtonDropdown, Dropdown, EmptySectionPlaceholder, FormInputWithAddons, Badge, Button, Capsule, DynamicIcon, IconWithShadow, Loader, RadialProgress, isFAIcon, isHeroIcon, isTablerIcon, isUnifiedIconName, TextInput, TextInputSelect, AnimatedFormInputWithAddons, DropdownWithMultiSelect, Heading, Label, Paragraph };
|
|
@@ -34,6 +34,10 @@ export interface ITextInputProps {
|
|
|
34
34
|
/**Placeholder input text*/
|
|
35
35
|
placeholder?: string;
|
|
36
36
|
className?: string;
|
|
37
|
+
/** Callback on focus */
|
|
38
|
+
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
39
|
+
/** Callback on blur */
|
|
40
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
37
41
|
}
|
|
38
42
|
declare const _TextInput: React.ForwardRefExoticComponent<ITextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
39
43
|
export default _TextInput;
|
package/package.json
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Heading from "./Heading";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Heading> = {
|
|
5
|
+
title: "Design System/atoms/Typography/Heading",
|
|
6
|
+
component: Heading,
|
|
7
|
+
tags: ["autodocs"]
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof Heading>;
|
|
11
|
+
|
|
12
|
+
export const Heading1: Story = {
|
|
13
|
+
args: { level: 1, children: "Heading 1", className: "" }
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Heading2: Story = {
|
|
17
|
+
args: { level: 2, children: "Heading 2", className: "" }
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const Heading3: Story = {
|
|
21
|
+
args: { level: 3, children: "Heading 3", className: "" }
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const Heading4: Story = {
|
|
25
|
+
args: { level: 4, children: "Heading 4", className: "" }
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const Heading5: Story = {
|
|
29
|
+
args: { level: 5, children: "Heading 5", className: "" }
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const Heading6: Story = {
|
|
33
|
+
args: { level: 6, children: "Heading 6", className: "" }
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const HeadingWithCustomClassName: Story = {
|
|
37
|
+
args: { level: 1, children: "Heading 1", className: "text-red-500" }
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default meta;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as cn } from "classnames";
|
|
2
|
+
|
|
3
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
4
|
+
|
|
5
|
+
export interface HeadingProps {
|
|
6
|
+
level: HeadingLevel;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const headingStyles: Record<HeadingLevel, string> = {
|
|
12
|
+
1: "text-[40px] leading-[48px]",
|
|
13
|
+
2: "text-[36px] leading-[44px]",
|
|
14
|
+
3: "text-[32px] leading-[40px]",
|
|
15
|
+
4: "text-[28px] leading-[36px]",
|
|
16
|
+
5: "text-[24px] leading-[32px]",
|
|
17
|
+
6: "text-[20px] leading-[28px]"
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default function Heading({ level, children, className }: HeadingProps) {
|
|
21
|
+
const Tag = `h${level}` as const;
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Tag className={cn("gray-900 font-medium tracking-[-0.8px]", headingStyles[level], className)}>{children}</Tag>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Label from "./Label";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Label> = {
|
|
5
|
+
title: "Design System/atoms/Typography/Label",
|
|
6
|
+
component: Label,
|
|
7
|
+
tags: ["autodocs"]
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof Label>;
|
|
11
|
+
|
|
12
|
+
export const DefaultLabel: Story = {
|
|
13
|
+
args: { children: "Default Label" }
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const ExtraLargeLabel: Story = {
|
|
17
|
+
args: { children: "Extra Large Label", size: "xl" }
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const LargeLabel: Story = {
|
|
21
|
+
args: { children: "Large Label", size: "lg" }
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const MediumLabel: Story = {
|
|
25
|
+
args: { children: "Medium Label", size: "md" }
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const SmallLabel: Story = {
|
|
29
|
+
args: { children: "Small Label", size: "sm" }
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const ExtraSmallLabel: Story = {
|
|
33
|
+
args: { children: "Extra Small Label", size: "xs" }
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const LabelWithCustomStyle: Story = {
|
|
37
|
+
args: { children: "Label With Custom Style", className: "text-red-500" }
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default meta;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as cn } from "classnames";
|
|
2
|
+
|
|
3
|
+
type LabelAs = "span" | "p" | "label" | "strong" | "em";
|
|
4
|
+
type LabelSize = "xl" | "lg" | "md" | "sm" | "xs";
|
|
5
|
+
|
|
6
|
+
export interface LabelProps {
|
|
7
|
+
as?: LabelAs;
|
|
8
|
+
size?: LabelSize;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const labelStyles: Record<LabelSize, string> = {
|
|
14
|
+
xl: "text-lg tracking[-0.36px]",
|
|
15
|
+
lg: "text-base tracking[-0.32px]",
|
|
16
|
+
md: "text-sm tracking[-0.28px]",
|
|
17
|
+
sm: "text-xs tracking[-0.24px]",
|
|
18
|
+
xs: "text-[10px] leading-[14px] tracking[-0.2px]"
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default function Label({ as = "span", size = "md", children, className }: LabelProps) {
|
|
22
|
+
const Tag = as;
|
|
23
|
+
|
|
24
|
+
return <Tag className={cn("gray-900 font-medium", labelStyles[size], className)}>{children}</Tag>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Paragraph from "./Paragraph";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Paragraph> = {
|
|
5
|
+
title: "Design System/atoms/Typography/Paragraph",
|
|
6
|
+
component: Paragraph,
|
|
7
|
+
tags: ["autodocs"]
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof Paragraph>;
|
|
11
|
+
|
|
12
|
+
export const DefaultParagraph: Story = {
|
|
13
|
+
args: { children: "Default Paragraph" }
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const LargeParagraph: Story = {
|
|
17
|
+
args: { children: "Large Paragraph", size: "lg" }
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const MediumParagraph: Story = {
|
|
21
|
+
args: { children: "Medium Paragraph", size: "md" }
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const SmallParagraph: Story = {
|
|
25
|
+
args: { children: "Small Paragraph", size: "sm" }
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const ExtraSmallParagraph: Story = {
|
|
29
|
+
args: { children: "Extra Small Paragraph", size: "xs" }
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const ParagraphWithCustomStyle: Story = {
|
|
33
|
+
args: { children: "Paragraph With Custom Style", className: "text-red-500" }
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default meta;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as cn } from "classnames";
|
|
2
|
+
|
|
3
|
+
type ParagraphAs = "span" | "p" | "label" | "strong" | "em";
|
|
4
|
+
type ParagraphSize = "lg" | "md" | "sm" | "xs";
|
|
5
|
+
|
|
6
|
+
export interface ParagraphProps {
|
|
7
|
+
as?: ParagraphAs;
|
|
8
|
+
size?: ParagraphSize;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const paragraphStyles: Record<ParagraphSize, string> = {
|
|
14
|
+
lg: "text-lg",
|
|
15
|
+
md: "text-base",
|
|
16
|
+
sm: "text-sm",
|
|
17
|
+
xs: "text-xs leading-[20px]"
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default function Paragraph({ as = "p", size = "md", children, className }: ParagraphProps) {
|
|
21
|
+
const Tag = as;
|
|
22
|
+
|
|
23
|
+
return <Tag className={cn("gray-900 font-normal", paragraphStyles[size], className)}>{children}</Tag>;
|
|
24
|
+
}
|