@agility/plenum-ui 2.2.1 → 2.2.3

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
@@ -1180,10 +1180,6 @@ select {
1180
1180
  top: 24rem;
1181
1181
  }
1182
1182
 
1183
- .top-\[10px\] {
1184
- top: 10px;
1185
- }
1186
-
1187
1183
  .top-\[1px\] {
1188
1184
  top: 1px;
1189
1185
  }
@@ -1204,10 +1200,6 @@ select {
1204
1200
  z-index: 40;
1205
1201
  }
1206
1202
 
1207
- .z-\[2\] {
1208
- z-index: 2;
1209
- }
1210
-
1211
1203
  .z-\[99999\] {
1212
1204
  z-index: 99999;
1213
1205
  }
@@ -1841,10 +1833,6 @@ select {
1841
1833
  margin-top: 0.5rem;
1842
1834
  }
1843
1835
 
1844
- .mt-3 {
1845
- margin-top: 0.75rem;
1846
- }
1847
-
1848
1836
  .line-clamp-1 {
1849
1837
  overflow: hidden;
1850
1838
  display: -webkit-box;
@@ -3300,11 +3288,6 @@ select {
3300
3288
  border-color: rgb(156 163 175 / var(--tw-border-opacity, 1)) !important;
3301
3289
  }
3302
3290
 
3303
- .\!border-purple-500 {
3304
- --tw-border-opacity: 1 !important;
3305
- border-color: rgb(121 51 221 / var(--tw-border-opacity, 1)) !important;
3306
- }
3307
-
3308
3291
  .\!border-red-500 {
3309
3292
  --tw-border-opacity: 1 !important;
3310
3293
  border-color: rgb(239 68 68 / var(--tw-border-opacity, 1)) !important;
@@ -3315,6 +3298,11 @@ select {
3315
3298
  border-color: rgb(220 38 38 / var(--tw-border-opacity, 1)) !important;
3316
3299
  }
3317
3300
 
3301
+ .\!border-violet-700 {
3302
+ --tw-border-opacity: 1 !important;
3303
+ border-color: rgb(109 40 217 / var(--tw-border-opacity, 1)) !important;
3304
+ }
3305
+
3318
3306
  .border-blue-100 {
3319
3307
  --tw-border-opacity: 1;
3320
3308
  border-color: rgb(219 234 254 / var(--tw-border-opacity, 1));
@@ -67947,10 +67935,6 @@ select {
67947
67935
  text-align: left;
67948
67936
  }
67949
67937
 
67950
- .text-center {
67951
- text-align: center;
67952
- }
67953
-
67954
67938
  .font-sans {
67955
67939
  font-family: TTInterphasesPro, sans-serif;
67956
67940
  }
@@ -68078,20 +68062,16 @@ select {
68078
68062
  text-transform: uppercase;
68079
68063
  }
68080
68064
 
68081
- .leading-4 {
68082
- line-height: 1rem;
68083
- }
68084
-
68085
68065
  .leading-5 {
68086
68066
  line-height: 1.25rem;
68087
68067
  }
68088
68068
 
68089
- .leading-\[14px\] {
68090
- line-height: 14px;
68069
+ .leading-\[12px\] {
68070
+ line-height: 12px;
68091
68071
  }
68092
68072
 
68093
- .leading-\[20px\] {
68094
- line-height: 20px;
68073
+ .leading-\[14px\] {
68074
+ line-height: 14px;
68095
68075
  }
68096
68076
 
68097
68077
  .leading-\[28px\] {
@@ -78921,11 +78901,6 @@ select {
78921
78901
  --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity, 1)) !important;
78922
78902
  }
78923
78903
 
78924
- .\!ring-purple-500 {
78925
- --tw-ring-opacity: 1 !important;
78926
- --tw-ring-color: rgb(121 51 221 / var(--tw-ring-opacity, 1)) !important;
78927
- }
78928
-
78929
78904
  .ring-black {
78930
78905
  --tw-ring-opacity: 1;
78931
78906
  --tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity, 1));
@@ -78990,14 +78965,14 @@ select {
78990
78965
  transition-duration: 150ms;
78991
78966
  }
78992
78967
 
78993
- .placeholder\:text-gray-300::-moz-placeholder {
78968
+ .placeholder\:text-gray-500::-moz-placeholder {
78994
78969
  --tw-text-opacity: 1;
78995
- color: rgb(209 213 219 / var(--tw-text-opacity, 1));
78970
+ color: rgb(107 114 128 / var(--tw-text-opacity, 1));
78996
78971
  }
78997
78972
 
78998
- .placeholder\:text-gray-300::placeholder {
78973
+ .placeholder\:text-gray-500::placeholder {
78999
78974
  --tw-text-opacity: 1;
79000
- color: rgb(209 213 219 / var(--tw-text-opacity, 1));
78975
+ color: rgb(107 114 128 / var(--tw-text-opacity, 1));
79001
78976
  }
79002
78977
 
79003
78978
  .focus-within\:z-10:focus-within {
@@ -79065,6 +79040,11 @@ select {
79065
79040
  border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));
79066
79041
  }
79067
79042
 
79043
+ .hover\:border-gray-500:hover {
79044
+ --tw-border-opacity: 1;
79045
+ border-color: rgb(107 114 128 / var(--tw-border-opacity, 1));
79046
+ }
79047
+
79068
79048
  .hover\:border-purple-500:hover {
79069
79049
  --tw-border-opacity: 1;
79070
79050
  border-color: rgb(121 51 221 / var(--tw-border-opacity, 1));
@@ -79173,9 +79153,9 @@ select {
79173
79153
  border-color: rgb(121 51 221 / var(--tw-border-opacity, 1));
79174
79154
  }
79175
79155
 
79176
- .focus\:border-purple-600:focus {
79156
+ .focus\:border-violet-700:focus {
79177
79157
  --tw-border-opacity: 1;
79178
- border-color: rgb(105 26 216 / var(--tw-border-opacity, 1));
79158
+ border-color: rgb(109 40 217 / var(--tw-border-opacity, 1));
79179
79159
  }
79180
79160
 
79181
79161
  .focus\:bg-purple-100:focus {
@@ -79193,6 +79173,12 @@ select {
79193
79173
  outline-offset: 2px;
79194
79174
  }
79195
79175
 
79176
+ .focus\:ring-0:focus {
79177
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
79178
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
79179
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
79180
+ }
79181
+
79196
79182
  .focus\:ring-1:focus {
79197
79183
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
79198
79184
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
@@ -79215,11 +79201,6 @@ select {
79215
79201
  --tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity, 1)) !important;
79216
79202
  }
79217
79203
 
79218
- .focus\:\!ring-purple-500:focus {
79219
- --tw-ring-opacity: 1 !important;
79220
- --tw-ring-color: rgb(121 51 221 / var(--tw-ring-opacity, 1)) !important;
79221
- }
79222
-
79223
79204
  .focus\:\!ring-red-500:focus {
79224
79205
  --tw-ring-opacity: 1 !important;
79225
79206
  --tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1)) !important;
@@ -5,6 +5,7 @@ export interface LabelProps {
5
5
  size?: LabelSize;
6
6
  children: React.ReactNode;
7
7
  className?: string;
8
+ htmlFor?: string;
8
9
  }
9
- export default function Label({ as, size, children, className }: LabelProps): import("react/jsx-runtime").JSX.Element;
10
+ export default function Label({ as, size, children, className, htmlFor }: LabelProps): import("react/jsx-runtime").JSX.Element;
10
11
  export {};
@@ -1,5 +1,5 @@
1
1
  type ParagraphAs = "span" | "p" | "label" | "strong" | "em";
2
- type ParagraphSize = "lg" | "md" | "sm" | "xs";
2
+ type ParagraphSize = "xl" | "lg" | "md" | "sm" | "xs";
3
3
  export interface ParagraphProps {
4
4
  as?: ParagraphAs;
5
5
  size?: ParagraphSize;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agility/plenum-ui",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -8,6 +8,7 @@ export interface LabelProps {
8
8
  size?: LabelSize;
9
9
  children: React.ReactNode;
10
10
  className?: string;
11
+ htmlFor?: string;
11
12
  }
12
13
 
13
14
  const labelStyles: Record<LabelSize, string> = {
@@ -18,8 +19,12 @@ const labelStyles: Record<LabelSize, string> = {
18
19
  xs: "text-[10px] leading-[14px] tracking[-0.2px]"
19
20
  };
20
21
 
21
- export default function Label({ as = "span", size = "md", children, className }: LabelProps) {
22
+ export default function Label({ as = "span", size = "md", children, className, htmlFor = "" }: LabelProps) {
22
23
  const Tag = as;
23
24
 
24
- return <Tag className={cn("gray-900 font-medium", labelStyles[size], className)}>{children}</Tag>;
25
+ return (
26
+ <Tag htmlFor={htmlFor} className={cn("gray-900 font-normal", labelStyles[size], className)}>
27
+ {children}
28
+ </Tag>
29
+ );
25
30
  }
@@ -1,7 +1,7 @@
1
1
  import { default as cn } from "classnames";
2
2
 
3
3
  type ParagraphAs = "span" | "p" | "label" | "strong" | "em";
4
- type ParagraphSize = "lg" | "md" | "sm" | "xs";
4
+ type ParagraphSize = "xl" | "lg" | "md" | "sm" | "xs";
5
5
 
6
6
  export interface ParagraphProps {
7
7
  as?: ParagraphAs;
@@ -11,10 +11,11 @@ export interface ParagraphProps {
11
11
  }
12
12
 
13
13
  const paragraphStyles: Record<ParagraphSize, string> = {
14
- lg: "text-lg",
15
- md: "text-base",
16
- sm: "text-sm",
17
- xs: "text-xs leading-[20px]"
14
+ xl: "text-lg",
15
+ lg: "text-base",
16
+ md: "text-sm",
17
+ sm: "text-xs",
18
+ xs: "text-[10px] leading-[12px]"
18
19
  };
19
20
 
20
21
  export default function Paragraph({ as = "p", size = "md", children, className }: ParagraphProps) {
@@ -1,4 +1,5 @@
1
1
  import { FC } from "react";
2
+ import Paragraph from "../../../atoms/Typography/Paragraph/Paragraph";
2
3
 
3
4
  export interface IInputCounterProps {
4
5
  /** Counter limit */
@@ -9,16 +10,11 @@ export interface IInputCounterProps {
9
10
 
10
11
  /** Primary UI component for user interaction */
11
12
  const InputCounter: FC<IInputCounterProps> = ({ current = 0, limit }) => {
13
+ if (!limit) return null;
12
14
  return (
13
- <div className="mt-3 text-center text-xs leading-4 text-gray-500 flex gap-1">
14
- <div className="currentCount">{current ?? 0}</div>
15
- {(limit || 0) > 0 && (
16
- <>
17
- <div>/</div>
18
- <div className="limitCount">{limit}</div>
19
- </>
20
- )}
21
- </div>
15
+ <Paragraph size="md" className="text-gray-500">
16
+ {current ?? 0} / {limit}
17
+ </Paragraph>
22
18
  );
23
19
  };
24
20
  export default InputCounter;
@@ -1,5 +1,5 @@
1
- import React, { forwardRef } from "react"
2
- import { default as cn } from "classnames"
1
+ import React, { forwardRef } from "react";
2
+ import { default as cn } from "classnames";
3
3
 
4
4
  export type AcceptedInputTypes =
5
5
  | "date"
@@ -13,33 +13,33 @@ export type AcceptedInputTypes =
13
13
  | "tel"
14
14
  | "text"
15
15
  | "url"
16
- | "currency"
16
+ | "currency";
17
17
 
18
18
  export interface IInputFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange"> {
19
19
  /** Callback on change */
20
- handleChange: (value: string) => void
20
+ handleChange: (value: string) => void;
21
21
  /** Input ID*/
22
- id?: string
22
+ id?: string;
23
23
  /** Input Name */
24
- name?: string
24
+ name?: string;
25
25
  /** Force the focus state on the input */
26
- isFocused?: boolean
26
+ isFocused?: boolean;
27
27
  /** Error condition */
28
- isError?: boolean
28
+ isError?: boolean;
29
29
  /** Disabled state */
30
- isDisabled?: boolean
30
+ isDisabled?: boolean;
31
31
  /** Readonly state */
32
- isReadonly?: boolean
32
+ isReadonly?: boolean;
33
33
  /** Input value */
34
- value: string
34
+ value: string;
35
35
  /** Type of Text Input to Render eg. "text", "email" */
36
- type: AcceptedInputTypes
36
+ type: AcceptedInputTypes;
37
37
  /** If field is required */
38
- required?: boolean
38
+ required?: boolean;
39
39
  /** use input psuedo classes for :valid and :invalid styles. on by default */
40
- clientSideCheck?: boolean
40
+ clientSideCheck?: boolean;
41
41
  /** Placeholder text */
42
- placeholder?: string
42
+ placeholder?: string;
43
43
  /**ref for input */
44
44
  }
45
45
 
@@ -71,7 +71,7 @@ const InputField = (
71
71
  name,
72
72
  value,
73
73
  onChange: (e) => {
74
- if (handleChange) handleChange(e.target.value)
74
+ if (handleChange) handleChange(e.target.value);
75
75
  },
76
76
  autoFocus: isFocused,
77
77
  readOnly: isReadonly,
@@ -81,7 +81,7 @@ const InputField = (
81
81
  "aria-invalid": isError,
82
82
  "aria-disabled": isDisabled,
83
83
  className: cn(
84
- "peer w-full rounded border border-gray-300 px-3 text-sm font-normal leading-5 outline-offset-0 ring-offset-0 focus:border-purple-600 focus:ring-purple-600 ",
84
+ "peer w-full rounded border border-gray-300 px-3 text-sm font-normal leading-5 outline-offset-0 ring-offset-0 focus:border-violet-700 focus:ring-0 ",
85
85
  isError ? "!border-red-600 !text-red-600 focus:!ring-red-600" : "",
86
86
  isReadonly ? "!border-gray-400 !text-gray-500 focus:!ring-gray-400" : "",
87
87
  className
@@ -89,8 +89,8 @@ const InputField = (
89
89
  ...rest
90
90
  }}
91
91
  />
92
- )
93
- }
92
+ );
93
+ };
94
94
 
95
- const _InputField = forwardRef<HTMLInputElement, IInputFieldProps>(InputField)
96
- export default _InputField
95
+ const _InputField = forwardRef<HTMLInputElement, IInputFieldProps>(InputField);
96
+ export default _InputField;
@@ -3,6 +3,7 @@
3
3
  //@ts-ignore
4
4
  import React, { FC } from "react";
5
5
  import { default as cn } from "classnames";
6
+ import Label from "../../../atoms/Typography/Label/Label";
6
7
 
7
8
  export interface IInputLabelProps {
8
9
  /** Prop comment */
@@ -26,33 +27,27 @@ const InputLabel: FC<IInputLabelProps> = ({
26
27
  isRequired,
27
28
  isDisabled,
28
29
  isActive,
29
- isError,
30
30
  label,
31
31
  truncateLabel = false,
32
32
  fullWidthLabel = false,
33
33
  noMarginBottom = false
34
34
  }: IInputLabelProps) => {
35
35
  const labelStyles = cn(
36
- "z-[2] inline-flex gap-1",
37
- { "inline-block ml-2 relative transition-all": isPlaceholder },
38
- { "text-sm text-gray-400 px-2 top-8": isPlaceholder && !isActive },
39
- { "text-xs text-gray-700 px-1 top-[10px] bg-white": isPlaceholder && isActive },
40
- { "text-xs text-red-500 px-1 top-[10px] bg-white": isPlaceholder && isError },
41
- { "text-red-500 bg-white": !isPlaceholder && isError },
36
+ "inline-flex gap-1 text-gray-700",
37
+ { "text-gray-400 top-8": !isActive },
38
+ { "text-gray-700 bg-white": isActive },
42
39
  { "text-gray-500/[.5]": isDisabled },
43
- { "inline-block transition-all text-sm text-gray-700": !isPlaceholder },
44
40
  { "block w-full": fullWidthLabel },
45
- { "mb-1": !noMarginBottom }
41
+ { "mb-1": !noMarginBottom },
42
+ { "break-all line-clamp-1": truncateLabel }
46
43
  );
47
44
 
48
45
  if (!label) return null;
49
46
  return (
50
- <label htmlFor={id} className={labelStyles}>
51
- <div className={truncateLabel ? "break-all line-clamp-1" : ""} title={label}>
52
- {label}
53
- </div>
54
- {isRequired && <span className="text-red-500"> *</span>}
55
- </label>
47
+ <Label as="label" size="md" className={labelStyles} htmlFor={id}>
48
+ {label}
49
+ {isRequired && <span className="text-red-600"> *</span>}
50
+ </Label>
56
51
  );
57
52
  };
58
53
 
@@ -3,6 +3,7 @@ import { default as cn } from "classnames";
3
3
  import InputLabel from "../InputLabel";
4
4
  import InputField, { AcceptedInputTypes } from "../InputField";
5
5
  import InputCounter from "../InputCounter";
6
+ import Paragraph from "../../../atoms/Typography/Paragraph/Paragraph";
6
7
 
7
8
  export interface ITextInputProps {
8
9
  /** Input type*/
@@ -118,15 +119,7 @@ const TextInput = (
118
119
 
119
120
  return (
120
121
  <div className="relative group">
121
- <InputLabel
122
- isPlaceholder={true}
123
- label={label}
124
- isRequired={isRequired}
125
- id={id}
126
- isError={isError}
127
- isActive={true}
128
- isDisabled={isDisabled}
129
- />
122
+ <InputLabel label={label} isRequired={isRequired} id={id} isActive={true} isDisabled={isDisabled} />
130
123
  <InputField
131
124
  onFocus={handleInputFocus}
132
125
  onBlur={handleInputBlur}
@@ -139,17 +132,16 @@ const TextInput = (
139
132
  name={name}
140
133
  id={id}
141
134
  className={cn(
142
- "w-full rounded border py-2 px-3 text-sm font-normal leading-5",
135
+ "w-full rounded border py-2 px-3 text-sm font-normal leading-5 hover:border-gray-500 placeholder:text-gray-500 ",
143
136
  { "border-gray-300": !isFocus && !isError && !isDisabled },
144
137
  {
145
- "!border-purple-500 shadow-none outline-purple-500 focus:!ring-purple-500":
146
- isFocus && !isError && !isDisabled
138
+ "!border-violet-700 shadow-none": isFocus && !isError && !isDisabled
147
139
  },
148
140
  {
149
141
  "!border-red-500 shadow-none focus:ring-red-500": isError
150
142
  },
151
143
  {
152
- "placeholder:text-gray-300 !border-gray-300 !outline-gray-300 focus:!ring-gray-300": isDisabled
144
+ "!border-gray-300 !outline-gray-300 focus:!ring-gray-300": isDisabled
153
145
  },
154
146
  className
155
147
  )}
@@ -164,9 +156,9 @@ const TextInput = (
164
156
  <div className="flex flex-row space-x-3">
165
157
  <div className="grow">
166
158
  {message && (
167
- <span className={cn("mt-1 block text-sm", isError ? "text-red-500" : "text-gray-500")}>
159
+ <Paragraph size="md" className={isError ? "text-red-600" : "text-gray-500"}>
168
160
  {message}
169
- </span>
161
+ </Paragraph>
170
162
  )}
171
163
  </div>
172
164
  {isShowCounter && (
@@ -102,15 +102,7 @@ const Combobox = <T extends Record<string, unknown>>({
102
102
  >
103
103
  {label && (
104
104
  <HeadlessUICombobox.Label className={labelStyles}>
105
- <InputLabel
106
- isPlaceholder
107
- isActive
108
- label={label}
109
- isRequired={isRequired}
110
- id={id}
111
- isError={isError}
112
- isDisabled={isDisabled}
113
- />
105
+ <InputLabel isActive label={label} isRequired={isRequired} id={id} isDisabled={isDisabled} />
114
106
  </HeadlessUICombobox.Label>
115
107
  )}
116
108
  <div className="relative">
@@ -62,17 +62,7 @@ const Select: React.FC<ISelectProps> = ({
62
62
  const wrapperStyle = cn("group", { "opacity-50": isDisabled });
63
63
  return (
64
64
  <div className={wrapperStyle}>
65
- {label && (
66
- <InputLabel
67
- isPlaceholder
68
- isActive
69
- label={label}
70
- isRequired={isRequired}
71
- id={id}
72
- isError={isError}
73
- isDisabled={isDisabled}
74
- />
75
- )}
65
+ {label && <InputLabel isActive label={label} isRequired={isRequired} id={id} isDisabled={isDisabled} />}
76
66
  <select
77
67
  id={id}
78
68
  name={name}
@@ -104,15 +104,7 @@ const Textarea: React.FC<ITextareaProps> = ({
104
104
  //with label
105
105
  return (
106
106
  <div className="group">
107
- <InputLabel
108
- isPlaceholder
109
- isActive
110
- label={label.display}
111
- isRequired={isRequired}
112
- id={id}
113
- isError={isError}
114
- isDisabled={isDisabled}
115
- />
107
+ <InputLabel isActive label={label.display} isRequired={isRequired} id={id} isDisabled={isDisabled} />
116
108
 
117
109
  <div>
118
110
  <textarea