@agility/plenum-ui 2.0.7 → 2.0.9

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/tailwind.css CHANGED
@@ -33199,6 +33199,10 @@ select {
33199
33199
  border-right-color: transparent;
33200
33200
  }
33201
33201
 
33202
+ .border-r-transparent-black-70 {
33203
+ border-right-color: rgba(0, 0, 0, 0.7);
33204
+ }
33205
+
33202
33206
  .border-r-violet-100 {
33203
33207
  --tw-border-opacity: 1;
33204
33208
  border-right-color: rgb(237 233 254 / var(--tw-border-opacity));
@@ -50150,6 +50154,10 @@ select {
50150
50154
  stroke-width: 1;
50151
50155
  }
50152
50156
 
50157
+ .stroke-\[1\.5\] {
50158
+ stroke-width: 1.5;
50159
+ }
50160
+
50153
50161
  .p-10 {
50154
50162
  padding: 2.5rem;
50155
50163
  }
@@ -57227,6 +57235,14 @@ select {
57227
57235
  color: rgb(19 78 74 / 0.95);
57228
57236
  }
57229
57237
 
57238
+ .text-transparent-black-40 {
57239
+ color: rgba(0, 0, 0, 0.4);
57240
+ }
57241
+
57242
+ .text-transparent-black-70 {
57243
+ color: rgba(0, 0, 0, 0.7);
57244
+ }
57245
+
57230
57246
  .text-violet-100 {
57231
57247
  --tw-text-opacity: 1;
57232
57248
  color: rgb(237 233 254 / var(--tw-text-opacity));
@@ -58630,6 +58646,11 @@ select {
58630
58646
  --tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity));
58631
58647
  }
58632
58648
 
58649
+ .ring-yellow-500 {
58650
+ --tw-ring-opacity: 1;
58651
+ --tw-ring-color: rgb(255 203 40 / var(--tw-ring-opacity));
58652
+ }
58653
+
58633
58654
  .ring-opacity-5 {
58634
58655
  --tw-ring-opacity: 0.05;
58635
58656
  }
@@ -58718,6 +58739,11 @@ select {
58718
58739
  --tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity)) !important;
58719
58740
  }
58720
58741
 
58742
+ .focus-within\:\!ring-yellow-500:focus-within {
58743
+ --tw-ring-opacity: 1 !important;
58744
+ --tw-ring-color: rgb(255 203 40 / var(--tw-ring-opacity)) !important;
58745
+ }
58746
+
58721
58747
  .focus-within\:ring-purple-600:focus-within {
58722
58748
  --tw-ring-opacity: 1;
58723
58749
  --tw-ring-color: rgb(105 26 216 / var(--tw-ring-opacity));
@@ -58799,6 +58825,11 @@ select {
58799
58825
  background-color: rgb(109 40 217 / var(--tw-bg-opacity));
58800
58826
  }
58801
58827
 
58828
+ .hover\:bg-yellow-700:hover {
58829
+ --tw-bg-opacity: 1;
58830
+ background-color: rgb(179 142 28 / var(--tw-bg-opacity));
58831
+ }
58832
+
58802
58833
  .hover\:text-gray-500:hover {
58803
58834
  --tw-text-opacity: 1;
58804
58835
  color: rgb(107 114 128 / var(--tw-text-opacity));
@@ -58895,6 +58926,11 @@ select {
58895
58926
  --tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity)) !important;
58896
58927
  }
58897
58928
 
58929
+ .focus\:\!ring-yellow-500:focus {
58930
+ --tw-ring-opacity: 1 !important;
58931
+ --tw-ring-color: rgb(255 203 40 / var(--tw-ring-opacity)) !important;
58932
+ }
58933
+
58898
58934
  .focus\:ring-purple-500:focus {
58899
58935
  --tw-ring-opacity: 1;
58900
58936
  --tw-ring-color: rgb(121 51 221 / var(--tw-ring-opacity));
@@ -58995,6 +59031,11 @@ select {
58995
59031
  --tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity)) !important;
58996
59032
  }
58997
59033
 
59034
+ .active\:\!ring-yellow-500:active {
59035
+ --tw-ring-opacity: 1 !important;
59036
+ --tw-ring-color: rgb(255 203 40 / var(--tw-ring-opacity)) !important;
59037
+ }
59038
+
58998
59039
  .active\:ring-purple-600:active {
58999
59040
  --tw-ring-opacity: 1;
59000
59041
  --tw-ring-color: rgb(105 26 216 / var(--tw-ring-opacity));
@@ -59039,6 +59080,16 @@ select {
59039
59080
  background-color: rgb(167 139 250 / var(--tw-bg-opacity));
59040
59081
  }
59041
59082
 
59083
+ .disabled\:bg-yellow-300:disabled {
59084
+ --tw-bg-opacity: 1;
59085
+ background-color: rgb(255 224 126 / var(--tw-bg-opacity));
59086
+ }
59087
+
59088
+ .disabled\:bg-yellow-400:disabled {
59089
+ --tw-bg-opacity: 1;
59090
+ background-color: rgb(255 213 83 / var(--tw-bg-opacity));
59091
+ }
59092
+
59042
59093
  .disabled\:text-gray-300:disabled {
59043
59094
  --tw-text-opacity: 1;
59044
59095
  color: rgb(209 213 219 / var(--tw-text-opacity));
@@ -59059,6 +59110,14 @@ select {
59059
59110
  color: rgb(188 153 238 / var(--tw-text-opacity));
59060
59111
  }
59061
59112
 
59113
+ .disabled\:text-transparent-black-30:disabled {
59114
+ color: rgba(0, 0, 0, 0.3);
59115
+ }
59116
+
59117
+ .disabled\:text-transparent-black-70:disabled {
59118
+ color: rgba(0, 0, 0, 0.7);
59119
+ }
59120
+
59062
59121
  .disabled\:text-white:disabled {
59063
59122
  --tw-text-opacity: 1;
59064
59123
  color: rgb(255 255 255 / var(--tw-text-opacity));
@@ -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";
3
+ export type BTNActionType = "primary" | "secondary" | "alternative" | "danger" | "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 Warning: Story;
7
+ export declare const WarningDisabled: Story;
8
+ export declare const WarningTrailingIcon: Story;
9
+ export declare const WarningLeadingIcon: Story;
10
+ export declare const WarningSimpleIconName: Story;
11
+ export declare const WarningExtraSmall: Story;
12
+ export declare const WarningSmall: Story;
13
+ export declare const WarningMedium: Story;
14
+ export declare const WarningLarge: Story;
15
+ export declare const WarningExtraLarge: Story;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agility/plenum-ui",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -5,7 +5,7 @@ import { DynamicIcon, UnifiedIconName, IDynamicIconProps } from "../../icons"
5
5
 
6
6
  // import Loader from "../loaders/loader/Loader"
7
7
 
8
- export type BTNActionType = "primary" | "secondary" | "alternative" | "danger"
8
+ export type BTNActionType = "primary" | "secondary" | "alternative" | "danger" | "warning"
9
9
 
10
10
  export interface IButtonProps
11
11
  extends Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> {
@@ -55,15 +55,17 @@ const _Button = (
55
55
  ref: React.LegacyRef<HTMLButtonElement>
56
56
  ) => {
57
57
  const iconStyles = cn(
58
- { "text-white h-5 w-5": actionType === "primary" || actionType === "danger" },
59
- { "text-purple-700 h-5 w-5 ": actionType === "secondary" },
60
- { "text-gray-400 h-5 w-5": actionType === "alternative" }
58
+ { "text-white h-5 w-5 stroke-[1.5]": actionType === "primary" || actionType === "danger" },
59
+ { "text-purple-700 h-5 w-5 stroke-[1.5]": actionType === "secondary" },
60
+ { "text-gray-400 h-5 w-5 stroke-[1.5]": actionType === "alternative" },
61
+ { "text-transparent-black-40 h-5 w-5 stroke-[1.5]": actionType === "warning" }
61
62
  )
62
63
  const loaderColors = cn(
63
64
  { "border-r-white": actionType === "primary" },
64
65
  { "border-purple-200 border-r-purple-700": actionType === "secondary" },
65
66
  { "border-gray-200 border-r-gray-700": actionType === "alternative" },
66
- { "border-red-800 border-r-white": actionType === "danger" }
67
+ { "border-red-800 border-r-white": actionType === "danger" },
68
+ { "border-yellow-800 border-r-transparent-black-70": actionType === "warning" }
67
69
  )
68
70
  const loaderSize = cn({ "h-4 w-4": size === "sm" }, { "h-5 w-5": size === "md" }, { "h-6 w-6 ": size === "lg" })
69
71
 
@@ -98,6 +100,10 @@ const _Button = (
98
100
  " bg-red-600 text-white hover:bg-red-700 <focus-visible:!></focus-visible:!>ring-red-500 focus:!ring-red-500 active:!ring-red-500 focus-within:!ring-red-500 disabled:bg-red-400 disabled:text-gray-50 disabled:focus-visible:ring-0":
99
101
  actionType === "danger"
100
102
  },
103
+ {
104
+ " bg-yellow-500 text-transparent-black-70 hover:bg-yellow-700 <focus-visible:!></focus-visible:!>ring-yellow-500 focus:!ring-yellow-500 active:!ring-yellow-500 focus-within:!ring-yellow-500 disabled:bg-yellow-400 disabled:text-transparent-black-70 disabled:focus-visible:ring-0":
105
+ actionType === "warning"
106
+ },
101
107
  className ? className : ""
102
108
  ),
103
109
  onClick: props.onClick
@@ -159,7 +165,7 @@ const _Button = (
159
165
  { "px-[17px] py-[9px] text-base": size === "lg" },
160
166
  { "px-[25px] py-[13px] text-base": size === "xl" },
161
167
  {
162
- "bg-violet-800 text-violet-100 hover:border-violet-700 hover:bg-violet-700 disabled:bg-violet-400 disabled:focus-visible:ring-0":
168
+ "bg-violet-800 text-white hover:border-violet-700 hover:bg-violet-700 disabled:bg-violet-400 disabled:focus-visible:ring-0":
163
169
  actionType === "primary"
164
170
  },
165
171
  {
@@ -174,6 +180,10 @@ const _Button = (
174
180
  " bg-red-600 text-white hover:bg-red-700 <focus-visible:!></focus-visible:!>ring-red-500 focus:!ring-red-500 active:!ring-red-500 focus-within:!ring-red-500 disabled:bg-red-400 disabled:text-gray-50 disabled:focus-visible:ring-0":
175
181
  actionType === "danger"
176
182
  },
183
+ {
184
+ " bg-yellow-500 text-transparent-black-70 hover:bg-yellow-700 <focus-visible:!></focus-visible:!>ring-yellow-500 focus:!ring-yellow-500 active:!ring-yellow-500 focus-within:!ring-yellow-500 disabled:bg-yellow-300 disabled:text-transparent-black-30 disabled:focus-visible:ring-0":
185
+ actionType === "warning"
186
+ },
177
187
  className ? className : ""
178
188
  )}
179
189
  ref={ref}
@@ -0,0 +1,90 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import Button from "../Button"
3
+ import { defaultIcon } from "../defaultArgs"
4
+
5
+ // More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
6
+ const meta: Meta<typeof Button> = {
7
+ title: "Design System/atoms/Buttons/Button/Warning",
8
+ component: Button,
9
+ tags: ["autodocs"],
10
+ argTypes: {}
11
+ }
12
+
13
+ export default meta
14
+ type Story = StoryObj<typeof Button>
15
+ // #region Warning Button Stories
16
+ export const Warning: Story = {
17
+ args: {
18
+ actionType: "warning",
19
+ label: "Warning Zone!",
20
+ onClick: () => {
21
+ window.alert("Button clicked!")
22
+ }
23
+ }
24
+ }
25
+
26
+ export const WarningDisabled: Story = {
27
+ args: {
28
+ actionType: "warning",
29
+ label: "Warning Zone!",
30
+ disabled: true,
31
+ onClick: () => {
32
+ window.alert("Button clicked!")
33
+ }
34
+ }
35
+ }
36
+
37
+ export const WarningTrailingIcon: Story = {
38
+ args: {
39
+ ...Warning.args,
40
+ icon: {
41
+ ...defaultIcon,
42
+ icon: "IconTrash"
43
+ },
44
+ iconPosition: "trailing"
45
+ }
46
+ }
47
+ export const WarningLeadingIcon: Story = {
48
+ args: {
49
+ ...WarningTrailingIcon.args,
50
+ iconPosition: "leading"
51
+ }
52
+ }
53
+ export const WarningSimpleIconName: Story = {
54
+ args: {
55
+ ...Warning.args,
56
+ icon: "IconTrash",
57
+ iconPosition: "leading"
58
+ }
59
+ }
60
+ export const WarningExtraSmall: Story = {
61
+ args: {
62
+ ...Warning.args,
63
+ size: "sm"
64
+ }
65
+ }
66
+ export const WarningSmall: Story = {
67
+ args: {
68
+ ...Warning.args,
69
+ size: "sm"
70
+ }
71
+ }
72
+ export const WarningMedium: Story = {
73
+ args: {
74
+ ...Warning.args,
75
+ size: "md"
76
+ }
77
+ }
78
+ export const WarningLarge: Story = {
79
+ args: {
80
+ ...Warning.args,
81
+ size: "lg"
82
+ }
83
+ }
84
+ export const WarningExtraLarge: Story = {
85
+ args: {
86
+ ...Warning.args,
87
+ size: "xl"
88
+ }
89
+ }
90
+ // #endregion