@powerhousedao/design-system 1.39.15-dev.1 → 1.39.15-dev.2
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/src/scalars/components/fragments/id-autocomplete/id-autocomplete-list-option.js +1 -1
- package/dist/src/scalars/components/fragments/id-autocomplete/use-id-autocomplete.js +1 -1
- package/dist/src/scalars/components/fragments/select-field/content.d.ts.map +1 -1
- package/dist/src/scalars/components/fragments/select-field/content.js +1 -1
- package/dist/src/scalars/components/fragments/select-field/select-field.js +2 -2
- package/dist/src/ui/components/data-entry/input/input.js +1 -1
- package/dist/src/ui/components/data-entry/textarea/textarea.js +1 -1
- package/dist/style.css +5 -5
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/scalars/components/fragments/id-autocomplete/id-autocomplete-list-option.js
CHANGED
|
@@ -28,7 +28,7 @@ const IdAutocompleteListOption = ({ variant = "withValue", icon, title = "Title
|
|
|
28
28
|
: "text-gray-500 dark:text-gray-600"), children: value }) }));
|
|
29
29
|
const renderWithValueTitleAndDescription = (showDescription = true) => (_jsxs("div", { className: cn("flex w-full flex-col gap-1"), children: [_jsxs("div", { className: cn("flex gap-2"), children: [_jsx(IconRenderer, { customIcon: asPlaceholder ? placeholderIcon : icon, asPlaceholder: asPlaceholder }), _jsxs("div", { className: cn("flex min-w-0 grow flex-col gap-[-2px]"), children: [_jsx("span", { className: cn("truncate text-sm font-bold leading-5", asPlaceholder
|
|
30
30
|
? "text-gray-400 dark:text-gray-700"
|
|
31
|
-
: "text-gray-900 dark:text-gray-300"), children: title }), !showValue && typeof path === "object" ? (_jsx("a", { href: path.url, target: "_blank", rel: "noopener noreferrer", className: cn("truncate text-xs leading-5 text-blue-900 hover:underline"), children: path.text })) : (_jsx("span", { className: cn("truncate text-xs leading-5", asPlaceholder
|
|
31
|
+
: "text-gray-900 dark:text-gray-300"), children: title }), !showValue && typeof path === "object" ? (_jsx("a", { href: path.url, target: "_blank", rel: "noopener noreferrer", className: cn("truncate text-xs leading-5 text-blue-900 hover:underline focus-visible:outline-none"), children: path.text })) : (_jsx("span", { className: cn("truncate text-xs leading-5", asPlaceholder
|
|
32
32
|
? "text-gray-400 dark:text-gray-700"
|
|
33
33
|
: "text-gray-500 dark:text-gray-600"), children: typeof path === "object" ? path.text : path }))] }), asPlaceholder === false && handleFetchSelectedOption && (_jsx(ReloadButton, { isLoadingSelectedOption: isLoadingSelectedOption, handleFetchSelectedOption: handleFetchSelectedOption, isFetchSelectedOptionSync: isFetchSelectedOptionSync, value: value }))] }), showValue && (_jsx("div", { className: cn("flex max-w-full items-center"), children: _jsx("span", { className: cn("truncate text-xs leading-5", asPlaceholder
|
|
34
34
|
? "text-gray-400 dark:text-gray-700"
|
|
@@ -176,7 +176,7 @@ export function useIdAutocomplete({ autoComplete, defaultValue, value, isOpenByD
|
|
|
176
176
|
useEffect(() => {
|
|
177
177
|
if (!isInternalChange.current) {
|
|
178
178
|
shouldFetchOptions.current = false;
|
|
179
|
-
setSelectedValue(value ?? "");
|
|
179
|
+
setSelectedValue(value ?? defaultValue ?? "");
|
|
180
180
|
setSelectedOption(undefined);
|
|
181
181
|
}
|
|
182
182
|
isInternalChange.current = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../../../src/scalars/components/fragments/select-field/content.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,WAAW,CAAC;IACpC,qBAAqB,EAAE,MAAM,GAAG,OAAO,CAAC;IACxC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,eAAe,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACzC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../../../src/scalars/components/fragments/select-field/content.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,WAAW,CAAC;IACpC,qBAAqB,EAAE,MAAM,GAAG,OAAO,CAAC;IACxC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,eAAe,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACzC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAuI1C,CAAC"}
|
|
@@ -29,5 +29,5 @@ export const Content = ({ searchable, commandListRef, multiple, selectedValues,
|
|
|
29
29
|
selectedValues.length === enabledOptions.length && (_jsx(Icon, { name: "Checkmark", size: 16, className: "text-gray-900 dark:text-gray-50" })) })), _jsx("span", { className: "text-[14px] font-semibold leading-4 text-gray-900 dark:text-gray-50", children: selectedValues.length === enabledOptions.length
|
|
30
30
|
? "Deselect All"
|
|
31
31
|
: "Select All" }), selectionIcon === "checkmark" &&
|
|
32
|
-
selectionIconPosition === "right" && (_jsx("div", { className: "ml-auto size-4", children: selectedValues.length === enabledOptions.length && (_jsx(Icon, { name: "Checkmark", size: 16, className: "text-gray-900 dark:text-gray-50" })) }))] }) }) })), _jsxs(CommandGroup, { className: multiple && cmdkSearch === "" ? "pt-0" : undefined, children: [_jsx(CommandItemList, { options: favoriteOptions, selectedValues: selectedValues, selectionIcon: selectionIcon, selectionIconPosition: selectionIconPosition, hasAnyIcon: hasAnyIcon, toggleOption: toggleOption }), favoriteOptions.length > 0 && (_jsx("div", { className: "my-1 border-b border-gray-300 dark:border-gray-600" })), _jsx(CommandItemList, { options: options, selectedValues: selectedValues, selectionIcon: selectionIcon, selectionIconPosition: selectionIconPosition, hasAnyIcon: hasAnyIcon, toggleOption: toggleOption })] })] })] }));
|
|
32
|
+
selectionIconPosition === "right" && (_jsx("div", { className: "ml-auto size-4", children: selectedValues.length === enabledOptions.length && (_jsx(Icon, { name: "Checkmark", size: 16, className: "text-gray-900 dark:text-gray-50" })) }))] }) }) })), _jsxs(CommandGroup, { className: multiple && cmdkSearch === "" ? "pt-0" : undefined, children: [_jsx(CommandItemList, { options: favoriteOptions, selectedValues: selectedValues, multiple: multiple, selectionIcon: selectionIcon, selectionIconPosition: selectionIconPosition, hasAnyIcon: hasAnyIcon, toggleOption: toggleOption }), favoriteOptions.length > 0 && (_jsx("div", { className: "my-1 border-b border-gray-300 dark:border-gray-600" })), _jsx(CommandItemList, { options: options, selectedValues: selectedValues, multiple: multiple, selectionIcon: selectionIcon, selectionIconPosition: selectionIconPosition, hasAnyIcon: hasAnyIcon, toggleOption: toggleOption })] })] })] }));
|
|
33
33
|
};
|
|
@@ -47,8 +47,8 @@ description, placeholder, className, contentClassName, contentAlign = "start", .
|
|
|
47
47
|
onBlur?.({ target: {} });
|
|
48
48
|
}
|
|
49
49
|
}, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(Button, { id: id, name: name, type: "button", role: "combobox", onBlur: onTriggerBlur, disabled: disabled, "aria-invalid": errors.length > 0, "aria-label": label ? undefined : multiple ? "Multi select" : "Select", "aria-required": required, "aria-expanded": isPopoverOpen, className: cn("flex h-9 w-full items-center justify-between px-3 py-2", "dark:border-charcoal-700 dark:bg-charcoal-900 rounded-md border border-gray-300 bg-white", "hover:border-gray-300 hover:bg-gray-100", "dark:hover:border-charcoal-700 dark:hover:bg-charcoal-800", "dark:focus:ring-charcoal-300 focus:outline-none focus:ring-1 focus:ring-gray-900 focus:ring-offset-0", "dark:focus-visible:ring-charcoal-300 focus-visible:ring-1 focus-visible:ring-gray-900 focus-visible:ring-offset-0", disabled && [
|
|
50
|
-
"!pointer-events-auto cursor-not-allowed",
|
|
51
|
-
"dark:hover:border-charcoal-700 dark:hover:bg-charcoal-900 hover:border-gray-300 hover:bg-
|
|
50
|
+
"!pointer-events-auto cursor-not-allowed bg-gray-50",
|
|
51
|
+
"dark:hover:border-charcoal-700 dark:hover:bg-charcoal-900 hover:border-gray-300 hover:bg-gray-50",
|
|
52
52
|
], className), ...props, ref: ref, children: _jsx(SelectedContent, { selectedValues: selectedValues, options: [...favoriteOptions, ...options], multiple: multiple, searchable: searchable, placeholder: placeholder, handleClear: handleClear }) }) }), _jsx(PopoverContent, { align: contentAlign, onEscapeKeyDown: (e) => {
|
|
53
53
|
e.preventDefault();
|
|
54
54
|
handleOpenChange(false);
|
|
@@ -13,7 +13,7 @@ const inputBaseStyles = cn(
|
|
|
13
13
|
// Focus styles
|
|
14
14
|
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-900 focus-visible:ring-offset-0 focus-visible:ring-offset-white", "dark:focus-visible:ring-charcoal-300 dark:focus-visible:ring-offset-charcoal-900 dark:focus:bg-charcoal-900 focus:bg-gray-50",
|
|
15
15
|
// Disabled state
|
|
16
|
-
"disabled:cursor-not-allowed", "disabled:border-gray-300 disabled:bg-
|
|
16
|
+
"disabled:cursor-not-allowed", "disabled:border-gray-300 disabled:bg-gray-50 disabled:text-gray-700", "disabled:dark:border-charcoal-800 disabled:dark:bg-charcoal-900 disabled:dark:text-gray-300");
|
|
17
17
|
const Input = React.forwardRef(({ className, type, ...props }, ref) => {
|
|
18
18
|
return (_jsx("input", { type: type, className: cn(inputBaseStyles, className), ref: ref, ...props }));
|
|
19
19
|
});
|
|
@@ -20,7 +20,7 @@ const textareaBaseStyles = cn(
|
|
|
20
20
|
// Focus styles
|
|
21
21
|
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-900 focus-visible:ring-offset-0 focus-visible:ring-offset-white", "dark:focus-visible:ring-charcoal-300 dark:focus-visible:ring-offset-charcoal-900 dark:focus:bg-charcoal-900 focus:bg-gray-50",
|
|
22
22
|
// Disabled state
|
|
23
|
-
"disabled:cursor-not-allowed", "disabled:border-gray-300 disabled:bg-
|
|
23
|
+
"disabled:cursor-not-allowed", "disabled:border-gray-300 disabled:bg-gray-50 disabled:text-gray-700", "disabled:dark:border-charcoal-800 disabled:dark:bg-charcoal-900 disabled:dark:text-gray-300");
|
|
24
24
|
const Textarea = React.forwardRef(({ autoComplete, autoExpand, multiline = true, className, defaultValue, description, errors, id: propId, label, lowercase, maxLength, minLength, name, onChange, placeholder, required, rows = 3, trim, uppercase, value, warnings, ...props }, ref) => {
|
|
25
25
|
const autoCompleteValue = autoComplete === undefined ? undefined : autoComplete ? "on" : "off";
|
|
26
26
|
const hasError = errors && errors.length > 0;
|
package/dist/style.css
CHANGED
|
@@ -3791,6 +3791,11 @@
|
|
|
3791
3791
|
border-color: var(--color-gray-700);
|
|
3792
3792
|
}
|
|
3793
3793
|
}
|
|
3794
|
+
.disabled\:bg-gray-50 {
|
|
3795
|
+
&:disabled {
|
|
3796
|
+
background-color: var(--color-gray-50);
|
|
3797
|
+
}
|
|
3798
|
+
}
|
|
3794
3799
|
.disabled\:bg-gray-300 {
|
|
3795
3800
|
&:disabled {
|
|
3796
3801
|
background-color: var(--color-gray-300);
|
|
@@ -3801,11 +3806,6 @@
|
|
|
3801
3806
|
background-color: transparent;
|
|
3802
3807
|
}
|
|
3803
3808
|
}
|
|
3804
|
-
.disabled\:bg-white {
|
|
3805
|
-
&:disabled {
|
|
3806
|
-
background-color: var(--color-white);
|
|
3807
|
-
}
|
|
3808
|
-
}
|
|
3809
3809
|
.disabled\:p-0 {
|
|
3810
3810
|
&:disabled {
|
|
3811
3811
|
padding: calc(var(--spacing) * 0);
|