@vygruppen/spor-react 8.1.0 → 8.2.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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +11 -0
- package/dist/{CountryCodeSelect-X4ONXTIF.mjs → CountryCodeSelect-POM47KR5.mjs} +1 -1
- package/dist/{chunk-JUNOSADJ.mjs → chunk-D4IHIS3H.mjs} +44 -15
- package/dist/index.d.mts +21 -16
- package/dist/index.d.ts +21 -16
- package/dist/index.js +45 -15
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/input/Combobox.tsx +5 -2
- package/src/theme/components/link.ts +21 -10
- package/src/theme/components/listbox.ts +3 -2
- package/src/theme/utils/text-utils.ts +20 -0
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> @vygruppen/spor-react@8.
|
2
|
+
> @vygruppen/spor-react@8.2.0 build
|
3
3
|
> tsup src/index.tsx --dts --treeshake --format cjs,esm
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
@@ -10,13 +10,13 @@
|
|
10
10
|
[34mESM[39m Build start
|
11
11
|
"Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/index.js".
|
12
12
|
[34mDTS[39m Build start
|
13
|
-
"Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/chunk-
|
14
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
15
|
-
[32mCJS[39m ⚡️ Build success in
|
13
|
+
"Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/chunk-D4IHIS3H.mjs".
|
14
|
+
[32mCJS[39m [1mdist/index.js [22m[32m503.28 KB[39m
|
15
|
+
[32mCJS[39m ⚡️ Build success in 2095ms
|
16
16
|
[32mESM[39m [1mdist/index.mjs [22m[32m2.01 KB[39m
|
17
|
-
[32mESM[39m [1mdist/CountryCodeSelect-
|
18
|
-
[32mESM[39m [1mdist/chunk-
|
19
|
-
[32mESM[39m ⚡️ Build success in
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
21
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m271.
|
22
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m271.
|
17
|
+
[32mESM[39m [1mdist/CountryCodeSelect-POM47KR5.mjs [22m[32m1.19 KB[39m
|
18
|
+
[32mESM[39m [1mdist/chunk-D4IHIS3H.mjs [22m[32m395.57 KB[39m
|
19
|
+
[32mESM[39m ⚡️ Build success in 2097ms
|
20
|
+
[32mDTS[39m ⚡️ Build success in 10536ms
|
21
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m271.35 KB[39m
|
22
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m271.35 KB[39m
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# @vygruppen/spor-react
|
2
2
|
|
3
|
+
## 8.2.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- f96483c: ListBox: Fix a focus bug
|
8
|
+
|
9
|
+
### Patch Changes
|
10
|
+
|
11
|
+
- 5c87f0c: ListBox: Fix focus styles for listbox
|
12
|
+
- 7011328: TextLink: Updated colors for primary and secondary variants to align with Figma
|
13
|
+
|
3
14
|
## 8.1.0
|
4
15
|
|
5
16
|
### Minor Changes
|
@@ -2669,6 +2669,7 @@ function Combobox({
|
|
2669
2669
|
paddingY,
|
2670
2670
|
emptyContent,
|
2671
2671
|
inputRef: externalInputRef,
|
2672
|
+
allowsEmptyCollection,
|
2672
2673
|
...rest
|
2673
2674
|
}) {
|
2674
2675
|
const { contains: contains2 } = useFilter({ sensitivity: "base" });
|
@@ -2678,11 +2679,11 @@ function Combobox({
|
|
2678
2679
|
const popoverRef = useRef(null);
|
2679
2680
|
const inputWidth = useInputWidth(inputRef);
|
2680
2681
|
const state2 = useComboBoxState({
|
2681
|
-
...rest,
|
2682
|
-
defaultFilter: contains2,
|
2683
2682
|
allowsEmptyCollection: Boolean(emptyContent),
|
2683
|
+
defaultFilter: contains2,
|
2684
2684
|
shouldCloseOnBlur: true,
|
2685
|
-
label
|
2685
|
+
label,
|
2686
|
+
...rest
|
2686
2687
|
});
|
2687
2688
|
const {
|
2688
2689
|
inputProps: { size: size2, ...inputProps },
|
@@ -3432,7 +3433,7 @@ var texts14 = createTexts({
|
|
3432
3433
|
sv: "Telefonnummer"
|
3433
3434
|
}
|
3434
3435
|
});
|
3435
|
-
var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-
|
3436
|
+
var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-POM47KR5.mjs'));
|
3436
3437
|
var Radio = forwardRef((props, ref) => {
|
3437
3438
|
return /* @__PURE__ */ React69__default.createElement(Radio$1, { ...props, ref });
|
3438
3439
|
});
|
@@ -10103,6 +10104,23 @@ function accentText(state2, props) {
|
|
10103
10104
|
};
|
10104
10105
|
}
|
10105
10106
|
}
|
10107
|
+
function brandText(state2, props) {
|
10108
|
+
switch (state2) {
|
10109
|
+
case "hover":
|
10110
|
+
return {
|
10111
|
+
color: mode("white", "darkTeal")(props)
|
10112
|
+
};
|
10113
|
+
case "active":
|
10114
|
+
return {
|
10115
|
+
color: mode("white", "darkTeal")(props)
|
10116
|
+
};
|
10117
|
+
case "default":
|
10118
|
+
default:
|
10119
|
+
return {
|
10120
|
+
color: mode("pine", "coralGreen")(props)
|
10121
|
+
};
|
10122
|
+
}
|
10123
|
+
}
|
10106
10124
|
|
10107
10125
|
// src/theme/components/accordion.ts
|
10108
10126
|
var helpers = createMultiStyleConfigHelpers(accordionAnatomy.keys);
|
@@ -12338,25 +12356,34 @@ var config23 = defineStyleConfig$1({
|
|
12338
12356
|
}),
|
12339
12357
|
variants: {
|
12340
12358
|
primary: (props) => ({
|
12341
|
-
|
12359
|
+
...brandText("default", props),
|
12342
12360
|
_hover: {
|
12343
|
-
|
12344
|
-
|
12361
|
+
...brandText("hover", props),
|
12362
|
+
...brandBackground("hover", props)
|
12345
12363
|
},
|
12346
12364
|
_active: {
|
12347
|
-
|
12348
|
-
|
12365
|
+
...brandText("active", props),
|
12366
|
+
...brandBackground("active", props)
|
12349
12367
|
}
|
12350
12368
|
}),
|
12351
12369
|
secondary: (props) => ({
|
12352
|
-
|
12370
|
+
backgroundImage: `linear-gradient(${mode(
|
12371
|
+
"blackAlpha.400",
|
12372
|
+
"whiteAlpha.400"
|
12373
|
+
)(props)}, ${mode("blackAlpha.400", "whiteAlpha.400")(props)})`,
|
12374
|
+
...baseText("default", props),
|
12375
|
+
"&:focus, &:focus-visible, &:active, &:hover": {
|
12376
|
+
outline: "solid",
|
12377
|
+
outlineWidth: "1px"
|
12378
|
+
},
|
12379
|
+
...baseBackground("default", props),
|
12353
12380
|
_hover: {
|
12354
|
-
|
12355
|
-
|
12381
|
+
outlineColor: mode("darkGrey", "white")(props),
|
12382
|
+
...baseBackground("hover", props)
|
12356
12383
|
},
|
12357
12384
|
_active: {
|
12358
|
-
|
12359
|
-
|
12385
|
+
outlineColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
12386
|
+
...baseBackground("active", props)
|
12360
12387
|
}
|
12361
12388
|
})
|
12362
12389
|
},
|
@@ -12421,7 +12448,9 @@ var config24 = helpers15.defineMultiStyleConfig({
|
|
12421
12448
|
_hover: {
|
12422
12449
|
...ghostBackground("hover", props)
|
12423
12450
|
},
|
12424
|
-
|
12451
|
+
_focus: {
|
12452
|
+
...ghostBackground("selected", props)
|
12453
|
+
},
|
12425
12454
|
_selected: {
|
12426
12455
|
...ghostBackground("selected", props)
|
12427
12456
|
}
|
package/dist/index.d.mts
CHANGED
@@ -776,6 +776,8 @@ type ComboboxProps<T> = AriaComboBoxProps<T> & {
|
|
776
776
|
emptyContent?: React.ReactNode;
|
777
777
|
/** A ref to the input field */
|
778
778
|
inputRef?: React.RefObject<HTMLInputElement>;
|
779
|
+
/** If you want to allow an empty collection */
|
780
|
+
allowsEmptyCollection?: boolean;
|
779
781
|
} & Pick<InputProps, "marginTop" | "marginBottom" | "marginRight" | "marginLeft" | "marginY" | "marginX" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingY" | "paddingX" | "leftIcon" | "rightIcon" | "borderTopRightRadius" | "borderTopLeftRadius" | "borderBottomRightRadius" | "borderBottomLeftRadius" | "onFocus">;
|
780
782
|
/**
|
781
783
|
* A combobox is a combination of an input and a list of suggestions.
|
@@ -800,7 +802,7 @@ type ComboboxProps<T> = AriaComboBoxProps<T> & {
|
|
800
802
|
* </Combobox>
|
801
803
|
* ```
|
802
804
|
*/
|
803
|
-
declare function Combobox<T extends object>({ label, isLoading, leftIcon, rightIcon, borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius, marginBottom, marginTop, marginX, marginY, marginRight, marginLeft, paddingBottom, paddingRight, paddingTop, paddingLeft, paddingX, paddingY, emptyContent, inputRef: externalInputRef, ...rest }: ComboboxProps<T>): React.JSX.Element;
|
805
|
+
declare function Combobox<T extends object>({ label, isLoading, leftIcon, rightIcon, borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius, marginBottom, marginTop, marginX, marginY, marginRight, marginLeft, paddingBottom, paddingRight, paddingTop, paddingLeft, paddingX, paddingY, emptyContent, inputRef: externalInputRef, allowsEmptyCollection, ...rest }: ComboboxProps<T>): React.JSX.Element;
|
804
806
|
|
805
807
|
type FormControlProps = FormControlProps$1;
|
806
808
|
declare const FormControl: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", FormControlProps$1>;
|
@@ -4252,26 +4254,32 @@ declare const theme: {
|
|
4252
4254
|
} | undefined;
|
4253
4255
|
variants?: {
|
4254
4256
|
primary: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
4255
|
-
color: string;
|
4256
4257
|
_hover: {
|
4257
|
-
color: string;
|
4258
4258
|
backgroundColor: string;
|
4259
|
+
color: string;
|
4259
4260
|
};
|
4260
4261
|
_active: {
|
4261
|
-
color: string;
|
4262
4262
|
backgroundColor: string;
|
4263
|
+
color: string;
|
4263
4264
|
};
|
4265
|
+
color: string;
|
4264
4266
|
};
|
4265
4267
|
secondary: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
4266
|
-
color: string;
|
4267
4268
|
_hover: {
|
4268
4269
|
backgroundColor: string;
|
4269
|
-
|
4270
|
+
outlineColor: string;
|
4270
4271
|
};
|
4271
4272
|
_active: {
|
4272
4273
|
backgroundColor: string;
|
4273
|
-
|
4274
|
+
outlineColor: string;
|
4275
|
+
};
|
4276
|
+
backgroundColor: string;
|
4277
|
+
"&:focus, &:focus-visible, &:active, &:hover": {
|
4278
|
+
outline: string;
|
4279
|
+
outlineWidth: string;
|
4274
4280
|
};
|
4281
|
+
color: string;
|
4282
|
+
backgroundImage: string;
|
4275
4283
|
};
|
4276
4284
|
} | undefined;
|
4277
4285
|
defaultProps?: {
|
@@ -4323,15 +4331,6 @@ declare const theme: {
|
|
4323
4331
|
borderBottomRadius: string;
|
4324
4332
|
};
|
4325
4333
|
item: {
|
4326
|
-
_selected: {
|
4327
|
-
backgroundColor: string;
|
4328
|
-
};
|
4329
|
-
_focusVisible: {
|
4330
|
-
outlineWidth: string;
|
4331
|
-
outlineColor: string;
|
4332
|
-
outlineStyle: string;
|
4333
|
-
outlineOffset: string;
|
4334
|
-
};
|
4335
4334
|
paddingX: number;
|
4336
4335
|
paddingY: number;
|
4337
4336
|
marginY: number;
|
@@ -4346,6 +4345,12 @@ declare const theme: {
|
|
4346
4345
|
_hover: {
|
4347
4346
|
backgroundColor: string;
|
4348
4347
|
};
|
4348
|
+
_focus: {
|
4349
|
+
backgroundColor: string;
|
4350
|
+
};
|
4351
|
+
_selected: {
|
4352
|
+
backgroundColor: string;
|
4353
|
+
};
|
4349
4354
|
};
|
4350
4355
|
label: {};
|
4351
4356
|
description: {
|
package/dist/index.d.ts
CHANGED
@@ -776,6 +776,8 @@ type ComboboxProps<T> = AriaComboBoxProps<T> & {
|
|
776
776
|
emptyContent?: React.ReactNode;
|
777
777
|
/** A ref to the input field */
|
778
778
|
inputRef?: React.RefObject<HTMLInputElement>;
|
779
|
+
/** If you want to allow an empty collection */
|
780
|
+
allowsEmptyCollection?: boolean;
|
779
781
|
} & Pick<InputProps, "marginTop" | "marginBottom" | "marginRight" | "marginLeft" | "marginY" | "marginX" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingY" | "paddingX" | "leftIcon" | "rightIcon" | "borderTopRightRadius" | "borderTopLeftRadius" | "borderBottomRightRadius" | "borderBottomLeftRadius" | "onFocus">;
|
780
782
|
/**
|
781
783
|
* A combobox is a combination of an input and a list of suggestions.
|
@@ -800,7 +802,7 @@ type ComboboxProps<T> = AriaComboBoxProps<T> & {
|
|
800
802
|
* </Combobox>
|
801
803
|
* ```
|
802
804
|
*/
|
803
|
-
declare function Combobox<T extends object>({ label, isLoading, leftIcon, rightIcon, borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius, marginBottom, marginTop, marginX, marginY, marginRight, marginLeft, paddingBottom, paddingRight, paddingTop, paddingLeft, paddingX, paddingY, emptyContent, inputRef: externalInputRef, ...rest }: ComboboxProps<T>): React.JSX.Element;
|
805
|
+
declare function Combobox<T extends object>({ label, isLoading, leftIcon, rightIcon, borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius, marginBottom, marginTop, marginX, marginY, marginRight, marginLeft, paddingBottom, paddingRight, paddingTop, paddingLeft, paddingX, paddingY, emptyContent, inputRef: externalInputRef, allowsEmptyCollection, ...rest }: ComboboxProps<T>): React.JSX.Element;
|
804
806
|
|
805
807
|
type FormControlProps = FormControlProps$1;
|
806
808
|
declare const FormControl: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", FormControlProps$1>;
|
@@ -4252,26 +4254,32 @@ declare const theme: {
|
|
4252
4254
|
} | undefined;
|
4253
4255
|
variants?: {
|
4254
4256
|
primary: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
4255
|
-
color: string;
|
4256
4257
|
_hover: {
|
4257
|
-
color: string;
|
4258
4258
|
backgroundColor: string;
|
4259
|
+
color: string;
|
4259
4260
|
};
|
4260
4261
|
_active: {
|
4261
|
-
color: string;
|
4262
4262
|
backgroundColor: string;
|
4263
|
+
color: string;
|
4263
4264
|
};
|
4265
|
+
color: string;
|
4264
4266
|
};
|
4265
4267
|
secondary: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
4266
|
-
color: string;
|
4267
4268
|
_hover: {
|
4268
4269
|
backgroundColor: string;
|
4269
|
-
|
4270
|
+
outlineColor: string;
|
4270
4271
|
};
|
4271
4272
|
_active: {
|
4272
4273
|
backgroundColor: string;
|
4273
|
-
|
4274
|
+
outlineColor: string;
|
4275
|
+
};
|
4276
|
+
backgroundColor: string;
|
4277
|
+
"&:focus, &:focus-visible, &:active, &:hover": {
|
4278
|
+
outline: string;
|
4279
|
+
outlineWidth: string;
|
4274
4280
|
};
|
4281
|
+
color: string;
|
4282
|
+
backgroundImage: string;
|
4275
4283
|
};
|
4276
4284
|
} | undefined;
|
4277
4285
|
defaultProps?: {
|
@@ -4323,15 +4331,6 @@ declare const theme: {
|
|
4323
4331
|
borderBottomRadius: string;
|
4324
4332
|
};
|
4325
4333
|
item: {
|
4326
|
-
_selected: {
|
4327
|
-
backgroundColor: string;
|
4328
|
-
};
|
4329
|
-
_focusVisible: {
|
4330
|
-
outlineWidth: string;
|
4331
|
-
outlineColor: string;
|
4332
|
-
outlineStyle: string;
|
4333
|
-
outlineOffset: string;
|
4334
|
-
};
|
4335
4334
|
paddingX: number;
|
4336
4335
|
paddingY: number;
|
4337
4336
|
marginY: number;
|
@@ -4346,6 +4345,12 @@ declare const theme: {
|
|
4346
4345
|
_hover: {
|
4347
4346
|
backgroundColor: string;
|
4348
4347
|
};
|
4348
|
+
_focus: {
|
4349
|
+
backgroundColor: string;
|
4350
|
+
};
|
4351
|
+
_selected: {
|
4352
|
+
backgroundColor: string;
|
4353
|
+
};
|
4349
4354
|
};
|
4350
4355
|
label: {};
|
4351
4356
|
description: {
|
package/dist/index.js
CHANGED
@@ -3173,6 +3173,7 @@ function Combobox({
|
|
3173
3173
|
paddingY,
|
3174
3174
|
emptyContent,
|
3175
3175
|
inputRef: externalInputRef,
|
3176
|
+
allowsEmptyCollection,
|
3176
3177
|
...rest
|
3177
3178
|
}) {
|
3178
3179
|
const { contains: contains2 } = reactAria.useFilter({ sensitivity: "base" });
|
@@ -3182,11 +3183,11 @@ function Combobox({
|
|
3182
3183
|
const popoverRef = React69.useRef(null);
|
3183
3184
|
const inputWidth = useInputWidth(inputRef);
|
3184
3185
|
const state2 = reactStately.useComboBoxState({
|
3185
|
-
...rest,
|
3186
|
-
defaultFilter: contains2,
|
3187
3186
|
allowsEmptyCollection: Boolean(emptyContent),
|
3187
|
+
defaultFilter: contains2,
|
3188
3188
|
shouldCloseOnBlur: true,
|
3189
|
-
label
|
3189
|
+
label,
|
3190
|
+
...rest
|
3190
3191
|
});
|
3191
3192
|
const {
|
3192
3193
|
inputProps: { size: size2, ...inputProps },
|
@@ -11514,6 +11515,23 @@ function accentText(state2, props) {
|
|
11514
11515
|
};
|
11515
11516
|
}
|
11516
11517
|
}
|
11518
|
+
function brandText(state2, props) {
|
11519
|
+
switch (state2) {
|
11520
|
+
case "hover":
|
11521
|
+
return {
|
11522
|
+
color: themeTools.mode("white", "darkTeal")(props)
|
11523
|
+
};
|
11524
|
+
case "active":
|
11525
|
+
return {
|
11526
|
+
color: themeTools.mode("white", "darkTeal")(props)
|
11527
|
+
};
|
11528
|
+
case "default":
|
11529
|
+
default:
|
11530
|
+
return {
|
11531
|
+
color: themeTools.mode("pine", "coralGreen")(props)
|
11532
|
+
};
|
11533
|
+
}
|
11534
|
+
}
|
11517
11535
|
var init_text_utils = __esm({
|
11518
11536
|
"src/theme/utils/text-utils.ts"() {
|
11519
11537
|
init_foundations();
|
@@ -13884,6 +13902,8 @@ var config23, link_default;
|
|
13884
13902
|
var init_link2 = __esm({
|
13885
13903
|
"src/theme/components/link.ts"() {
|
13886
13904
|
init_focus_util();
|
13905
|
+
init_background_utils();
|
13906
|
+
init_text_utils();
|
13887
13907
|
config23 = react.defineStyleConfig({
|
13888
13908
|
baseStyle: (props) => ({
|
13889
13909
|
transitionProperty: "common",
|
@@ -13917,25 +13937,34 @@ var init_link2 = __esm({
|
|
13917
13937
|
}),
|
13918
13938
|
variants: {
|
13919
13939
|
primary: (props) => ({
|
13920
|
-
|
13940
|
+
...brandText("default", props),
|
13921
13941
|
_hover: {
|
13922
|
-
|
13923
|
-
|
13942
|
+
...brandText("hover", props),
|
13943
|
+
...brandBackground("hover", props)
|
13924
13944
|
},
|
13925
13945
|
_active: {
|
13926
|
-
|
13927
|
-
|
13946
|
+
...brandText("active", props),
|
13947
|
+
...brandBackground("active", props)
|
13928
13948
|
}
|
13929
13949
|
}),
|
13930
13950
|
secondary: (props) => ({
|
13931
|
-
|
13951
|
+
backgroundImage: `linear-gradient(${themeTools.mode(
|
13952
|
+
"blackAlpha.400",
|
13953
|
+
"whiteAlpha.400"
|
13954
|
+
)(props)}, ${themeTools.mode("blackAlpha.400", "whiteAlpha.400")(props)})`,
|
13955
|
+
...baseText("default", props),
|
13956
|
+
"&:focus, &:focus-visible, &:active, &:hover": {
|
13957
|
+
outline: "solid",
|
13958
|
+
outlineWidth: "1px"
|
13959
|
+
},
|
13960
|
+
...baseBackground("default", props),
|
13932
13961
|
_hover: {
|
13933
|
-
|
13934
|
-
|
13962
|
+
outlineColor: themeTools.mode("darkGrey", "white")(props),
|
13963
|
+
...baseBackground("hover", props)
|
13935
13964
|
},
|
13936
13965
|
_active: {
|
13937
|
-
|
13938
|
-
|
13966
|
+
outlineColor: themeTools.mode("blackAlpha.400", "whiteAlpha.400")(props),
|
13967
|
+
...baseBackground("active", props)
|
13939
13968
|
}
|
13940
13969
|
})
|
13941
13970
|
},
|
@@ -13978,7 +14007,6 @@ var init_listbox = __esm({
|
|
13978
14007
|
init_dist4();
|
13979
14008
|
init_foundations();
|
13980
14009
|
init_background_utils();
|
13981
|
-
init_focus_util();
|
13982
14010
|
parts10 = anatomy("ListBox").parts(
|
13983
14011
|
"container",
|
13984
14012
|
"item",
|
@@ -14016,7 +14044,9 @@ var init_listbox = __esm({
|
|
14016
14044
|
_hover: {
|
14017
14045
|
...ghostBackground("hover", props)
|
14018
14046
|
},
|
14019
|
-
|
14047
|
+
_focus: {
|
14048
|
+
...ghostBackground("selected", props)
|
14049
|
+
},
|
14020
14050
|
_selected: {
|
14021
14051
|
...ghostBackground("selected", props)
|
14022
14052
|
}
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, Nudge, NumericStepper, OrderedList, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-
|
1
|
+
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, Nudge, NumericStepper, OrderedList, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-D4IHIS3H.mjs';
|
package/package.json
CHANGED
package/src/input/Combobox.tsx
CHANGED
@@ -13,6 +13,8 @@ export type ComboboxProps<T> = AriaComboBoxProps<T> & {
|
|
13
13
|
emptyContent?: React.ReactNode;
|
14
14
|
/** A ref to the input field */
|
15
15
|
inputRef?: React.RefObject<HTMLInputElement>;
|
16
|
+
/** If you want to allow an empty collection */
|
17
|
+
allowsEmptyCollection?: boolean;
|
16
18
|
} & Pick<
|
17
19
|
InputProps,
|
18
20
|
| "marginTop"
|
@@ -81,6 +83,7 @@ export function Combobox<T extends object>({
|
|
81
83
|
paddingY,
|
82
84
|
emptyContent,
|
83
85
|
inputRef: externalInputRef,
|
86
|
+
allowsEmptyCollection,
|
84
87
|
...rest
|
85
88
|
}: ComboboxProps<T>) {
|
86
89
|
const { contains } = useFilter({ sensitivity: "base" });
|
@@ -93,11 +96,11 @@ export function Combobox<T extends object>({
|
|
93
96
|
const inputWidth = useInputWidth(inputRef);
|
94
97
|
|
95
98
|
const state = useComboBoxState({
|
96
|
-
...rest,
|
97
|
-
defaultFilter: contains,
|
98
99
|
allowsEmptyCollection: Boolean(emptyContent),
|
100
|
+
defaultFilter: contains,
|
99
101
|
shouldCloseOnBlur: true,
|
100
102
|
label,
|
103
|
+
...rest,
|
101
104
|
});
|
102
105
|
|
103
106
|
const {
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { defineStyleConfig } from "@chakra-ui/react";
|
2
2
|
import { mode } from "@chakra-ui/theme-tools";
|
3
3
|
import { focusVisibleStyles } from "../utils/focus-util";
|
4
|
+
import { baseBackground, brandBackground } from "../utils/background-utils";
|
5
|
+
import { baseText, brandText } from "../utils/text-utils";
|
4
6
|
|
5
7
|
const config = defineStyleConfig({
|
6
8
|
baseStyle: (props) => ({
|
@@ -38,25 +40,34 @@ const config = defineStyleConfig({
|
|
38
40
|
}),
|
39
41
|
variants: {
|
40
42
|
primary: (props) => ({
|
41
|
-
|
43
|
+
...brandText("default", props),
|
42
44
|
_hover: {
|
43
|
-
|
44
|
-
|
45
|
+
...brandText("hover", props),
|
46
|
+
...brandBackground("hover", props),
|
45
47
|
},
|
46
48
|
_active: {
|
47
|
-
|
48
|
-
|
49
|
+
...brandText("active", props),
|
50
|
+
...brandBackground("active", props),
|
49
51
|
},
|
50
52
|
}),
|
51
53
|
secondary: (props) => ({
|
52
|
-
|
54
|
+
backgroundImage: `linear-gradient(${mode(
|
55
|
+
"blackAlpha.400",
|
56
|
+
"whiteAlpha.400",
|
57
|
+
)(props)}, ${mode("blackAlpha.400", "whiteAlpha.400")(props)})`,
|
58
|
+
...baseText("default", props),
|
59
|
+
"&:focus, &:focus-visible, &:active, &:hover": {
|
60
|
+
outline: "solid",
|
61
|
+
outlineWidth: "1px",
|
62
|
+
},
|
63
|
+
...baseBackground("default", props),
|
53
64
|
_hover: {
|
54
|
-
|
55
|
-
|
65
|
+
outlineColor: mode("darkGrey", "white")(props),
|
66
|
+
...baseBackground("hover", props),
|
56
67
|
},
|
57
68
|
_active: {
|
58
|
-
|
59
|
-
|
69
|
+
outlineColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
70
|
+
...baseBackground("active", props),
|
60
71
|
},
|
61
72
|
}),
|
62
73
|
},
|
@@ -3,7 +3,6 @@ import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
|
3
3
|
import { mode } from "@chakra-ui/theme-tools";
|
4
4
|
import { colors } from "../foundations";
|
5
5
|
import { ghostBackground } from "../utils/background-utils";
|
6
|
-
import { focusVisibleStyles } from "../utils/focus-util";
|
7
6
|
|
8
7
|
const parts = anatomy("ListBox").parts(
|
9
8
|
"container",
|
@@ -44,7 +43,9 @@ const config = helpers.defineMultiStyleConfig({
|
|
44
43
|
_hover: {
|
45
44
|
...ghostBackground("hover", props),
|
46
45
|
},
|
47
|
-
|
46
|
+
_focus: {
|
47
|
+
...ghostBackground("selected", props),
|
48
|
+
},
|
48
49
|
_selected: {
|
49
50
|
...ghostBackground("selected", props),
|
50
51
|
},
|
@@ -38,3 +38,23 @@ export function accentText(state: AccentTextState, props: StyleFunctionProps) {
|
|
38
38
|
};
|
39
39
|
}
|
40
40
|
}
|
41
|
+
|
42
|
+
type BrandTextState = Subset<State, "hover" | "active" | "default">;
|
43
|
+
|
44
|
+
export function brandText(state: BrandTextState, props: StyleFunctionProps) {
|
45
|
+
switch (state) {
|
46
|
+
case "hover":
|
47
|
+
return {
|
48
|
+
color: mode("white", "darkTeal")(props),
|
49
|
+
};
|
50
|
+
case "active":
|
51
|
+
return {
|
52
|
+
color: mode("white", "darkTeal")(props),
|
53
|
+
};
|
54
|
+
case "default":
|
55
|
+
default:
|
56
|
+
return {
|
57
|
+
color: mode("pine", "coralGreen")(props),
|
58
|
+
};
|
59
|
+
}
|
60
|
+
}
|