@agility/plenum-ui 2.0.0-rc4 → 2.0.0-rc5
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 +1 -1
- package/dist/index.d.ts +70 -2
- package/dist/index.js +190 -67
- package/dist/index.js.map +4 -4
- package/dist/lib/tailwind.css +63510 -0
- package/dist/types/stories/molecules/inputs/InputCounter/InputCounter.d.ts +10 -0
- package/dist/types/stories/molecules/inputs/InputCounter/index.d.ts +2 -0
- package/dist/types/stories/molecules/inputs/TextInput/TextInput.d.ts +39 -0
- package/dist/types/stories/molecules/inputs/TextInput/index.d.ts +4 -0
- package/dist/types/stories/molecules/inputs/index.d.ts +3 -2
- package/package.json +2 -2
- package/stories/Introduction.mdx +1 -1
- package/stories/molecules/inputs/TextInput/index.tsx +4 -2
- package/stories/molecules/inputs/index.ts +14 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ In your app entry point (i.e. \`_app.tsx\`), import the \`globals.css\` file fro
|
|
|
27
27
|
|
|
28
28
|
```jsx
|
|
29
29
|
import "<RELATIVE_PATH>/globals.css";
|
|
30
|
-
import "@agility/plenum-ui/lib/tailwind.css";
|
|
30
|
+
import "@agility/plenum-ui/dist/lib/tailwind.css";
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
Make sure to add any additional styles before these two import statements to prevent overwriting the Plenum styling.
|
package/dist/index.d.ts
CHANGED
|
@@ -415,6 +415,24 @@ declare module '@agility/plenum-ui/stories/molecules/index' {
|
|
|
415
415
|
export type { ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps, ITextAreaFieldProps, IToggleSwitchProps, AcceptedInputTypes };
|
|
416
416
|
export { Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, TextAreaField, ToggleSwitch };
|
|
417
417
|
|
|
418
|
+
}
|
|
419
|
+
declare module '@agility/plenum-ui/stories/molecules/inputs/InputCounter/InputCounter' {
|
|
420
|
+
import { FC } from "react";
|
|
421
|
+
export interface IInputCounterProps {
|
|
422
|
+
/** Counter limit */
|
|
423
|
+
limit: number | undefined;
|
|
424
|
+
/** Counter current number */
|
|
425
|
+
current: number;
|
|
426
|
+
}
|
|
427
|
+
/** Primary UI component for user interaction */
|
|
428
|
+
const InputCounter: FC<IInputCounterProps>;
|
|
429
|
+
export default InputCounter;
|
|
430
|
+
|
|
431
|
+
}
|
|
432
|
+
declare module '@agility/plenum-ui/stories/molecules/inputs/InputCounter/index' {
|
|
433
|
+
export { default } from '@agility/plenum-ui/stories/molecules/inputs/InputCounter/InputCounter';
|
|
434
|
+
export * from '@agility/plenum-ui/stories/molecules/inputs/InputCounter/InputCounter';
|
|
435
|
+
|
|
418
436
|
}
|
|
419
437
|
declare module '@agility/plenum-ui/stories/molecules/inputs/InputField/InputField' {
|
|
420
438
|
import React from "react";
|
|
@@ -504,6 +522,55 @@ declare module '@agility/plenum-ui/stories/molecules/inputs/NestedInputButton/in
|
|
|
504
522
|
export type { INestedInputButtonProps };
|
|
505
523
|
export default NestedInputButton;
|
|
506
524
|
|
|
525
|
+
}
|
|
526
|
+
declare module '@agility/plenum-ui/stories/molecules/inputs/TextInput/TextInput' {
|
|
527
|
+
import React from "react";
|
|
528
|
+
import { AcceptedInputTypes } from "@agility/plenum-ui/stories/molecules/inputs/InputField/index";
|
|
529
|
+
export interface ITextInputProps {
|
|
530
|
+
/** Input type*/
|
|
531
|
+
type: AcceptedInputTypes;
|
|
532
|
+
/** Input ID */
|
|
533
|
+
id?: string;
|
|
534
|
+
/** Input Name */
|
|
535
|
+
name?: string;
|
|
536
|
+
/** Label for the input */
|
|
537
|
+
label?: string;
|
|
538
|
+
/** Force the focus state on the input */
|
|
539
|
+
isFocused?: boolean;
|
|
540
|
+
/** Error state */
|
|
541
|
+
isError?: boolean;
|
|
542
|
+
/** If field is required */
|
|
543
|
+
isRequired?: boolean;
|
|
544
|
+
/** Disabled state */
|
|
545
|
+
isDisabled?: boolean;
|
|
546
|
+
/** Readonly state */
|
|
547
|
+
isReadonly?: boolean;
|
|
548
|
+
/** Set default value */
|
|
549
|
+
defaultValue?: string;
|
|
550
|
+
/** Message shown under the text field */
|
|
551
|
+
message?: string;
|
|
552
|
+
/** Input character counter */
|
|
553
|
+
isShowCounter?: boolean;
|
|
554
|
+
/** Max length of input character */
|
|
555
|
+
maxLength?: number;
|
|
556
|
+
/** Callback on change */
|
|
557
|
+
onChange(value: string): void;
|
|
558
|
+
/** input value */
|
|
559
|
+
value: string;
|
|
560
|
+
/**Placeholder input text*/
|
|
561
|
+
placeholder?: string;
|
|
562
|
+
className?: string;
|
|
563
|
+
}
|
|
564
|
+
const _TextInput: React.ForwardRefExoticComponent<ITextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
565
|
+
export default _TextInput;
|
|
566
|
+
|
|
567
|
+
}
|
|
568
|
+
declare module '@agility/plenum-ui/stories/molecules/inputs/TextInput/index' {
|
|
569
|
+
import TextInput from "@agility/plenum-ui/stories/molecules/inputs/TextInput/TextInput";
|
|
570
|
+
import { ITextInputProps } from "@agility/plenum-ui/stories/molecules/inputs/TextInput/TextInput";
|
|
571
|
+
export type { ITextInputProps };
|
|
572
|
+
export default TextInput;
|
|
573
|
+
|
|
507
574
|
}
|
|
508
575
|
declare module '@agility/plenum-ui/stories/molecules/inputs/checkbox/Checkbox' {
|
|
509
576
|
import { FC } from "react";
|
|
@@ -612,9 +679,10 @@ declare module '@agility/plenum-ui/stories/molecules/inputs/index' {
|
|
|
612
679
|
import Radio, { IRadioProps } from "@agility/plenum-ui/stories/molecules/inputs/radio/index";
|
|
613
680
|
import Select, { ISelectProps } from "@agility/plenum-ui/stories/molecules/inputs/select/index";
|
|
614
681
|
import TextAreaField, { ITextAreaFieldProps } from "@agility/plenum-ui/stories/molecules/inputs/textArea/index";
|
|
682
|
+
import TextInput, { ITextInputProps } from "@agility/plenum-ui/stories/molecules/inputs/TextInput/index";
|
|
615
683
|
import ToggleSwitch, { IToggleSwitchProps } from "@agility/plenum-ui/stories/molecules/inputs/toggleSwitch/index";
|
|
616
|
-
export type { ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps, ITextAreaFieldProps, IToggleSwitchProps, AcceptedInputTypes };
|
|
617
|
-
export { Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, TextAreaField, ToggleSwitch };
|
|
684
|
+
export type { ICheckboxProps, IComboboxProps, IInputFieldProps, IInputLabelProps, INestedInputButtonProps, IRadioProps, ISelectProps, ITextAreaFieldProps, ITextInputProps, IToggleSwitchProps, AcceptedInputTypes };
|
|
685
|
+
export { Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, TextAreaField, ToggleSwitch, TextInput };
|
|
618
686
|
|
|
619
687
|
}
|
|
620
688
|
declare module '@agility/plenum-ui/stories/molecules/inputs/radio/Radio' {
|
package/dist/index.js
CHANGED
|
@@ -5427,9 +5427,132 @@ var TextArea_default = TextAreaField;
|
|
|
5427
5427
|
// stories/molecules/inputs/textArea/index.ts
|
|
5428
5428
|
var textArea_default = TextArea_default;
|
|
5429
5429
|
|
|
5430
|
-
// stories/molecules/inputs/
|
|
5431
|
-
import
|
|
5430
|
+
// stories/molecules/inputs/TextInput/TextInput.tsx
|
|
5431
|
+
import React16, { forwardRef, useEffect as useEffect3, useId as useId2, useRef, useState as useState4 } from "react";
|
|
5432
5432
|
import { default as cn17 } from "classnames";
|
|
5433
|
+
|
|
5434
|
+
// stories/molecules/inputs/InputCounter/InputCounter.tsx
|
|
5435
|
+
import React15 from "react";
|
|
5436
|
+
var InputCounter = ({ current = 0, limit }) => {
|
|
5437
|
+
return /* @__PURE__ */ React15.createElement("div", { className: "mt-1 text-center text-sm text-gray-500 flex gap-1" }, /* @__PURE__ */ React15.createElement("div", { className: "currentCount" }, current), (limit || 0) > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("div", null, "/"), /* @__PURE__ */ React15.createElement("div", { className: "limitCount" }, limit)));
|
|
5438
|
+
};
|
|
5439
|
+
var InputCounter_default = InputCounter;
|
|
5440
|
+
|
|
5441
|
+
// stories/molecules/inputs/TextInput/TextInput.tsx
|
|
5442
|
+
var TextInput = (_a, ref) => {
|
|
5443
|
+
var _b = _a, {
|
|
5444
|
+
label,
|
|
5445
|
+
isFocused,
|
|
5446
|
+
isError,
|
|
5447
|
+
id: id2,
|
|
5448
|
+
name,
|
|
5449
|
+
isRequired,
|
|
5450
|
+
type,
|
|
5451
|
+
defaultValue,
|
|
5452
|
+
isDisabled,
|
|
5453
|
+
isReadonly,
|
|
5454
|
+
message,
|
|
5455
|
+
isShowCounter,
|
|
5456
|
+
maxLength,
|
|
5457
|
+
onChange,
|
|
5458
|
+
placeholder,
|
|
5459
|
+
value: externalValue,
|
|
5460
|
+
className
|
|
5461
|
+
} = _b, props = __objRest(_b, [
|
|
5462
|
+
"label",
|
|
5463
|
+
"isFocused",
|
|
5464
|
+
"isError",
|
|
5465
|
+
"id",
|
|
5466
|
+
"name",
|
|
5467
|
+
"isRequired",
|
|
5468
|
+
"type",
|
|
5469
|
+
"defaultValue",
|
|
5470
|
+
"isDisabled",
|
|
5471
|
+
"isReadonly",
|
|
5472
|
+
"message",
|
|
5473
|
+
"isShowCounter",
|
|
5474
|
+
"maxLength",
|
|
5475
|
+
"onChange",
|
|
5476
|
+
"placeholder",
|
|
5477
|
+
"value",
|
|
5478
|
+
"className"
|
|
5479
|
+
]);
|
|
5480
|
+
const uniqueID = useId2();
|
|
5481
|
+
const [isFocus, setIsFocus] = useState4(Boolean(isFocused));
|
|
5482
|
+
const [value, setValue] = useState4(externalValue || defaultValue || "");
|
|
5483
|
+
const inputRef = useRef(null);
|
|
5484
|
+
useEffect3(() => {
|
|
5485
|
+
if (externalValue !== void 0 && externalValue !== null) {
|
|
5486
|
+
setValue(externalValue);
|
|
5487
|
+
}
|
|
5488
|
+
}, [externalValue]);
|
|
5489
|
+
useEffect3(() => {
|
|
5490
|
+
const input = inputRef.current;
|
|
5491
|
+
if (!input || isFocus === void 0 || isDisabled)
|
|
5492
|
+
return;
|
|
5493
|
+
if (isFocus) {
|
|
5494
|
+
input.focus();
|
|
5495
|
+
} else {
|
|
5496
|
+
input.blur();
|
|
5497
|
+
}
|
|
5498
|
+
}, [isFocus]);
|
|
5499
|
+
useEffect3(() => {
|
|
5500
|
+
const input = inputRef.current;
|
|
5501
|
+
if (!input || defaultValue === void 0 || defaultValue === "")
|
|
5502
|
+
return;
|
|
5503
|
+
}, [defaultValue]);
|
|
5504
|
+
const handleInputFocus = () => setIsFocus(true);
|
|
5505
|
+
const handleInputBlur = () => setIsFocus(false);
|
|
5506
|
+
if (!id2)
|
|
5507
|
+
id2 = `input-${uniqueID}`;
|
|
5508
|
+
if (!name)
|
|
5509
|
+
name = id2;
|
|
5510
|
+
return /* @__PURE__ */ React16.createElement("div", { className: "relative" }, /* @__PURE__ */ React16.createElement(
|
|
5511
|
+
InputLabel_default2,
|
|
5512
|
+
{
|
|
5513
|
+
isPlaceholder: true,
|
|
5514
|
+
label,
|
|
5515
|
+
isRequired,
|
|
5516
|
+
id: id2,
|
|
5517
|
+
isError,
|
|
5518
|
+
isActive: true,
|
|
5519
|
+
isDisabled
|
|
5520
|
+
}
|
|
5521
|
+
), /* @__PURE__ */ React16.createElement(
|
|
5522
|
+
InputField_default2,
|
|
5523
|
+
__spreadValues({
|
|
5524
|
+
onFocus: handleInputFocus,
|
|
5525
|
+
onBlur: handleInputBlur,
|
|
5526
|
+
handleChange: (v) => setValue(v),
|
|
5527
|
+
ref,
|
|
5528
|
+
type,
|
|
5529
|
+
name,
|
|
5530
|
+
id: id2,
|
|
5531
|
+
className: cn17(
|
|
5532
|
+
"w-full rounded border py-2 px-3 text-sm font-normal leading-5",
|
|
5533
|
+
{ "border-gray-300": !isFocus && !isError },
|
|
5534
|
+
{
|
|
5535
|
+
"!border-purple-500 shadow-none outline-purple-500 focus:!ring-purple-500": isFocus && !isError
|
|
5536
|
+
},
|
|
5537
|
+
{
|
|
5538
|
+
"!border-red-500 shadow-none focus:ring-red-500": isError
|
|
5539
|
+
},
|
|
5540
|
+
className
|
|
5541
|
+
),
|
|
5542
|
+
isDisabled,
|
|
5543
|
+
isReadonly,
|
|
5544
|
+
value,
|
|
5545
|
+
defaultValue,
|
|
5546
|
+
maxLength,
|
|
5547
|
+
placeholder
|
|
5548
|
+
}, props)
|
|
5549
|
+
), /* @__PURE__ */ React16.createElement("div", { className: "flex flex-row space-x-3" }, /* @__PURE__ */ React16.createElement("div", { className: "grow" }, message && /* @__PURE__ */ React16.createElement("span", { className: cn17("mt-1 block text-sm", isError ? "text-red-500" : "text-gray-500") }, message)), isShowCounter && /* @__PURE__ */ React16.createElement("div", { className: "shrink-0" }, /* @__PURE__ */ React16.createElement(InputCounter_default, { current: Number(value == null ? void 0 : value.length), limit: maxLength }))));
|
|
5550
|
+
};
|
|
5551
|
+
var _TextInput = forwardRef(TextInput);
|
|
5552
|
+
|
|
5553
|
+
// stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx
|
|
5554
|
+
import React17, { useEffect as useEffect4, useState as useState5 } from "react";
|
|
5555
|
+
import { default as cn18 } from "classnames";
|
|
5433
5556
|
import { Switch } from "@headlessui/react";
|
|
5434
5557
|
var ToggleSwitch = ({
|
|
5435
5558
|
isChecked,
|
|
@@ -5441,9 +5564,9 @@ var ToggleSwitch = ({
|
|
|
5441
5564
|
variant = "base",
|
|
5442
5565
|
withIcon
|
|
5443
5566
|
}) => {
|
|
5444
|
-
const [checked, setChecked] =
|
|
5445
|
-
|
|
5446
|
-
return /* @__PURE__ */
|
|
5567
|
+
const [checked, setChecked] = useState5(isChecked);
|
|
5568
|
+
useEffect4(() => setChecked(isChecked), [isChecked]);
|
|
5569
|
+
return /* @__PURE__ */ React17.createElement(Switch.Group, { as: "div", className: "flex items-center gap-2" }, label && label.xPosition === "left" && /* @__PURE__ */ React17.createElement(Switch.Label, { className: label.className }, label.text), /* @__PURE__ */ React17.createElement(
|
|
5447
5570
|
Switch,
|
|
5448
5571
|
{
|
|
5449
5572
|
name,
|
|
@@ -5453,17 +5576,17 @@ var ToggleSwitch = ({
|
|
|
5453
5576
|
onChange(v);
|
|
5454
5577
|
setChecked(v);
|
|
5455
5578
|
},
|
|
5456
|
-
className:
|
|
5579
|
+
className: cn18(
|
|
5457
5580
|
{ "w-9 h-4": variant === "short", " h-6 w-11": variant === "base" },
|
|
5458
5581
|
checked ? "bg-purple-600" : "bg-gray-200",
|
|
5459
5582
|
"relative inline-flex items-center rounded-full focus-visible:ring-2 focus-visible:ring-purple-600 focus-visible:ring-offset-2 focus-within:ring-2 focus-within:ring-purple-600 focus-within:ring-offset-2 focus:ring-2 focus:ring-purple-600 focus:ring-offset-2 active:ring-2 active:ring-purple-600 active:ring-offset-2"
|
|
5460
5583
|
)
|
|
5461
5584
|
},
|
|
5462
|
-
/* @__PURE__ */
|
|
5463
|
-
/* @__PURE__ */
|
|
5585
|
+
/* @__PURE__ */ React17.createElement("span", { className: "sr-only" }, screenReaderLabel),
|
|
5586
|
+
/* @__PURE__ */ React17.createElement(
|
|
5464
5587
|
"span",
|
|
5465
5588
|
{
|
|
5466
|
-
className:
|
|
5589
|
+
className: cn18(
|
|
5467
5590
|
checked ? "translate-x-[22px]" : "translate-x-[2px]",
|
|
5468
5591
|
{
|
|
5469
5592
|
"border border-gray-200 translate-x-0": variant === "short",
|
|
@@ -5472,9 +5595,9 @@ var ToggleSwitch = ({
|
|
|
5472
5595
|
" h-5 w-5 transform rounded-full bg-white transition shadow-sm drop-shadow flex items-center justify-center"
|
|
5473
5596
|
)
|
|
5474
5597
|
},
|
|
5475
|
-
withIcon && /* @__PURE__ */
|
|
5598
|
+
withIcon && /* @__PURE__ */ React17.createElement(DynamicIcon, __spreadProps(__spreadValues({}, withIcon), { className: "text-gray-400 m-[2px]" }))
|
|
5476
5599
|
)
|
|
5477
|
-
), label && label.xPosition === "right" && /* @__PURE__ */
|
|
5600
|
+
), label && label.xPosition === "right" && /* @__PURE__ */ React17.createElement(Switch.Label, { className: label.className }, label.text));
|
|
5478
5601
|
};
|
|
5479
5602
|
var ToggleSwitch_default = ToggleSwitch;
|
|
5480
5603
|
|
|
@@ -5482,8 +5605,8 @@ var ToggleSwitch_default = ToggleSwitch;
|
|
|
5482
5605
|
var toggleSwitch_default = ToggleSwitch_default;
|
|
5483
5606
|
|
|
5484
5607
|
// stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx
|
|
5485
|
-
import
|
|
5486
|
-
import { default as
|
|
5608
|
+
import React18 from "react";
|
|
5609
|
+
import { default as cn19 } from "classnames";
|
|
5487
5610
|
var AnimatedLabelInput = ({
|
|
5488
5611
|
id: id2,
|
|
5489
5612
|
label,
|
|
@@ -5494,10 +5617,10 @@ var AnimatedLabelInput = ({
|
|
|
5494
5617
|
isError,
|
|
5495
5618
|
containerStyles
|
|
5496
5619
|
}) => {
|
|
5497
|
-
return /* @__PURE__ */
|
|
5620
|
+
return /* @__PURE__ */ React18.createElement("div", { className: cn19("group relative", containerStyles ? containerStyles : "") }, input && /* @__PURE__ */ React18.createElement(InputField_default2, __spreadValues({ isError }, input)), textarea && /* @__PURE__ */ React18.createElement(TextArea_default, __spreadValues({ isError }, textarea)), /* @__PURE__ */ React18.createElement(
|
|
5498
5621
|
"label",
|
|
5499
5622
|
{
|
|
5500
|
-
className:
|
|
5623
|
+
className: cn19(
|
|
5501
5624
|
"absolute left-1 z-10 ml-[.172rem] inline-block bg-white px-1 text-xs transition-all peer-placeholder-shown:top-2 peer-placeholder-shown:text-sm peer-placeholder-shown:text-gray-600",
|
|
5502
5625
|
"-top-[9px] group-focus-within:!-top-[12px] group-focus-within:!left-1 group-focus-within:!ml-[.172rem] group-focus-within:!text-xs",
|
|
5503
5626
|
isError && "!text-red-600"
|
|
@@ -5505,8 +5628,8 @@ var AnimatedLabelInput = ({
|
|
|
5505
5628
|
htmlFor: id2
|
|
5506
5629
|
},
|
|
5507
5630
|
label.display,
|
|
5508
|
-
required && /* @__PURE__ */
|
|
5509
|
-
), /* @__PURE__ */
|
|
5631
|
+
required && /* @__PURE__ */ React18.createElement("span", { className: "text-red-600" }, "*")
|
|
5632
|
+
), /* @__PURE__ */ React18.createElement("div", { className: "flex flex-row space-x-3" }, /* @__PURE__ */ React18.createElement("div", { className: "grow transition-all" }, message && /* @__PURE__ */ React18.createElement("span", { className: cn19("mt-1 block text-sm", isError ? "text-red-500" : "text-gray-500") }, message))));
|
|
5510
5633
|
};
|
|
5511
5634
|
var AnimatedLabelInput_default = AnimatedLabelInput;
|
|
5512
5635
|
|
|
@@ -5514,13 +5637,13 @@ var AnimatedLabelInput_default = AnimatedLabelInput;
|
|
|
5514
5637
|
var AnimatedLabelInput_default2 = AnimatedLabelInput_default;
|
|
5515
5638
|
|
|
5516
5639
|
// stories/organisms/ButtonDropdown/ButtonDropdown.tsx
|
|
5517
|
-
import
|
|
5518
|
-
import { default as
|
|
5640
|
+
import React20 from "react";
|
|
5641
|
+
import { default as cn21 } from "classnames";
|
|
5519
5642
|
|
|
5520
5643
|
// stories/organisms/DropdownComponent/DropdownComponent.tsx
|
|
5521
|
-
import
|
|
5644
|
+
import React19, { Fragment, useState as useState6 } from "react";
|
|
5522
5645
|
import { Transition } from "@headlessui/react";
|
|
5523
|
-
import { default as
|
|
5646
|
+
import { default as cn20 } from "classnames";
|
|
5524
5647
|
import {
|
|
5525
5648
|
useFloating,
|
|
5526
5649
|
autoUpdate,
|
|
@@ -5561,8 +5684,8 @@ var Dropdown = (_a) => {
|
|
|
5561
5684
|
"offsetOptions"
|
|
5562
5685
|
]);
|
|
5563
5686
|
var _a2, _b2;
|
|
5564
|
-
const [isOpen, setIsOpen] =
|
|
5565
|
-
const [activeItem, setActiveItem] =
|
|
5687
|
+
const [isOpen, setIsOpen] = useState6(false);
|
|
5688
|
+
const [activeItem, setActiveItem] = useState6(null);
|
|
5566
5689
|
const { refs, floatingStyles, context } = useFloating({
|
|
5567
5690
|
open: isOpen,
|
|
5568
5691
|
onOpenChange: setIsOpen,
|
|
@@ -5593,7 +5716,7 @@ var Dropdown = (_a) => {
|
|
|
5593
5716
|
}
|
|
5594
5717
|
});
|
|
5595
5718
|
const { groupClassname, buttonClassname, itemsClassname, itemClassname, activeItemClassname } = classNames3;
|
|
5596
|
-
return /* @__PURE__ */
|
|
5719
|
+
return /* @__PURE__ */ React19.createElement(
|
|
5597
5720
|
"div",
|
|
5598
5721
|
__spreadValues({}, __spreadValues({
|
|
5599
5722
|
className: groupClassname,
|
|
@@ -5602,7 +5725,7 @@ var Dropdown = (_a) => {
|
|
|
5602
5725
|
"aria-expanded": isOpen,
|
|
5603
5726
|
"aria-haspopup": "listbox"
|
|
5604
5727
|
}, props)),
|
|
5605
|
-
/* @__PURE__ */
|
|
5728
|
+
/* @__PURE__ */ React19.createElement(
|
|
5606
5729
|
"button",
|
|
5607
5730
|
__spreadValues({}, __spreadValues({
|
|
5608
5731
|
ref: refs.setReference,
|
|
@@ -5611,9 +5734,9 @@ var Dropdown = (_a) => {
|
|
|
5611
5734
|
setIsOpen(!isOpen);
|
|
5612
5735
|
}
|
|
5613
5736
|
}, getReferenceProps())),
|
|
5614
|
-
CustomDropdownTrigger ? /* @__PURE__ */
|
|
5737
|
+
CustomDropdownTrigger ? /* @__PURE__ */ React19.createElement("span", { className: "" }, CustomDropdownTrigger) : /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement("span", { className: "pl-1" }, label), /* @__PURE__ */ React19.createElement(DynamicIcon, { icon: "ChevronDownIcon", className: "ml-1 h-5 w-6 " }))
|
|
5615
5738
|
),
|
|
5616
|
-
isMounted && items.length > 0 && isOpen && /* @__PURE__ */
|
|
5739
|
+
isMounted && items.length > 0 && isOpen && /* @__PURE__ */ React19.createElement(FloatingPortal, null, /* @__PURE__ */ React19.createElement(FloatingFocusManager, { context, modal: true }, /* @__PURE__ */ React19.createElement(
|
|
5617
5740
|
Transition,
|
|
5618
5741
|
{
|
|
5619
5742
|
as: Fragment,
|
|
@@ -5625,7 +5748,7 @@ var Dropdown = (_a) => {
|
|
|
5625
5748
|
leaveFrom: "transform opacity-100 scale-100",
|
|
5626
5749
|
leaveTo: "transform opacity-0 scale-95"
|
|
5627
5750
|
},
|
|
5628
|
-
/* @__PURE__ */
|
|
5751
|
+
/* @__PURE__ */ React19.createElement(
|
|
5629
5752
|
"ul",
|
|
5630
5753
|
__spreadValues(__spreadProps(__spreadValues({}, __spreadProps(__spreadValues({}, getFloatingProps()), {
|
|
5631
5754
|
className: itemsClassname,
|
|
@@ -5647,7 +5770,7 @@ var Dropdown = (_a) => {
|
|
|
5647
5770
|
"aria-labelledby": label
|
|
5648
5771
|
}), getFloatingProps()),
|
|
5649
5772
|
items.map((itemStack, idx) => {
|
|
5650
|
-
return /* @__PURE__ */
|
|
5773
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, { key: `${idx}-list-${id2}` }, itemStack.map(
|
|
5651
5774
|
(_a3) => {
|
|
5652
5775
|
var _b3 = _a3, {
|
|
5653
5776
|
onClick,
|
|
@@ -5665,7 +5788,7 @@ var Dropdown = (_a) => {
|
|
|
5665
5788
|
"iconPosition"
|
|
5666
5789
|
]);
|
|
5667
5790
|
const active = activeItem && activeItem === key;
|
|
5668
|
-
const itemClass =
|
|
5791
|
+
const itemClass = cn20(
|
|
5669
5792
|
itemClassname,
|
|
5670
5793
|
"group flex cursor-pointer items-center px-4 py-2 text-sm transition-all",
|
|
5671
5794
|
{
|
|
@@ -5683,7 +5806,7 @@ var Dropdown = (_a) => {
|
|
|
5683
5806
|
},
|
|
5684
5807
|
itemClassname
|
|
5685
5808
|
);
|
|
5686
|
-
return /* @__PURE__ */
|
|
5809
|
+
return /* @__PURE__ */ React19.createElement("li", { key }, /* @__PURE__ */ React19.createElement(
|
|
5687
5810
|
"button",
|
|
5688
5811
|
__spreadValues({}, __spreadValues({
|
|
5689
5812
|
onClick: () => {
|
|
@@ -5691,23 +5814,23 @@ var Dropdown = (_a) => {
|
|
|
5691
5814
|
onClick && onClick();
|
|
5692
5815
|
},
|
|
5693
5816
|
key,
|
|
5694
|
-
className:
|
|
5817
|
+
className: cn20(itemClass, "w-full")
|
|
5695
5818
|
}, rest)),
|
|
5696
|
-
/* @__PURE__ */
|
|
5819
|
+
/* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-x-4" }, icon && (iconPosition === "leading" || iconPosition === void 0) && (typeof icon === "string" ? /* @__PURE__ */ React19.createElement(
|
|
5697
5820
|
DynamicIcon,
|
|
5698
5821
|
__spreadValues({}, {
|
|
5699
5822
|
icon,
|
|
5700
|
-
className:
|
|
5823
|
+
className: cn20(
|
|
5701
5824
|
{
|
|
5702
5825
|
"text-red-500": isEmphasized
|
|
5703
5826
|
},
|
|
5704
5827
|
"opacity-60 group"
|
|
5705
5828
|
)
|
|
5706
5829
|
})
|
|
5707
|
-
) : /* @__PURE__ */
|
|
5830
|
+
) : /* @__PURE__ */ React19.createElement(
|
|
5708
5831
|
DynamicIcon,
|
|
5709
5832
|
__spreadValues({}, __spreadProps(__spreadValues({}, icon), {
|
|
5710
|
-
className:
|
|
5833
|
+
className: cn20(
|
|
5711
5834
|
icon.className,
|
|
5712
5835
|
{
|
|
5713
5836
|
"text-red-500": isEmphasized
|
|
@@ -5715,21 +5838,21 @@ var Dropdown = (_a) => {
|
|
|
5715
5838
|
"opacity-60 group"
|
|
5716
5839
|
)
|
|
5717
5840
|
}))
|
|
5718
|
-
)), /* @__PURE__ */
|
|
5841
|
+
)), /* @__PURE__ */ React19.createElement("div", { className: "whitespace-nowrap" }, label2), icon && iconPosition === "trailing" && (typeof icon === "string" ? /* @__PURE__ */ React19.createElement(
|
|
5719
5842
|
DynamicIcon,
|
|
5720
5843
|
__spreadValues({}, {
|
|
5721
5844
|
icon,
|
|
5722
|
-
className:
|
|
5845
|
+
className: cn20(
|
|
5723
5846
|
{
|
|
5724
5847
|
"text-red-500": isEmphasized
|
|
5725
5848
|
},
|
|
5726
5849
|
"opacity-60 group"
|
|
5727
5850
|
)
|
|
5728
5851
|
})
|
|
5729
|
-
) : /* @__PURE__ */
|
|
5852
|
+
) : /* @__PURE__ */ React19.createElement(
|
|
5730
5853
|
DynamicIcon,
|
|
5731
5854
|
__spreadValues({}, __spreadProps(__spreadValues({}, icon), {
|
|
5732
|
-
className:
|
|
5855
|
+
className: cn20(
|
|
5733
5856
|
icon.className,
|
|
5734
5857
|
{
|
|
5735
5858
|
"text-red-500": isEmphasized
|
|
@@ -5754,39 +5877,39 @@ var DropdownComponent_default2 = DropdownComponent_default;
|
|
|
5754
5877
|
// stories/organisms/ButtonDropdown/ButtonDropdown.tsx
|
|
5755
5878
|
var ButtonDropdown = ({ button, dropDown, placement, offsetOptions }) => {
|
|
5756
5879
|
const dropDownClasses = __spreadProps(__spreadValues({}, defaultClassNames), {
|
|
5757
|
-
groupClassname:
|
|
5880
|
+
groupClassname: cn21(
|
|
5758
5881
|
"flex items-center justify-center rounded-l-none border !border-l-0 rounded-r px-2 transition-all hover:!border-l-0",
|
|
5759
5882
|
button.actionType === "primary" ? "border-purple-600 bg-purple-600 !text-white hover:border-purple-700 hover:bg-purple-700 active:!border-purple-800 active:!bg-purple-800 fill-white" : "",
|
|
5760
5883
|
button.actionType === "secondary" ? "border-purple-50 bg-purple-50 !text-purple-700 hover:border-purple-100 hover:bg-purple-100 active:!border-purple-300 active:!bg-purple-300 fill-purple-700" : "",
|
|
5761
5884
|
button.actionType === "alternative" ? "border-gray-300 bg-white !text-gray-700 fill-gray-700 hover:border-gray-300 hover:bg-gray-50 active:bg-gray-100" : ""
|
|
5762
5885
|
)
|
|
5763
5886
|
});
|
|
5764
|
-
return /* @__PURE__ */
|
|
5887
|
+
return /* @__PURE__ */ React20.createElement("div", { className: "flex items-stretch focus-within:ring-purple-600 focus-within:ring-2 focus-within:ring-offset-white focus-within:ring-offset-2 rounded-[3px]" }, /* @__PURE__ */ React20.createElement(
|
|
5765
5888
|
Button_default2,
|
|
5766
5889
|
__spreadValues({}, __spreadProps(__spreadValues({}, button), {
|
|
5767
|
-
className:
|
|
5890
|
+
className: cn21(
|
|
5768
5891
|
button.className,
|
|
5769
5892
|
"!rounded-r-none !border-r-0 hover:!border-r-0 !focus:ring-transparent !focus-visible:ring-transparent !focus-within:ring-transparent !focus:ring-0 !focus-within:ring-0 !focus-visible:ring-0 !focus:ring-offset-0 !focus-visible:ring-offset-0 !focus-within:ring-offset-0 !ring-0 outline-none focus:outline-none focus-visible:outline-none focus-within:outline-none !ring-offset-0"
|
|
5770
5893
|
)
|
|
5771
5894
|
}))
|
|
5772
|
-
), /* @__PURE__ */
|
|
5895
|
+
), /* @__PURE__ */ React20.createElement(
|
|
5773
5896
|
"div",
|
|
5774
5897
|
{
|
|
5775
|
-
className:
|
|
5898
|
+
className: cn21(
|
|
5776
5899
|
"w-[1px] rt",
|
|
5777
5900
|
button.actionType === "primary" ? "bg-purple-700" : "",
|
|
5778
5901
|
button.actionType === "secondary" ? "bg-purple-200" : "",
|
|
5779
5902
|
button.actionType === "alternative" ? "bg-gray-300" : ""
|
|
5780
5903
|
)
|
|
5781
5904
|
}
|
|
5782
|
-
), /* @__PURE__ */
|
|
5905
|
+
), /* @__PURE__ */ React20.createElement(
|
|
5783
5906
|
DropdownComponent_default2,
|
|
5784
5907
|
__spreadValues({}, __spreadProps(__spreadValues({}, dropDown), {
|
|
5785
|
-
CustomDropdownTrigger: /* @__PURE__ */
|
|
5908
|
+
CustomDropdownTrigger: /* @__PURE__ */ React20.createElement(
|
|
5786
5909
|
DynamicIcon,
|
|
5787
5910
|
__spreadValues({}, {
|
|
5788
5911
|
icon: "ChevronDownIcon",
|
|
5789
|
-
className:
|
|
5912
|
+
className: cn21("h-5 w-5", {
|
|
5790
5913
|
"text-white": button.actionType === "primary",
|
|
5791
5914
|
"text-purple-700": button.actionType === "secondary",
|
|
5792
5915
|
"text-gray-700": button.actionType === "alternative"
|
|
@@ -5803,7 +5926,7 @@ var ButtonDropdown = ({ button, dropDown, placement, offsetOptions }) => {
|
|
|
5803
5926
|
},
|
|
5804
5927
|
placement
|
|
5805
5928
|
}))
|
|
5806
|
-
), /* @__PURE__ */
|
|
5929
|
+
), /* @__PURE__ */ React20.createElement("div", { className: "hidden !bg-purple-100 !text-purple-600 transition-all hover:bg-purple-200 focus:bg-purple-300" }));
|
|
5807
5930
|
};
|
|
5808
5931
|
var ButtonDropdown_default = ButtonDropdown;
|
|
5809
5932
|
|
|
@@ -5811,8 +5934,8 @@ var ButtonDropdown_default = ButtonDropdown;
|
|
|
5811
5934
|
var ButtonDropdown_default2 = ButtonDropdown_default;
|
|
5812
5935
|
|
|
5813
5936
|
// stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.tsx
|
|
5814
|
-
import
|
|
5815
|
-
import { default as
|
|
5937
|
+
import React21 from "react";
|
|
5938
|
+
import { default as cn22 } from "classnames";
|
|
5816
5939
|
var EmptySectionPlaceholder = ({
|
|
5817
5940
|
icon,
|
|
5818
5941
|
mutedText,
|
|
@@ -5821,7 +5944,7 @@ var EmptySectionPlaceholder = ({
|
|
|
5821
5944
|
actions,
|
|
5822
5945
|
isWide
|
|
5823
5946
|
}) => {
|
|
5824
|
-
return /* @__PURE__ */
|
|
5947
|
+
return /* @__PURE__ */ React21.createElement("div", { className: "flex h-full w-full flex-col items-center justify-center border-2 border-dashed border-gray-300 p-5" }, /* @__PURE__ */ React21.createElement(IconWithShadow_default, __spreadValues({}, icon)), mutedText && /* @__PURE__ */ React21.createElement("p", { className: "my-2 block text-xs text-gray-500" }, mutedText), CallToActionComponent ? CallToActionComponent : /* @__PURE__ */ React21.createElement("p", { className: "mb-2 block text-sm font-medium text-gray-600" }, primaryMessage), actions.length > 0 ? /* @__PURE__ */ React21.createElement("div", { className: cn22("mt-2 flex gap-2", isWide ? "" : "flex-col items-center") }, actions.map((action, index) => /* @__PURE__ */ React21.createElement(Button_default2, __spreadProps(__spreadValues({}, __spreadValues({}, action)), { key: action.label.replaceAll(" ", "-") })))) : /* @__PURE__ */ React21.createElement(React21.Fragment, null));
|
|
5825
5948
|
};
|
|
5826
5949
|
var EmptySectionPlaceholder_default = EmptySectionPlaceholder;
|
|
5827
5950
|
|
|
@@ -5829,8 +5952,8 @@ var EmptySectionPlaceholder_default = EmptySectionPlaceholder;
|
|
|
5829
5952
|
var EmptySectionPlaceholder_default2 = EmptySectionPlaceholder_default;
|
|
5830
5953
|
|
|
5831
5954
|
// stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx
|
|
5832
|
-
import
|
|
5833
|
-
import { default as
|
|
5955
|
+
import React22, { useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState7 } from "react";
|
|
5956
|
+
import { default as cn23 } from "classnames";
|
|
5834
5957
|
var FormInputWithAddons = (_a) => {
|
|
5835
5958
|
var _b = _a, {
|
|
5836
5959
|
handleChange,
|
|
@@ -5879,34 +6002,34 @@ var FormInputWithAddons = (_a) => {
|
|
|
5879
6002
|
"customIconClass",
|
|
5880
6003
|
"type"
|
|
5881
6004
|
]);
|
|
5882
|
-
const leadLabelRef =
|
|
5883
|
-
const trailLabelRef =
|
|
5884
|
-
const [leadLabelWidth, setLeadLabelWidth] =
|
|
5885
|
-
const [trailLabelWidth, setTrailLabelWidth] =
|
|
6005
|
+
const leadLabelRef = useRef2(null);
|
|
6006
|
+
const trailLabelRef = useRef2(null);
|
|
6007
|
+
const [leadLabelWidth, setLeadLabelWidth] = useState7(0);
|
|
6008
|
+
const [trailLabelWidth, setTrailLabelWidth] = useState7(0);
|
|
5886
6009
|
useLayoutEffect2(() => {
|
|
5887
6010
|
var _a2, _b2;
|
|
5888
6011
|
setLeadLabelWidth(((_a2 = leadLabelRef.current) == null ? void 0 : _a2.clientWidth) || 0);
|
|
5889
6012
|
setTrailLabelWidth(((_b2 = trailLabelRef.current) == null ? void 0 : _b2.clientWidth) || 0);
|
|
5890
6013
|
}, []);
|
|
5891
|
-
return /* @__PURE__ */
|
|
6014
|
+
return /* @__PURE__ */ React22.createElement("div", { className: cn23("group flex flex-col", containerClassName) }, !leadLabel && !trailLabel && topLabel && /* @__PURE__ */ React22.createElement("label", { htmlFor: id2, className: cn23("flex items-center text-sm font-medium text-gray-600", labelClass) }, topLabel), description && /* @__PURE__ */ React22.createElement("div", { className: "mb-2 text-sm text-gray-500" }, description), /* @__PURE__ */ React22.createElement("div", { className: "relative flex-grow" }, (leadLabel || leadIcon) && /* @__PURE__ */ React22.createElement(
|
|
5892
6015
|
"label",
|
|
5893
6016
|
{
|
|
5894
6017
|
ref: leadLabelRef,
|
|
5895
6018
|
htmlFor: id2,
|
|
5896
|
-
className:
|
|
6019
|
+
className: cn23(
|
|
5897
6020
|
"absolute top-0 bottom-0 left-3 flex items-center justify-center text-sm text-gray-500",
|
|
5898
6021
|
labelClass
|
|
5899
6022
|
)
|
|
5900
6023
|
},
|
|
5901
|
-
leadIcon && /* @__PURE__ */
|
|
6024
|
+
leadIcon && /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(
|
|
5902
6025
|
DynamicIcon,
|
|
5903
6026
|
__spreadValues({}, __spreadProps(__spreadValues({}, leadIcon), {
|
|
5904
|
-
className:
|
|
6027
|
+
className: cn23("h-5 w-5 text-gray-400", leadIconClassNames, customIconClass),
|
|
5905
6028
|
outline: iconOutlined
|
|
5906
6029
|
}))
|
|
5907
6030
|
)),
|
|
5908
6031
|
leadLabel && leadLabel
|
|
5909
|
-
), /* @__PURE__ */
|
|
6032
|
+
), /* @__PURE__ */ React22.createElement(
|
|
5910
6033
|
InputField_default2,
|
|
5911
6034
|
__spreadValues({}, __spreadProps(__spreadValues({}, rest), {
|
|
5912
6035
|
handleChange,
|
|
@@ -5926,20 +6049,20 @@ var FormInputWithAddons = (_a) => {
|
|
|
5926
6049
|
paddingLeft: `${leadLabelWidth + addonOffset}px`
|
|
5927
6050
|
}
|
|
5928
6051
|
}))
|
|
5929
|
-
), (trailLabel || trailIcon) && /* @__PURE__ */
|
|
6052
|
+
), (trailLabel || trailIcon) && /* @__PURE__ */ React22.createElement(
|
|
5930
6053
|
"label",
|
|
5931
6054
|
{
|
|
5932
6055
|
ref: trailLabelRef,
|
|
5933
6056
|
htmlFor: id2,
|
|
5934
|
-
className:
|
|
6057
|
+
className: cn23(
|
|
5935
6058
|
"right absolute top-0 bottom-0 right-3 flex items-center justify-center text-sm !text-gray-500 ",
|
|
5936
6059
|
labelClass
|
|
5937
6060
|
)
|
|
5938
6061
|
},
|
|
5939
|
-
trailIcon && /* @__PURE__ */
|
|
6062
|
+
trailIcon && /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(
|
|
5940
6063
|
DynamicIcon,
|
|
5941
6064
|
__spreadValues({}, __spreadProps(__spreadValues({}, trailIcon), {
|
|
5942
|
-
className:
|
|
6065
|
+
className: cn23("h-5 w-5 text-gray-400", customIconClass),
|
|
5943
6066
|
outline: iconOutlined
|
|
5944
6067
|
}))
|
|
5945
6068
|
)),
|