@umami/react-zen 0.101.0 → 0.103.0
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/index.css +14 -30
- package/dist/index.d.ts +11 -5
- package/dist/index.js +21 -11
- package/dist/index.mjs +21 -11
- package/package.json +1 -1
- package/styles.css +14 -30
package/dist/index.css
CHANGED
|
@@ -3955,25 +3955,24 @@ body a.Button_button__NDYwM {
|
|
|
3955
3955
|
}
|
|
3956
3956
|
|
|
3957
3957
|
/* virtual-css:css:0fb02723d81c5960ed149d3d9f58f1ba */
|
|
3958
|
-
.
|
|
3958
|
+
.List_list__YjBiO {
|
|
3959
3959
|
display: grid;
|
|
3960
|
-
min-width: 100px;
|
|
3961
3960
|
outline: none;
|
|
3962
3961
|
overflow: auto;
|
|
3963
3962
|
gap: var(--spacing-1);
|
|
3964
3963
|
}
|
|
3965
|
-
.
|
|
3964
|
+
.List_separator__MjkwN {
|
|
3966
3965
|
border-bottom: var(--border);
|
|
3967
3966
|
}
|
|
3968
|
-
.
|
|
3967
|
+
.List_section__NmQzZ:not(:last-child) {
|
|
3969
3968
|
margin-bottom: var(--spacing-4);
|
|
3970
3969
|
}
|
|
3971
|
-
.
|
|
3970
|
+
.List_header__MjQ4N {
|
|
3972
3971
|
font-size: var(--font-size-2);
|
|
3973
3972
|
font-weight: var(--font-weight-bold);
|
|
3974
3973
|
padding: var(--padding);
|
|
3975
3974
|
}
|
|
3976
|
-
.
|
|
3975
|
+
.List_item__MWYwM {
|
|
3977
3976
|
display: flex;
|
|
3978
3977
|
align-items: center;
|
|
3979
3978
|
justify-content: space-between;
|
|
@@ -3986,43 +3985,28 @@ body a.Button_button__NDYwM {
|
|
|
3986
3985
|
outline: none;
|
|
3987
3986
|
border-radius: var(--border-radius);
|
|
3988
3987
|
}
|
|
3989
|
-
.
|
|
3988
|
+
.List_item__MWYwM[data-disabled] {
|
|
3990
3989
|
color: var(--font-color-disabled);
|
|
3991
3990
|
}
|
|
3992
|
-
.
|
|
3993
|
-
.
|
|
3991
|
+
.List_item__MWYwM[data-focus],
|
|
3992
|
+
.List_item__MWYwM[data-focus-visible] {
|
|
3994
3993
|
background: var(--highlight-color);
|
|
3995
3994
|
}
|
|
3996
|
-
.
|
|
3995
|
+
.List_item__MWYwM:hover {
|
|
3997
3996
|
background: var(--highlight-color);
|
|
3998
3997
|
}
|
|
3999
|
-
.
|
|
3998
|
+
.List_item__MWYwM[data-selected] {
|
|
4000
3999
|
font-weight: bold;
|
|
4001
|
-
& .
|
|
4000
|
+
& .List_checkmark__YjhhM {
|
|
4002
4001
|
display: flex;
|
|
4003
4002
|
justify-content: flex-end;
|
|
4004
4003
|
flex: 1;
|
|
4005
4004
|
}
|
|
4006
4005
|
}
|
|
4007
|
-
.
|
|
4008
|
-
|
|
4009
|
-
.List_item__YmFjO[data-selected] {
|
|
4010
|
-
background: var(--base-color-2);
|
|
4011
|
-
}
|
|
4012
|
-
}
|
|
4013
|
-
.List_variant-2__NTJlM {
|
|
4014
|
-
& .List_item__YmFjO:hover,
|
|
4015
|
-
.List_item__YmFjO[data-selected] {
|
|
4016
|
-
background: var(--base-color-3);
|
|
4017
|
-
}
|
|
4018
|
-
}
|
|
4019
|
-
.List_variant-3__NTEyY {
|
|
4020
|
-
& .List_item__YmFjO:hover,
|
|
4021
|
-
.List_item__YmFjO[data-selected] {
|
|
4022
|
-
background: var(--base-color-4);
|
|
4023
|
-
}
|
|
4006
|
+
.List_checkmark__YjhhM {
|
|
4007
|
+
display: none;
|
|
4024
4008
|
}
|
|
4025
|
-
.
|
|
4009
|
+
.List_hideCheckmark__OTEyO .List_checkmark__YjhhM {
|
|
4026
4010
|
display: none;
|
|
4027
4011
|
}
|
|
4028
4012
|
|
package/dist/index.d.ts
CHANGED
|
@@ -609,19 +609,25 @@ declare module '@umami/react-zen/Label' {
|
|
|
609
609
|
|
|
610
610
|
declare module '@umami/react-zen/List' {
|
|
611
611
|
import { ListBoxProps, SeparatorProps, ListBoxSectionProps, ListBoxItemProps } from 'react-aria-components';
|
|
612
|
+
import { HoverColor } from '@/lib/types';
|
|
612
613
|
export interface ListProps extends ListBoxProps<any> {
|
|
613
614
|
items?: any[];
|
|
614
615
|
idProperty?: string;
|
|
615
616
|
labelProperty?: string;
|
|
616
617
|
separatorProperty?: string;
|
|
617
|
-
|
|
618
|
+
highlightColor?: HoverColor;
|
|
619
|
+
showCheckmark?: boolean;
|
|
618
620
|
}
|
|
619
|
-
export function List({ items, idProperty, labelProperty, separatorProperty,
|
|
620
|
-
export
|
|
621
|
+
export function List({ items, idProperty, labelProperty, separatorProperty, highlightColor, showCheckmark, className, style, children, ...props }: ListProps): import("react").JSX.Element;
|
|
622
|
+
export interface ListItemProps extends ListBoxItemProps<any> {
|
|
623
|
+
showCheckmark?: boolean;
|
|
624
|
+
}
|
|
625
|
+
export function ListItem({ id, children, className, showCheckmark, ...props }: ListItemProps): import("react").JSX.Element;
|
|
621
626
|
export function ListSeparator({ className, ...props }: SeparatorProps): import("react").JSX.Element;
|
|
622
|
-
export
|
|
627
|
+
export interface ListSectionProps extends ListBoxSectionProps<any> {
|
|
623
628
|
title?: string;
|
|
624
|
-
}
|
|
629
|
+
}
|
|
630
|
+
export function ListSection({ title, className, children, ...props }: ListSectionProps): import("react").JSX.Element;
|
|
625
631
|
}
|
|
626
632
|
|
|
627
633
|
declare module '@umami/react-zen/Loading' {
|
package/dist/index.js
CHANGED
|
@@ -30719,7 +30719,7 @@ var import_react184 = require("react");
|
|
|
30719
30719
|
var import_classnames32 = __toESM(require_classnames());
|
|
30720
30720
|
|
|
30721
30721
|
// css-modules:E:\dev\umami-react-zen\src\components\List.module.css
|
|
30722
|
-
var List_default = { "list": "
|
|
30722
|
+
var List_default = { "list": "List_list__YjBiO", "separator": "List_separator__MjkwN", "section": "List_section__NmQzZ", "header": "List_header__MjQ4N", "item": "List_item__MWYwM", "checkmark": "List_checkmark__YjhhM", "hideCheckmark": "List_hideCheckmark__OTEyO" };
|
|
30723
30723
|
|
|
30724
30724
|
// src/components/List.tsx
|
|
30725
30725
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
@@ -30728,8 +30728,10 @@ function List({
|
|
|
30728
30728
|
idProperty = "id",
|
|
30729
30729
|
labelProperty = "label",
|
|
30730
30730
|
separatorProperty = "separatpr",
|
|
30731
|
-
|
|
30731
|
+
highlightColor,
|
|
30732
|
+
showCheckmark = true,
|
|
30732
30733
|
className,
|
|
30734
|
+
style,
|
|
30733
30735
|
children,
|
|
30734
30736
|
...props
|
|
30735
30737
|
}) {
|
|
@@ -30739,7 +30741,8 @@ function List({
|
|
|
30739
30741
|
"aria-label": "list",
|
|
30740
30742
|
...props,
|
|
30741
30743
|
items,
|
|
30742
|
-
className: (0, import_classnames32.default)(List_default.list, className,
|
|
30744
|
+
className: (0, import_classnames32.default)(List_default.list, className, !showCheckmark && List_default.hideCheckmark),
|
|
30745
|
+
style: { ...style, ...getHighlightColor(highlightColor) },
|
|
30743
30746
|
children: children || items?.map((item) => {
|
|
30744
30747
|
const id = item[idProperty] || item.toString();
|
|
30745
30748
|
const label = item[labelProperty] || item.toString();
|
|
@@ -30751,7 +30754,13 @@ function List({
|
|
|
30751
30754
|
}
|
|
30752
30755
|
);
|
|
30753
30756
|
}
|
|
30754
|
-
function ListItem({
|
|
30757
|
+
function ListItem({
|
|
30758
|
+
id,
|
|
30759
|
+
children,
|
|
30760
|
+
className,
|
|
30761
|
+
showCheckmark = true,
|
|
30762
|
+
...props
|
|
30763
|
+
}) {
|
|
30755
30764
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
30756
30765
|
$eed445e0843c11d0$export$a11e76429ed99b4,
|
|
30757
30766
|
{
|
|
@@ -30761,7 +30770,7 @@ function ListItem({ id, children, className, ...props }) {
|
|
|
30761
30770
|
textValue: typeof children === "string" ? children : id?.toString(),
|
|
30762
30771
|
children: [
|
|
30763
30772
|
children,
|
|
30764
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
30773
|
+
showCheckmark && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { "aria-hidden": "true", className: List_default.checkmark, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icons.Check, {}) })
|
|
30765
30774
|
]
|
|
30766
30775
|
}
|
|
30767
30776
|
);
|
|
@@ -30769,17 +30778,18 @@ function ListItem({ id, children, className, ...props }) {
|
|
|
30769
30778
|
function ListSeparator({ className, ...props }) {
|
|
30770
30779
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)($431f98aba6844401$export$1ff3c3f08ae963c0, { ...props, className: (0, import_classnames32.default)(List_default.separator, className) });
|
|
30771
30780
|
}
|
|
30772
|
-
function ListSection({
|
|
30773
|
-
title,
|
|
30774
|
-
className,
|
|
30775
|
-
children,
|
|
30776
|
-
...props
|
|
30777
|
-
}) {
|
|
30781
|
+
function ListSection({ title, className, children, ...props }) {
|
|
30778
30782
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)($eed445e0843c11d0$export$dca12b0bb56e4fc, { ...props, className: (0, import_classnames32.default)(List_default.section, className), children: [
|
|
30779
30783
|
title && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)($72a5793c14baf454$export$8b251419efc915eb, { className: List_default.header, children: title }),
|
|
30780
30784
|
children
|
|
30781
30785
|
] });
|
|
30782
30786
|
}
|
|
30787
|
+
function getHighlightColor(color) {
|
|
30788
|
+
if (!color) return;
|
|
30789
|
+
if (/\d+/.test(color.toString())) {
|
|
30790
|
+
return { "--highlight-color": `var(--base-color-${color})` };
|
|
30791
|
+
}
|
|
30792
|
+
}
|
|
30783
30793
|
|
|
30784
30794
|
// src/components/Loading.tsx
|
|
30785
30795
|
var import_classnames33 = __toESM(require_classnames());
|
package/dist/index.mjs
CHANGED
|
@@ -30608,7 +30608,7 @@ import { Fragment as Fragment6 } from "react";
|
|
|
30608
30608
|
var import_classnames32 = __toESM(require_classnames());
|
|
30609
30609
|
|
|
30610
30610
|
// css-modules:E:\dev\umami-react-zen\src\components\List.module.css
|
|
30611
|
-
var List_default = { "list": "
|
|
30611
|
+
var List_default = { "list": "List_list__YjBiO", "separator": "List_separator__MjkwN", "section": "List_section__NmQzZ", "header": "List_header__MjQ4N", "item": "List_item__MWYwM", "checkmark": "List_checkmark__YjhhM", "hideCheckmark": "List_hideCheckmark__OTEyO" };
|
|
30612
30612
|
|
|
30613
30613
|
// src/components/List.tsx
|
|
30614
30614
|
import { jsx as jsx42, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
@@ -30617,8 +30617,10 @@ function List({
|
|
|
30617
30617
|
idProperty = "id",
|
|
30618
30618
|
labelProperty = "label",
|
|
30619
30619
|
separatorProperty = "separatpr",
|
|
30620
|
-
|
|
30620
|
+
highlightColor,
|
|
30621
|
+
showCheckmark = true,
|
|
30621
30622
|
className,
|
|
30623
|
+
style,
|
|
30622
30624
|
children,
|
|
30623
30625
|
...props
|
|
30624
30626
|
}) {
|
|
@@ -30628,7 +30630,8 @@ function List({
|
|
|
30628
30630
|
"aria-label": "list",
|
|
30629
30631
|
...props,
|
|
30630
30632
|
items,
|
|
30631
|
-
className: (0, import_classnames32.default)(List_default.list, className,
|
|
30633
|
+
className: (0, import_classnames32.default)(List_default.list, className, !showCheckmark && List_default.hideCheckmark),
|
|
30634
|
+
style: { ...style, ...getHighlightColor(highlightColor) },
|
|
30632
30635
|
children: children || items?.map((item) => {
|
|
30633
30636
|
const id = item[idProperty] || item.toString();
|
|
30634
30637
|
const label = item[labelProperty] || item.toString();
|
|
@@ -30640,7 +30643,13 @@ function List({
|
|
|
30640
30643
|
}
|
|
30641
30644
|
);
|
|
30642
30645
|
}
|
|
30643
|
-
function ListItem({
|
|
30646
|
+
function ListItem({
|
|
30647
|
+
id,
|
|
30648
|
+
children,
|
|
30649
|
+
className,
|
|
30650
|
+
showCheckmark = true,
|
|
30651
|
+
...props
|
|
30652
|
+
}) {
|
|
30644
30653
|
return /* @__PURE__ */ jsxs21(
|
|
30645
30654
|
$eed445e0843c11d0$export$a11e76429ed99b4,
|
|
30646
30655
|
{
|
|
@@ -30650,7 +30659,7 @@ function ListItem({ id, children, className, ...props }) {
|
|
|
30650
30659
|
textValue: typeof children === "string" ? children : id?.toString(),
|
|
30651
30660
|
children: [
|
|
30652
30661
|
children,
|
|
30653
|
-
/* @__PURE__ */ jsx42(
|
|
30662
|
+
showCheckmark && /* @__PURE__ */ jsx42(Icon, { "aria-hidden": "true", className: List_default.checkmark, children: /* @__PURE__ */ jsx42(Icons.Check, {}) })
|
|
30654
30663
|
]
|
|
30655
30664
|
}
|
|
30656
30665
|
);
|
|
@@ -30658,17 +30667,18 @@ function ListItem({ id, children, className, ...props }) {
|
|
|
30658
30667
|
function ListSeparator({ className, ...props }) {
|
|
30659
30668
|
return /* @__PURE__ */ jsx42($431f98aba6844401$export$1ff3c3f08ae963c0, { ...props, className: (0, import_classnames32.default)(List_default.separator, className) });
|
|
30660
30669
|
}
|
|
30661
|
-
function ListSection({
|
|
30662
|
-
title,
|
|
30663
|
-
className,
|
|
30664
|
-
children,
|
|
30665
|
-
...props
|
|
30666
|
-
}) {
|
|
30670
|
+
function ListSection({ title, className, children, ...props }) {
|
|
30667
30671
|
return /* @__PURE__ */ jsxs21($eed445e0843c11d0$export$dca12b0bb56e4fc, { ...props, className: (0, import_classnames32.default)(List_default.section, className), children: [
|
|
30668
30672
|
title && /* @__PURE__ */ jsx42($72a5793c14baf454$export$8b251419efc915eb, { className: List_default.header, children: title }),
|
|
30669
30673
|
children
|
|
30670
30674
|
] });
|
|
30671
30675
|
}
|
|
30676
|
+
function getHighlightColor(color) {
|
|
30677
|
+
if (!color) return;
|
|
30678
|
+
if (/\d+/.test(color.toString())) {
|
|
30679
|
+
return { "--highlight-color": `var(--base-color-${color})` };
|
|
30680
|
+
}
|
|
30681
|
+
}
|
|
30672
30682
|
|
|
30673
30683
|
// src/components/Loading.tsx
|
|
30674
30684
|
var import_classnames33 = __toESM(require_classnames());
|
package/package.json
CHANGED
package/styles.css
CHANGED
|
@@ -4271,25 +4271,24 @@ body a.Button_button__NDYwM {
|
|
|
4271
4271
|
}
|
|
4272
4272
|
|
|
4273
4273
|
/* virtual-css:css:0fb02723d81c5960ed149d3d9f58f1ba */
|
|
4274
|
-
.
|
|
4274
|
+
.List_list__YjBiO {
|
|
4275
4275
|
display: grid;
|
|
4276
|
-
min-width: 100px;
|
|
4277
4276
|
outline: none;
|
|
4278
4277
|
overflow: auto;
|
|
4279
4278
|
gap: var(--spacing-1);
|
|
4280
4279
|
}
|
|
4281
|
-
.
|
|
4280
|
+
.List_separator__MjkwN {
|
|
4282
4281
|
border-bottom: var(--border);
|
|
4283
4282
|
}
|
|
4284
|
-
.
|
|
4283
|
+
.List_section__NmQzZ:not(:last-child) {
|
|
4285
4284
|
margin-bottom: var(--spacing-4);
|
|
4286
4285
|
}
|
|
4287
|
-
.
|
|
4286
|
+
.List_header__MjQ4N {
|
|
4288
4287
|
font-size: var(--font-size-2);
|
|
4289
4288
|
font-weight: var(--font-weight-bold);
|
|
4290
4289
|
padding: var(--padding);
|
|
4291
4290
|
}
|
|
4292
|
-
.
|
|
4291
|
+
.List_item__MWYwM {
|
|
4293
4292
|
display: flex;
|
|
4294
4293
|
align-items: center;
|
|
4295
4294
|
justify-content: space-between;
|
|
@@ -4302,43 +4301,28 @@ body a.Button_button__NDYwM {
|
|
|
4302
4301
|
outline: none;
|
|
4303
4302
|
border-radius: var(--border-radius);
|
|
4304
4303
|
}
|
|
4305
|
-
.
|
|
4304
|
+
.List_item__MWYwM[data-disabled] {
|
|
4306
4305
|
color: var(--font-color-disabled);
|
|
4307
4306
|
}
|
|
4308
|
-
.
|
|
4309
|
-
.
|
|
4307
|
+
.List_item__MWYwM[data-focus],
|
|
4308
|
+
.List_item__MWYwM[data-focus-visible] {
|
|
4310
4309
|
background: var(--highlight-color);
|
|
4311
4310
|
}
|
|
4312
|
-
.
|
|
4311
|
+
.List_item__MWYwM:hover {
|
|
4313
4312
|
background: var(--highlight-color);
|
|
4314
4313
|
}
|
|
4315
|
-
.
|
|
4314
|
+
.List_item__MWYwM[data-selected] {
|
|
4316
4315
|
font-weight: bold;
|
|
4317
|
-
& .
|
|
4316
|
+
& .List_checkmark__YjhhM {
|
|
4318
4317
|
display: flex;
|
|
4319
4318
|
justify-content: flex-end;
|
|
4320
4319
|
flex: 1;
|
|
4321
4320
|
}
|
|
4322
4321
|
}
|
|
4323
|
-
.
|
|
4324
|
-
|
|
4325
|
-
.List_item__YmFjO[data-selected] {
|
|
4326
|
-
background: var(--base-color-2);
|
|
4327
|
-
}
|
|
4328
|
-
}
|
|
4329
|
-
.List_variant-2__NTJlM {
|
|
4330
|
-
& .List_item__YmFjO:hover,
|
|
4331
|
-
.List_item__YmFjO[data-selected] {
|
|
4332
|
-
background: var(--base-color-3);
|
|
4333
|
-
}
|
|
4334
|
-
}
|
|
4335
|
-
.List_variant-3__NTEyY {
|
|
4336
|
-
& .List_item__YmFjO:hover,
|
|
4337
|
-
.List_item__YmFjO[data-selected] {
|
|
4338
|
-
background: var(--base-color-4);
|
|
4339
|
-
}
|
|
4322
|
+
.List_checkmark__YjhhM {
|
|
4323
|
+
display: none;
|
|
4340
4324
|
}
|
|
4341
|
-
.
|
|
4325
|
+
.List_hideCheckmark__OTEyO .List_checkmark__YjhhM {
|
|
4342
4326
|
display: none;
|
|
4343
4327
|
}
|
|
4344
4328
|
|