@umami/react-zen 0.102.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 -29
- package/dist/index.d.ts +4 -2
- package/dist/index.js +13 -4
- package/dist/index.mjs +13 -4
- package/package.json +1 -1
- package/styles.css +14 -29
package/dist/index.css
CHANGED
|
@@ -3955,24 +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
3960
|
outline: none;
|
|
3961
3961
|
overflow: auto;
|
|
3962
3962
|
gap: var(--spacing-1);
|
|
3963
3963
|
}
|
|
3964
|
-
.
|
|
3964
|
+
.List_separator__MjkwN {
|
|
3965
3965
|
border-bottom: var(--border);
|
|
3966
3966
|
}
|
|
3967
|
-
.
|
|
3967
|
+
.List_section__NmQzZ:not(:last-child) {
|
|
3968
3968
|
margin-bottom: var(--spacing-4);
|
|
3969
3969
|
}
|
|
3970
|
-
.
|
|
3970
|
+
.List_header__MjQ4N {
|
|
3971
3971
|
font-size: var(--font-size-2);
|
|
3972
3972
|
font-weight: var(--font-weight-bold);
|
|
3973
3973
|
padding: var(--padding);
|
|
3974
3974
|
}
|
|
3975
|
-
.
|
|
3975
|
+
.List_item__MWYwM {
|
|
3976
3976
|
display: flex;
|
|
3977
3977
|
align-items: center;
|
|
3978
3978
|
justify-content: space-between;
|
|
@@ -3985,43 +3985,28 @@ body a.Button_button__NDYwM {
|
|
|
3985
3985
|
outline: none;
|
|
3986
3986
|
border-radius: var(--border-radius);
|
|
3987
3987
|
}
|
|
3988
|
-
.
|
|
3988
|
+
.List_item__MWYwM[data-disabled] {
|
|
3989
3989
|
color: var(--font-color-disabled);
|
|
3990
3990
|
}
|
|
3991
|
-
.
|
|
3992
|
-
.
|
|
3991
|
+
.List_item__MWYwM[data-focus],
|
|
3992
|
+
.List_item__MWYwM[data-focus-visible] {
|
|
3993
3993
|
background: var(--highlight-color);
|
|
3994
3994
|
}
|
|
3995
|
-
.
|
|
3995
|
+
.List_item__MWYwM:hover {
|
|
3996
3996
|
background: var(--highlight-color);
|
|
3997
3997
|
}
|
|
3998
|
-
.
|
|
3998
|
+
.List_item__MWYwM[data-selected] {
|
|
3999
3999
|
font-weight: bold;
|
|
4000
|
-
& .
|
|
4000
|
+
& .List_checkmark__YjhhM {
|
|
4001
4001
|
display: flex;
|
|
4002
4002
|
justify-content: flex-end;
|
|
4003
4003
|
flex: 1;
|
|
4004
4004
|
}
|
|
4005
4005
|
}
|
|
4006
|
-
.
|
|
4007
|
-
|
|
4008
|
-
.List_item__YmJhM[data-selected] {
|
|
4009
|
-
background: var(--base-color-2);
|
|
4010
|
-
}
|
|
4011
|
-
}
|
|
4012
|
-
.List_variant-2__MGZhY {
|
|
4013
|
-
& .List_item__YmJhM:hover,
|
|
4014
|
-
.List_item__YmJhM[data-selected] {
|
|
4015
|
-
background: var(--base-color-3);
|
|
4016
|
-
}
|
|
4017
|
-
}
|
|
4018
|
-
.List_variant-3__MmJkZ {
|
|
4019
|
-
& .List_item__YmJhM:hover,
|
|
4020
|
-
.List_item__YmJhM[data-selected] {
|
|
4021
|
-
background: var(--base-color-4);
|
|
4022
|
-
}
|
|
4006
|
+
.List_checkmark__YjhhM {
|
|
4007
|
+
display: none;
|
|
4023
4008
|
}
|
|
4024
|
-
.
|
|
4009
|
+
.List_hideCheckmark__OTEyO .List_checkmark__YjhhM {
|
|
4025
4010
|
display: none;
|
|
4026
4011
|
}
|
|
4027
4012
|
|
package/dist/index.d.ts
CHANGED
|
@@ -609,14 +609,16 @@ 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,
|
|
621
|
+
export function List({ items, idProperty, labelProperty, separatorProperty, highlightColor, showCheckmark, className, style, children, ...props }: ListProps): import("react").JSX.Element;
|
|
620
622
|
export interface ListItemProps extends ListBoxItemProps<any> {
|
|
621
623
|
showCheckmark?: boolean;
|
|
622
624
|
}
|
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();
|
|
@@ -30767,7 +30770,7 @@ function ListItem({
|
|
|
30767
30770
|
textValue: typeof children === "string" ? children : id?.toString(),
|
|
30768
30771
|
children: [
|
|
30769
30772
|
children,
|
|
30770
|
-
showCheckmark && /* @__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, {}) })
|
|
30771
30774
|
]
|
|
30772
30775
|
}
|
|
30773
30776
|
);
|
|
@@ -30781,6 +30784,12 @@ function ListSection({ title, className, children, ...props }) {
|
|
|
30781
30784
|
children
|
|
30782
30785
|
] });
|
|
30783
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
|
+
}
|
|
30784
30793
|
|
|
30785
30794
|
// src/components/Loading.tsx
|
|
30786
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();
|
|
@@ -30656,7 +30659,7 @@ function ListItem({
|
|
|
30656
30659
|
textValue: typeof children === "string" ? children : id?.toString(),
|
|
30657
30660
|
children: [
|
|
30658
30661
|
children,
|
|
30659
|
-
showCheckmark && /* @__PURE__ */ jsx42(
|
|
30662
|
+
showCheckmark && /* @__PURE__ */ jsx42(Icon, { "aria-hidden": "true", className: List_default.checkmark, children: /* @__PURE__ */ jsx42(Icons.Check, {}) })
|
|
30660
30663
|
]
|
|
30661
30664
|
}
|
|
30662
30665
|
);
|
|
@@ -30670,6 +30673,12 @@ function ListSection({ title, className, children, ...props }) {
|
|
|
30670
30673
|
children
|
|
30671
30674
|
] });
|
|
30672
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
|
+
}
|
|
30673
30682
|
|
|
30674
30683
|
// src/components/Loading.tsx
|
|
30675
30684
|
var import_classnames33 = __toESM(require_classnames());
|
package/package.json
CHANGED
package/styles.css
CHANGED
|
@@ -4271,24 +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
4276
|
outline: none;
|
|
4277
4277
|
overflow: auto;
|
|
4278
4278
|
gap: var(--spacing-1);
|
|
4279
4279
|
}
|
|
4280
|
-
.
|
|
4280
|
+
.List_separator__MjkwN {
|
|
4281
4281
|
border-bottom: var(--border);
|
|
4282
4282
|
}
|
|
4283
|
-
.
|
|
4283
|
+
.List_section__NmQzZ:not(:last-child) {
|
|
4284
4284
|
margin-bottom: var(--spacing-4);
|
|
4285
4285
|
}
|
|
4286
|
-
.
|
|
4286
|
+
.List_header__MjQ4N {
|
|
4287
4287
|
font-size: var(--font-size-2);
|
|
4288
4288
|
font-weight: var(--font-weight-bold);
|
|
4289
4289
|
padding: var(--padding);
|
|
4290
4290
|
}
|
|
4291
|
-
.
|
|
4291
|
+
.List_item__MWYwM {
|
|
4292
4292
|
display: flex;
|
|
4293
4293
|
align-items: center;
|
|
4294
4294
|
justify-content: space-between;
|
|
@@ -4301,43 +4301,28 @@ body a.Button_button__NDYwM {
|
|
|
4301
4301
|
outline: none;
|
|
4302
4302
|
border-radius: var(--border-radius);
|
|
4303
4303
|
}
|
|
4304
|
-
.
|
|
4304
|
+
.List_item__MWYwM[data-disabled] {
|
|
4305
4305
|
color: var(--font-color-disabled);
|
|
4306
4306
|
}
|
|
4307
|
-
.
|
|
4308
|
-
.
|
|
4307
|
+
.List_item__MWYwM[data-focus],
|
|
4308
|
+
.List_item__MWYwM[data-focus-visible] {
|
|
4309
4309
|
background: var(--highlight-color);
|
|
4310
4310
|
}
|
|
4311
|
-
.
|
|
4311
|
+
.List_item__MWYwM:hover {
|
|
4312
4312
|
background: var(--highlight-color);
|
|
4313
4313
|
}
|
|
4314
|
-
.
|
|
4314
|
+
.List_item__MWYwM[data-selected] {
|
|
4315
4315
|
font-weight: bold;
|
|
4316
|
-
& .
|
|
4316
|
+
& .List_checkmark__YjhhM {
|
|
4317
4317
|
display: flex;
|
|
4318
4318
|
justify-content: flex-end;
|
|
4319
4319
|
flex: 1;
|
|
4320
4320
|
}
|
|
4321
4321
|
}
|
|
4322
|
-
.
|
|
4323
|
-
|
|
4324
|
-
.List_item__YmJhM[data-selected] {
|
|
4325
|
-
background: var(--base-color-2);
|
|
4326
|
-
}
|
|
4327
|
-
}
|
|
4328
|
-
.List_variant-2__MGZhY {
|
|
4329
|
-
& .List_item__YmJhM:hover,
|
|
4330
|
-
.List_item__YmJhM[data-selected] {
|
|
4331
|
-
background: var(--base-color-3);
|
|
4332
|
-
}
|
|
4333
|
-
}
|
|
4334
|
-
.List_variant-3__MmJkZ {
|
|
4335
|
-
& .List_item__YmJhM:hover,
|
|
4336
|
-
.List_item__YmJhM[data-selected] {
|
|
4337
|
-
background: var(--base-color-4);
|
|
4338
|
-
}
|
|
4322
|
+
.List_checkmark__YjhhM {
|
|
4323
|
+
display: none;
|
|
4339
4324
|
}
|
|
4340
|
-
.
|
|
4325
|
+
.List_hideCheckmark__OTEyO .List_checkmark__YjhhM {
|
|
4341
4326
|
display: none;
|
|
4342
4327
|
}
|
|
4343
4328
|
|