@jobber/components 8.17.0 → 8.17.1-rename-sel-3e22d86.4
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/LegacySelect.d.ts +1 -0
- package/{Select.js → LegacySelect.js} +3 -3
- package/dist/DataTable/index.cjs +1 -1
- package/dist/DataTable/index.mjs +1 -1
- package/dist/DataTable-cjs.js +3 -3
- package/dist/DataTable-es.js +2 -2
- package/dist/LegacySelect/LegacySelect.d.ts +7 -0
- package/dist/{Select/Select.types.d.ts → LegacySelect/LegacySelect.types.d.ts} +1 -1
- package/dist/{Select → LegacySelect}/index.cjs +3 -3
- package/dist/LegacySelect/index.d.ts +3 -0
- package/dist/{Select → LegacySelect}/index.mjs +1 -1
- package/dist/{Select-cjs.js → LegacySelect-cjs.js} +5 -5
- package/dist/{Select-es.js → LegacySelect-es.js} +5 -5
- package/dist/docs/Autocomplete/Autocomplete.md +1 -1
- package/dist/docs/Chip/Chip.md +2 -2
- package/dist/docs/{Select/Select.md → LegacySelect/LegacySelect.md} +67 -62
- package/dist/docs/Menu/Menu.md +1 -1
- package/dist/docs/MultiSelect/MultiSelect.md +1 -1
- package/dist/docs/Tabs/Tabs.md +2 -1
- package/dist/docs/index.md +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/styles.css +26 -26
- package/dist/utils/meta/meta.json +3 -3
- package/package.json +6 -6
- package/Select.d.ts +0 -1
- package/dist/Select/Select.d.ts +0 -7
- package/dist/Select/index.d.ts +0 -3
- /package/dist/{Select → LegacySelect}/Option.d.ts +0 -0
- /package/dist/{Select → LegacySelect}/OptionGroup.d.ts +0 -0
- /package/dist/{Select → LegacySelect}/hooks/useSelectActions.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/LegacySelect";
|
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true,
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var LegacySelect = require("./dist/LegacySelect");
|
|
8
8
|
|
|
9
|
-
Object.keys(
|
|
9
|
+
Object.keys(LegacySelect).forEach(function(key) {
|
|
10
10
|
if (key === "default" || key === "__esModule") return;
|
|
11
11
|
Object.defineProperty(exports, key, {
|
|
12
12
|
enumerable: true,
|
|
13
13
|
get: function get() {
|
|
14
|
-
return
|
|
14
|
+
return LegacySelect[key];
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
17
|
});
|
package/dist/DataTable/index.cjs
CHANGED
|
@@ -10,7 +10,7 @@ require('@jobber/hooks');
|
|
|
10
10
|
require('../Glimmer-cjs.js');
|
|
11
11
|
require('../tslib.es6-cjs.js');
|
|
12
12
|
require('../Content-cjs.js');
|
|
13
|
-
require('../
|
|
13
|
+
require('../LegacySelect-cjs.js');
|
|
14
14
|
require('../useAtlantisFormFieldName-cjs.js');
|
|
15
15
|
require('../FormFieldWrapper-cjs.js');
|
|
16
16
|
require('framer-motion');
|
package/dist/DataTable/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import '@jobber/hooks';
|
|
|
8
8
|
import '../Glimmer-es.js';
|
|
9
9
|
import '../tslib.es6-es.js';
|
|
10
10
|
import '../Content-es.js';
|
|
11
|
-
import '../
|
|
11
|
+
import '../LegacySelect-es.js';
|
|
12
12
|
import '../useAtlantisFormFieldName-es.js';
|
|
13
13
|
import '../FormFieldWrapper-es.js';
|
|
14
14
|
import 'framer-motion';
|
package/dist/DataTable-cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var React = require('react');
|
|
|
6
6
|
var jobberHooks = require('@jobber/hooks');
|
|
7
7
|
var Glimmer = require('./Glimmer-cjs.js');
|
|
8
8
|
var tslib_es6 = require('./tslib.es6-cjs.js');
|
|
9
|
-
var
|
|
9
|
+
var LegacySelect = require('./LegacySelect-cjs.js');
|
|
10
10
|
var Button = require('./Button-cjs.js');
|
|
11
11
|
var Text = require('./Text-cjs.js');
|
|
12
12
|
var DataTableTable = require('./DataTableTable-cjs.js');
|
|
@@ -111,9 +111,9 @@ function Pagination({ table, itemsPerPage, totalItems, loading, onPageChange, })
|
|
|
111
111
|
React.createElement("div", { className: styles$1.paginationInfo }, `Showing ${firstPosition}-${secondPosition} of ${totalRows} items`),
|
|
112
112
|
React.createElement("div", { className: styles$1.paginationNav },
|
|
113
113
|
React.createElement("div", { className: styles$1.paginationSelect },
|
|
114
|
-
React.createElement(
|
|
114
|
+
React.createElement(LegacySelect.LegacySelect, { value: table.getState().pagination.pageSize, onChange: value => {
|
|
115
115
|
table.setPageSize(Number(value));
|
|
116
|
-
}, size: "small" }, itemsPerPageOptions.map(numOfPages => (React.createElement(
|
|
116
|
+
}, size: "small" }, itemsPerPageOptions.map(numOfPages => (React.createElement(LegacySelect.SelectOption, { key: numOfPages, value: numOfPages }, numOfPages)))),
|
|
117
117
|
React.createElement("span", { className: styles$1.paginationSelectLabel }, "per page")),
|
|
118
118
|
React.createElement("div", { className: styles$1.paginationButtons },
|
|
119
119
|
React.createElement(Button.Button, { type: "secondary", variation: "subtle", icon: "arrowLeft", ariaLabel: "arrowLeft", onClick: () => {
|
package/dist/DataTable-es.js
CHANGED
|
@@ -4,7 +4,7 @@ import React__default, { useCallback, useMemo } from 'react';
|
|
|
4
4
|
import { useResizeObserver, Breakpoints } from '@jobber/hooks';
|
|
5
5
|
import { G as Glimmer } from './Glimmer-es.js';
|
|
6
6
|
import { _ as __rest } from './tslib.es6-es.js';
|
|
7
|
-
import {
|
|
7
|
+
import { L as LegacySelect, S as SelectOption } from './LegacySelect-es.js';
|
|
8
8
|
import { B as Button } from './Button-es.js';
|
|
9
9
|
import { T as Text } from './Text-es.js';
|
|
10
10
|
import { S as SortIcon, a as SortDirection, m as DataTableTable, f as DataTableHeader, g as DataTableHeaderCell, j as DataTableRow, c as DataTableCell, k as DataTableRowActions, D as DataTableActions, b as DataTableBody, d as DataTableContainer, l as DataTableSortableHeader, e as DataTableFooter, h as DataTablePagination, i as DataTablePaginationButton } from './DataTableTable-es.js';
|
|
@@ -109,7 +109,7 @@ function Pagination({ table, itemsPerPage, totalItems, loading, onPageChange, })
|
|
|
109
109
|
React__default.createElement("div", { className: styles$1.paginationInfo }, `Showing ${firstPosition}-${secondPosition} of ${totalRows} items`),
|
|
110
110
|
React__default.createElement("div", { className: styles$1.paginationNav },
|
|
111
111
|
React__default.createElement("div", { className: styles$1.paginationSelect },
|
|
112
|
-
React__default.createElement(
|
|
112
|
+
React__default.createElement(LegacySelect, { value: table.getState().pagination.pageSize, onChange: value => {
|
|
113
113
|
table.setPageSize(Number(value));
|
|
114
114
|
}, size: "small" }, itemsPerPageOptions.map(numOfPages => (React__default.createElement(SelectOption, { key: numOfPages, value: numOfPages }, numOfPages)))),
|
|
115
115
|
React__default.createElement("span", { className: styles$1.paginationSelectLabel }, "per page")),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { LegacySelectProps } from "./LegacySelect.types";
|
|
3
|
+
export declare function LegacySelect(props: LegacySelectProps): React.JSX.Element;
|
|
4
|
+
export declare namespace LegacySelect {
|
|
5
|
+
var Option: typeof import("./Option").Option;
|
|
6
|
+
var OptionGroup: typeof import("./OptionGroup").OptionGroup;
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Ref } from "react";
|
|
2
2
|
import type { FormFieldProps } from "../FormField";
|
|
3
3
|
import type { FocusEvents, HTMLInputBaseProps, RebuiltInputCommonProps } from "../sharedHelpers/types";
|
|
4
|
-
export interface
|
|
4
|
+
export interface LegacySelectProps extends Omit<HTMLInputBaseProps, "readOnly" | "maxLength">, FocusEvents<HTMLSelectElement>, Omit<RebuiltInputCommonProps, "clearable" | "prefix" | "suffix" | "align" | "showMiniLabel">, Pick<FormFieldProps, "prefix" | "suffix" | "align" | "children"> {
|
|
5
5
|
readonly value?: string | number;
|
|
6
6
|
onChange?(newValue?: string | number): void;
|
|
7
7
|
readonly inputRef?: Ref<HTMLSelectElement>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var LegacySelect = require('../LegacySelect-cjs.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('classnames');
|
|
6
6
|
require('../useAtlantisFormFieldName-cjs.js');
|
|
@@ -23,5 +23,5 @@ require('../filterDataAttributes-cjs.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
26
|
+
exports.LegacySelect = LegacySelect.LegacySelect;
|
|
27
|
+
exports.Option = LegacySelect.SelectOption;
|
|
@@ -35,13 +35,13 @@ function useSelectActions({ onChange, onBlur, onFocus, }) {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
var styles = {"select":"-
|
|
38
|
+
var styles = {"select":"Bm9c8--1XKs-","selectPostfix":"LBiZF2RZlxc-","spinning":"oMOHhBwUzbs-"};
|
|
39
39
|
|
|
40
40
|
function OptionGroup({ children, label, disabled, UNSAFE_className, UNSAFE_style, }) {
|
|
41
41
|
return (React.createElement("optgroup", { label: label, disabled: disabled, className: UNSAFE_className, style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.container }, children));
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
function
|
|
44
|
+
function LegacySelect(props) {
|
|
45
45
|
var _a;
|
|
46
46
|
const { mergedRef, wrapperRef } = useSelectRefs(props.inputRef);
|
|
47
47
|
const dataAttrs = filterDataAttributes.filterDataAttributes(props);
|
|
@@ -72,8 +72,8 @@ function useSelectRefs(inputRef) {
|
|
|
72
72
|
const wrapperRef = React.useRef(null);
|
|
73
73
|
return { mergedRef, wrapperRef };
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
LegacySelect.Option = SelectOption;
|
|
76
|
+
LegacySelect.OptionGroup = OptionGroup;
|
|
77
77
|
|
|
78
|
-
exports.
|
|
78
|
+
exports.LegacySelect = LegacySelect;
|
|
79
79
|
exports.SelectOption = SelectOption;
|
|
@@ -33,13 +33,13 @@ function useSelectActions({ onChange, onBlur, onFocus, }) {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
var styles = {"select":"-
|
|
36
|
+
var styles = {"select":"Bm9c8--1XKs-","selectPostfix":"LBiZF2RZlxc-","spinning":"oMOHhBwUzbs-"};
|
|
37
37
|
|
|
38
38
|
function OptionGroup({ children, label, disabled, UNSAFE_className, UNSAFE_style, }) {
|
|
39
39
|
return (React__default.createElement("optgroup", { label: label, disabled: disabled, className: UNSAFE_className, style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.container }, children));
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function
|
|
42
|
+
function LegacySelect(props) {
|
|
43
43
|
var _a;
|
|
44
44
|
const { mergedRef, wrapperRef } = useSelectRefs(props.inputRef);
|
|
45
45
|
const dataAttrs = filterDataAttributes(props);
|
|
@@ -70,7 +70,7 @@ function useSelectRefs(inputRef) {
|
|
|
70
70
|
const wrapperRef = useRef(null);
|
|
71
71
|
return { mergedRef, wrapperRef };
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
LegacySelect.Option = SelectOption;
|
|
74
|
+
LegacySelect.OptionGroup = OptionGroup;
|
|
75
75
|
|
|
76
|
-
export {
|
|
76
|
+
export { LegacySelect as L, SelectOption as S };
|
|
@@ -455,7 +455,7 @@ different from the rest.
|
|
|
455
455
|
## Related components
|
|
456
456
|
|
|
457
457
|
* If you want to present a list of predefined options without text input, or the
|
|
458
|
-
number of options is smaller, use a [
|
|
458
|
+
number of options is smaller, use a [LegacySelect](../LegacySelect/LegacySelect.md)
|
|
459
459
|
* If autocompleted results are not required for the text input, use
|
|
460
460
|
[InputText](../InputText/InputText.md)
|
|
461
461
|
* If a text input appearance is not required, and options can only be from a
|
package/dist/docs/Chip/Chip.md
CHANGED
|
@@ -238,8 +238,8 @@ export function ChipInvalidExample(
|
|
|
238
238
|
single-select, multi-select, and add/dismiss functionality "out of the box"
|
|
239
239
|
* [FilterPicker](../FilterPicker/FilterPicker.md) is most commonly triggered by a Chip,
|
|
240
240
|
but is a separate component
|
|
241
|
-
* [
|
|
242
|
-
presents as a form element and should be preferred in forms
|
|
241
|
+
* [LegacySelect](../LegacySelect/LegacySelect.md) is a simpler single-select "dropdown"
|
|
242
|
+
that presents as a form element and should be preferred in forms
|
|
243
243
|
* [RadioGroup](../RadioGroup/RadioGroup.md) should be used to allow the user to
|
|
244
244
|
select "one-of-many" items (single-select) and the labels for the items are
|
|
245
245
|
longer than 1 or 2 words.
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# LegacySelect
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **This component was previously named `Select`.** It has been renamed to
|
|
4
|
+
> `LegacySelect` to make room for a new `Select` implementation.
|
|
5
|
+
|
|
6
|
+
A LegacySelect is used to present a defined list of options to choose from.
|
|
4
7
|
|
|
5
8
|
## Design & usage guidelines
|
|
6
9
|
|
|
7
|
-
Nested within the
|
|
8
|
-
selected. For grouping options with section headers, use
|
|
10
|
+
Nested within the LegacySelect component, Option defines the options that can be
|
|
11
|
+
selected. For grouping options with section headers, use
|
|
12
|
+
LegacySelect.OptionGroup.
|
|
9
13
|
|
|
10
14
|
#### Custom grouped menu and browser support
|
|
11
15
|
|
|
12
16
|
To enable the enhanced grouped menu styling (bold section headers, edge‑to‑edge
|
|
13
17
|
dividers and hover backgrounds), set the `UNSAFE_experimentalStyles` prop on
|
|
14
|
-
`
|
|
18
|
+
`LegacySelect`.
|
|
15
19
|
|
|
16
20
|
* When `UNSAFE_experimentalStyles` is true and the browser supports
|
|
17
21
|
`appearance: base-select` (Chromium 123+), the select renders with the
|
|
@@ -26,16 +30,16 @@ dividers and hover backgrounds), set the `UNSAFE_experimentalStyles` prop on
|
|
|
26
30
|
|
|
27
31
|
```tsx
|
|
28
32
|
import React, { useState } from "react";
|
|
29
|
-
import {
|
|
33
|
+
import { LegacySelect, Option } from "@jobber/components/LegacySelect";
|
|
30
34
|
|
|
31
|
-
export function
|
|
35
|
+
export function LegacySelectInvalidExample() {
|
|
32
36
|
const [value, setValue] = useState<string | number | undefined>("");
|
|
33
37
|
|
|
34
38
|
return (
|
|
35
|
-
<
|
|
39
|
+
<LegacySelect invalid={true} value={value} onChange={setValue}>
|
|
36
40
|
<Option value="sad">Tony</Option>
|
|
37
41
|
<Option value="old">Steve</Option>
|
|
38
|
-
</
|
|
42
|
+
</LegacySelect>
|
|
39
43
|
);
|
|
40
44
|
}
|
|
41
45
|
```
|
|
@@ -44,58 +48,58 @@ export function SelectInvalidExample() {
|
|
|
44
48
|
|
|
45
49
|
```tsx
|
|
46
50
|
import React, { useState } from "react";
|
|
47
|
-
import {
|
|
51
|
+
import { LegacySelect, Option } from "@jobber/components/LegacySelect";
|
|
48
52
|
|
|
49
|
-
export function
|
|
53
|
+
export function LegacySelectDisabledExample() {
|
|
50
54
|
const [value, setValue] = useState<string | number | undefined>("");
|
|
51
55
|
|
|
52
56
|
return (
|
|
53
|
-
<
|
|
57
|
+
<LegacySelect disabled={true} value={value} onChange={setValue}>
|
|
54
58
|
<Option value="sad">Tony</Option>
|
|
55
59
|
<Option value="old">Steve</Option>
|
|
56
|
-
</
|
|
60
|
+
</LegacySelect>
|
|
57
61
|
);
|
|
58
62
|
}
|
|
59
63
|
```
|
|
60
64
|
|
|
61
65
|
## Option Grouping
|
|
62
66
|
|
|
63
|
-
Use `
|
|
64
|
-
user experience and visual hierarchy. The `label` prop is required as it
|
|
67
|
+
Use `LegacySelect.OptionGroup` to organize options with section headers for
|
|
68
|
+
better user experience and visual hierarchy. The `label` prop is required as it
|
|
65
69
|
provides the section header text.
|
|
66
70
|
|
|
67
71
|
### Basic Option Groups
|
|
68
72
|
|
|
69
73
|
```tsx
|
|
70
74
|
import React, { useState } from "react";
|
|
71
|
-
import {
|
|
75
|
+
import { LegacySelect } from "@jobber/components/LegacySelect";
|
|
72
76
|
|
|
73
|
-
export function
|
|
77
|
+
export function LegacySelectCustomOptionGroupsExample() {
|
|
74
78
|
const [value, setValue] = useState<string | number | undefined>("");
|
|
75
79
|
|
|
76
80
|
return (
|
|
77
|
-
<
|
|
81
|
+
<LegacySelect
|
|
78
82
|
placeholder="Select an option"
|
|
79
83
|
UNSAFE_experimentalStyles={true}
|
|
80
84
|
value={value}
|
|
81
85
|
onChange={setValue}
|
|
82
86
|
>
|
|
83
|
-
<
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
<
|
|
87
|
-
</
|
|
88
|
-
<
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
</
|
|
93
|
-
<
|
|
94
|
-
<
|
|
95
|
-
<
|
|
96
|
-
<
|
|
97
|
-
</
|
|
98
|
-
</
|
|
87
|
+
<LegacySelect.OptionGroup label="Team A">
|
|
88
|
+
<LegacySelect.Option value="alice">Alice</LegacySelect.Option>
|
|
89
|
+
<LegacySelect.Option value="bob">Bob</LegacySelect.Option>
|
|
90
|
+
<LegacySelect.Option value="charlie">Charlie</LegacySelect.Option>
|
|
91
|
+
</LegacySelect.OptionGroup>
|
|
92
|
+
<LegacySelect.OptionGroup label="Team B">
|
|
93
|
+
<LegacySelect.Option value="diana">Diana</LegacySelect.Option>
|
|
94
|
+
<LegacySelect.Option value="evan">Evan</LegacySelect.Option>
|
|
95
|
+
<LegacySelect.Option value="frank">Frank</LegacySelect.Option>
|
|
96
|
+
</LegacySelect.OptionGroup>
|
|
97
|
+
<LegacySelect.OptionGroup label="Team C">
|
|
98
|
+
<LegacySelect.Option value="grace">Grace</LegacySelect.Option>
|
|
99
|
+
<LegacySelect.Option value="hector">Hector</LegacySelect.Option>
|
|
100
|
+
<LegacySelect.Option value="isabel">Isabel</LegacySelect.Option>
|
|
101
|
+
</LegacySelect.OptionGroup>
|
|
102
|
+
</LegacySelect>
|
|
99
103
|
);
|
|
100
104
|
}
|
|
101
105
|
```
|
|
@@ -104,31 +108,31 @@ export function SelectCustomOptionGroupsExample() {
|
|
|
104
108
|
|
|
105
109
|
```tsx
|
|
106
110
|
import React, { useState } from "react";
|
|
107
|
-
import {
|
|
111
|
+
import { LegacySelect } from "@jobber/components/LegacySelect";
|
|
108
112
|
|
|
109
|
-
export function
|
|
113
|
+
export function LegacySelectCustomOptionGroupDisabledExample() {
|
|
110
114
|
const [value, setValue] = useState<string | number | undefined>("");
|
|
111
115
|
|
|
112
116
|
return (
|
|
113
|
-
<
|
|
117
|
+
<LegacySelect
|
|
114
118
|
UNSAFE_experimentalStyles
|
|
115
119
|
placeholder="Select an option"
|
|
116
120
|
value={value}
|
|
117
121
|
onChange={setValue}
|
|
118
122
|
>
|
|
119
|
-
<
|
|
120
|
-
<
|
|
121
|
-
<
|
|
122
|
-
</
|
|
123
|
-
<
|
|
124
|
-
<
|
|
125
|
-
<
|
|
126
|
-
</
|
|
127
|
-
<
|
|
128
|
-
<
|
|
129
|
-
<
|
|
130
|
-
</
|
|
131
|
-
</
|
|
123
|
+
<LegacySelect.OptionGroup label="Available Items">
|
|
124
|
+
<LegacySelect.Option value="option1">Option 1</LegacySelect.Option>
|
|
125
|
+
<LegacySelect.Option value="option2">Option 2</LegacySelect.Option>
|
|
126
|
+
</LegacySelect.OptionGroup>
|
|
127
|
+
<LegacySelect.OptionGroup label="Unavailable Items" disabled>
|
|
128
|
+
<LegacySelect.Option value="option3">Option 3</LegacySelect.Option>
|
|
129
|
+
<LegacySelect.Option value="option4">Option 4</LegacySelect.Option>
|
|
130
|
+
</LegacySelect.OptionGroup>
|
|
131
|
+
<LegacySelect.OptionGroup label="More Items">
|
|
132
|
+
<LegacySelect.Option value="option5">Option 5</LegacySelect.Option>
|
|
133
|
+
<LegacySelect.Option value="option6">Option 6</LegacySelect.Option>
|
|
134
|
+
</LegacySelect.OptionGroup>
|
|
135
|
+
</LegacySelect>
|
|
132
136
|
);
|
|
133
137
|
}
|
|
134
138
|
```
|
|
@@ -138,7 +142,7 @@ export function SelectCustomOptionGroupDisabledExample() {
|
|
|
138
142
|
|
|
139
143
|
### Custom (Chromium) vs native
|
|
140
144
|
|
|
141
|
-
|
|
145
|
+
LegacySelect is native by default. Opt into the customizable Chrome UI with
|
|
142
146
|
`UNSAFE_experimentalStyles`. This enhances grouped menus in Chromium 123+ when
|
|
143
147
|
the browser supports `appearance: base-select`.
|
|
144
148
|
|
|
@@ -149,7 +153,7 @@ displayed value) is still rendered by the browser's picker. As a result,
|
|
|
149
153
|
right/center alignment of the displayed value is not configurable in Chromium's
|
|
150
154
|
customizable select.
|
|
151
155
|
|
|
152
|
-
* Need right/center alignment? Use the native
|
|
156
|
+
* Need right/center alignment? Use the native LegacySelect (omit
|
|
153
157
|
`UNSAFE_experimentalStyles`).
|
|
154
158
|
* You can still style the grouped dropdown (optgroup/option) in the custom UI,
|
|
155
159
|
but the closed value alignment will remain default.
|
|
@@ -158,10 +162,11 @@ customizable select.
|
|
|
158
162
|
|
|
159
163
|
### Composable usage
|
|
160
164
|
|
|
161
|
-
|
|
165
|
+
LegacySelect supports composition via subcomponents:
|
|
162
166
|
|
|
163
|
-
* `
|
|
164
|
-
|
|
167
|
+
* `LegacySelect.Option`: item in the list. Provide `value` and children as the
|
|
168
|
+
label.
|
|
169
|
+
* `LegacySelect.OptionGroup`: group options under a `label`. Use with
|
|
165
170
|
`UNSAFE_experimentalStyles` to opt into the customizable grouped menu in
|
|
166
171
|
Chromium.
|
|
167
172
|
|
|
@@ -177,11 +182,11 @@ Select supports composition via subcomponents:
|
|
|
177
182
|
General guidance on `UNSAFE_` props can be found in
|
|
178
183
|
[Customizing components](../customizing-components/customizing-components.md).
|
|
179
184
|
|
|
180
|
-
|
|
181
|
-
native elements:
|
|
185
|
+
LegacySelect subcomponents allow `UNSAFE_className` and `UNSAFE_style` to target
|
|
186
|
+
the native elements:
|
|
182
187
|
|
|
183
|
-
* `
|
|
184
|
-
* `
|
|
188
|
+
* `LegacySelect.OptionGroup` maps to `<optgroup>`
|
|
189
|
+
* `LegacySelect.Option` maps to `<option>`
|
|
185
190
|
|
|
186
191
|
Note that native `<select>` UX differs per browser. Use `UNSAFE_` props with
|
|
187
192
|
caution and test across environments. In the custom UI (Chromium), only the
|
|
@@ -192,7 +197,7 @@ dropdown content is stylable; the closed value alignment is not.
|
|
|
192
197
|
|
|
193
198
|
### Web
|
|
194
199
|
|
|
195
|
-
####
|
|
200
|
+
#### LegacySelect
|
|
196
201
|
|
|
197
202
|
| Prop | Type | Required | Default | Description |
|
|
198
203
|
|------|------|----------|---------|-------------|
|
|
@@ -234,14 +239,14 @@ dropdown content is stylable; the closed value alignment is not.
|
|
|
234
239
|
| `UNSAFE_experimentalStyles` | `boolean` | No | — | Opt-in to the customizable select UI (Chromium 123+). When true, the component will apply the custom select styles De... |
|
|
235
240
|
| `value` | `number | string` | No | — | |
|
|
236
241
|
|
|
237
|
-
####
|
|
242
|
+
#### LegacySelect.Option
|
|
238
243
|
|
|
239
244
|
| Prop | Type | Required | Default | Description |
|
|
240
245
|
|------|------|----------|---------|-------------|
|
|
241
246
|
| `disabled` | `boolean` | No | — | |
|
|
242
247
|
| `value` | `string` | No | — | The content of this attribute represents the value to be submitted with the form, should this option be selected. |
|
|
243
248
|
|
|
244
|
-
####
|
|
249
|
+
#### LegacySelect.OptionGroup
|
|
245
250
|
|
|
246
251
|
| Prop | Type | Required | Default | Description |
|
|
247
252
|
|------|------|----------|---------|-------------|
|
package/dist/docs/Menu/Menu.md
CHANGED
|
@@ -216,7 +216,7 @@ Minimum menu item height:
|
|
|
216
216
|
* For a comparable action-list experience in native mobile, use
|
|
217
217
|
[BottomSheet](/components/BottomSheet) from `@jobber/components-native`
|
|
218
218
|
* To allow the user to choose a value from a predefined list within a form, use
|
|
219
|
-
a [
|
|
219
|
+
a [LegacySelect](../LegacySelect/LegacySelect.md)
|
|
220
220
|
* To allow the user to search and filter through a list of options, use a
|
|
221
221
|
[FilterPicker](../FilterPicker/FilterPicker.md)
|
|
222
222
|
|
|
@@ -22,7 +22,7 @@ the `onOptionsChange` prop.
|
|
|
22
22
|
Adjusting the
|
|
23
23
|
[size](/storybook/web/?path=/story/components-deprecated-multiselect--sizes) of
|
|
24
24
|
the MultiSelect can be used to help align with common adjacent elements such as
|
|
25
|
-
[InputText](../InputText/InputText.md) or [Select](
|
|
25
|
+
[InputText](../InputText/InputText.md) or [Select](/components/Select).
|
|
26
26
|
|
|
27
27
|
## Accessibility
|
|
28
28
|
|
package/dist/docs/Tabs/Tabs.md
CHANGED
|
@@ -28,7 +28,8 @@ pattern for the user.
|
|
|
28
28
|
To show multiple groupings of content at once, use [Card](../Card/Card.md).
|
|
29
29
|
|
|
30
30
|
To allow the user to select one-of-many options in a form, use
|
|
31
|
-
[RadioGroup](../RadioGroup/RadioGroup.md) or
|
|
31
|
+
[RadioGroup](../RadioGroup/RadioGroup.md) or
|
|
32
|
+
[LegacySelect](../LegacySelect/LegacySelect.md).
|
|
32
33
|
|
|
33
34
|
## Accessibility
|
|
34
35
|
|
package/dist/docs/index.md
CHANGED
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
[InputTime](./InputTime/InputTime.md)
|
|
61
61
|
[InputValidation](./InputValidation/InputValidation.md)
|
|
62
62
|
[interaction](./interaction/interaction.md)
|
|
63
|
+
[LegacySelect](./LegacySelect/LegacySelect.md)
|
|
63
64
|
[LightBox](./LightBox/LightBox.md)
|
|
64
65
|
[Link](./Link/Link.md)
|
|
65
66
|
[List](./List/List.md)
|
|
@@ -79,7 +80,6 @@
|
|
|
79
80
|
[ResponsiveSwitcher](./ResponsiveSwitcher/ResponsiveSwitcher.md)
|
|
80
81
|
[scaffolding](./scaffolding/scaffolding.md)
|
|
81
82
|
[SegmentedControl](./SegmentedControl/SegmentedControl.md)
|
|
82
|
-
[Select](./Select/Select.md)
|
|
83
83
|
[settings](./settings/settings.md)
|
|
84
84
|
[SideDrawer](./SideDrawer/SideDrawer.md)
|
|
85
85
|
[SideKick](./SideKick/SideKick.md)
|
package/dist/index.cjs
CHANGED
|
@@ -72,7 +72,7 @@ var Popover = require('./Popover-cjs.js');
|
|
|
72
72
|
var ProgressBar = require('./ProgressBar-cjs.js');
|
|
73
73
|
var RadioGroup = require('./RadioGroup-cjs.js');
|
|
74
74
|
var ResponsiveSwitcher = require('./ResponsiveSwitcher-cjs.js');
|
|
75
|
-
var
|
|
75
|
+
var LegacySelect = require('./LegacySelect-cjs.js');
|
|
76
76
|
var SegmentedControl = require('./SegmentedControl-cjs.js');
|
|
77
77
|
var SideDrawer = require('./SideDrawer-cjs.js');
|
|
78
78
|
var SideKick = require('./SideKick-cjs.js');
|
|
@@ -309,8 +309,8 @@ exports.ProgressBar = ProgressBar.ProgressBar;
|
|
|
309
309
|
exports.RadioGroup = RadioGroup.RadioGroup;
|
|
310
310
|
exports.RadioOption = RadioGroup.RadioOption;
|
|
311
311
|
exports.ResponsiveSwitcher = ResponsiveSwitcher.ResponsiveSwitcher;
|
|
312
|
-
exports.
|
|
313
|
-
exports.
|
|
312
|
+
exports.LegacySelect = LegacySelect.LegacySelect;
|
|
313
|
+
exports.Option = LegacySelect.SelectOption;
|
|
314
314
|
exports.SegmentedControl = SegmentedControl.SegmentedControl;
|
|
315
315
|
exports.SegmentedControlContext = SegmentedControl.SegmentedControlContext;
|
|
316
316
|
exports.SegmentedControlProvider = SegmentedControl.SegmentedControlProvider;
|
package/dist/index.d.mts
CHANGED
|
@@ -62,7 +62,7 @@ export * from "./Popover";
|
|
|
62
62
|
export * from "./ProgressBar";
|
|
63
63
|
export * from "./RadioGroup";
|
|
64
64
|
export * from "./ResponsiveSwitcher";
|
|
65
|
-
export * from "./
|
|
65
|
+
export * from "./LegacySelect";
|
|
66
66
|
export * from "./SegmentedControl";
|
|
67
67
|
export * from "./SideDrawer";
|
|
68
68
|
export * from "./SideKick";
|
package/dist/index.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export * from "./Popover";
|
|
|
62
62
|
export * from "./ProgressBar";
|
|
63
63
|
export * from "./RadioGroup";
|
|
64
64
|
export * from "./ResponsiveSwitcher";
|
|
65
|
-
export * from "./
|
|
65
|
+
export * from "./LegacySelect";
|
|
66
66
|
export * from "./SegmentedControl";
|
|
67
67
|
export * from "./SideDrawer";
|
|
68
68
|
export * from "./SideKick";
|
package/dist/index.mjs
CHANGED
|
@@ -70,7 +70,7 @@ export { P as Popover, u as usePopoverContext, a as usePopoverStyles } from './P
|
|
|
70
70
|
export { P as ProgressBar } from './ProgressBar-es.js';
|
|
71
71
|
export { R as RadioGroup, a as RadioOption } from './RadioGroup-es.js';
|
|
72
72
|
export { R as ResponsiveSwitcher } from './ResponsiveSwitcher-es.js';
|
|
73
|
-
export {
|
|
73
|
+
export { L as LegacySelect, S as Option } from './LegacySelect-es.js';
|
|
74
74
|
export { S as SegmentedControl, a as SegmentedControlContext, b as SegmentedControlProvider, u as useSegmentedControl } from './SegmentedControl-es.js';
|
|
75
75
|
export { S as SideDrawer } from './SideDrawer-es.js';
|
|
76
76
|
export { S as SideKick } from './SideKick-es.js';
|
package/dist/styles.css
CHANGED
|
@@ -7997,14 +7997,14 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
|
|
|
7997
7997
|
*/
|
|
7998
7998
|
@supports ((-webkit-appearance: base-select) or (appearance: base-select)) {
|
|
7999
7999
|
/* opt into customizing select */
|
|
8000
|
-
|
|
8001
|
-
|
|
8000
|
+
.Bm9c8--1XKs-,
|
|
8001
|
+
.Bm9c8--1XKs-::picker(select) {
|
|
8002
8002
|
-webkit-appearance: base-select;
|
|
8003
8003
|
appearance: base-select;
|
|
8004
8004
|
}
|
|
8005
8005
|
|
|
8006
8006
|
/* Dropdown styling + transitions */
|
|
8007
|
-
|
|
8007
|
+
.Bm9c8--1XKs-::picker(select) {
|
|
8008
8008
|
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1), 0px 4px 12px 0px rgba(0, 0, 0, 0.05);
|
|
8009
8009
|
box-shadow: var(--shadow-base);
|
|
8010
8010
|
margin-top: 8px;
|
|
@@ -8044,24 +8044,24 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
|
|
|
8044
8044
|
-webkit-transform var(--timing-base) ease-out;
|
|
8045
8045
|
}
|
|
8046
8046
|
|
|
8047
|
-
|
|
8047
|
+
.Bm9c8--1XKs-::picker-icon {
|
|
8048
8048
|
display: none;
|
|
8049
8049
|
}
|
|
8050
8050
|
|
|
8051
|
-
|
|
8051
|
+
.Bm9c8--1XKs-:not(:open)::picker(select) {
|
|
8052
8052
|
opacity: 0;
|
|
8053
8053
|
-webkit-transform: scale(0.95);
|
|
8054
8054
|
transform: scale(0.95);
|
|
8055
8055
|
}
|
|
8056
8056
|
|
|
8057
|
-
|
|
8057
|
+
.Bm9c8--1XKs-:open::picker(select) {
|
|
8058
8058
|
opacity: 1;
|
|
8059
8059
|
-webkit-transform: translateY(0) scale(1);
|
|
8060
8060
|
transform: translateY(0) scale(1);
|
|
8061
8061
|
}
|
|
8062
8062
|
|
|
8063
8063
|
/* options */
|
|
8064
|
-
|
|
8064
|
+
.Bm9c8--1XKs- option {
|
|
8065
8065
|
padding: 4px 0;
|
|
8066
8066
|
padding: var(--space-smaller) 0;
|
|
8067
8067
|
color: hsl(198, 35%, 21%);
|
|
@@ -8071,16 +8071,16 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
|
|
|
8071
8071
|
cursor: pointer;
|
|
8072
8072
|
}
|
|
8073
8073
|
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
|
|
8074
|
+
.Bm9c8--1XKs- option:hover,
|
|
8075
|
+
.Bm9c8--1XKs- option:focus,
|
|
8076
|
+
.Bm9c8--1XKs- option:focus-visible,
|
|
8077
|
+
.Bm9c8--1XKs- option:checked {
|
|
8078
8078
|
background-color: hsl(43, 18%, 92%);
|
|
8079
8079
|
background-color: var(--color-surface--hover);
|
|
8080
8080
|
}
|
|
8081
8081
|
|
|
8082
8082
|
/* optgroup headers */
|
|
8083
|
-
|
|
8083
|
+
.Bm9c8--1XKs- optgroup {
|
|
8084
8084
|
padding: 8px 0 0 0;
|
|
8085
8085
|
padding: var(--space-small) 0 0 0;
|
|
8086
8086
|
color: hsl(197, 90%, 12%);
|
|
@@ -8095,36 +8095,36 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
|
|
|
8095
8095
|
}
|
|
8096
8096
|
|
|
8097
8097
|
/* Divider directly under the group label */
|
|
8098
|
-
|
|
8098
|
+
.Bm9c8--1XKs- optgroup option:first-child {
|
|
8099
8099
|
border-top: 1px solid hsl(200, 13%, 87%);
|
|
8100
8100
|
border-top: var(--border-base) solid var(--color-border);
|
|
8101
8101
|
}
|
|
8102
8102
|
|
|
8103
8103
|
/* Disabled groups and their options */
|
|
8104
|
-
|
|
8104
|
+
.Bm9c8--1XKs- optgroup[disabled] {
|
|
8105
8105
|
color: hsl(0, 0%, 58%);
|
|
8106
8106
|
color: var(--color-disabled);
|
|
8107
8107
|
}
|
|
8108
|
-
|
|
8109
|
-
|
|
8108
|
+
.Bm9c8--1XKs- optgroup[disabled] option,
|
|
8109
|
+
.Bm9c8--1XKs- option[disabled] {
|
|
8110
8110
|
color: hsl(0, 0%, 58%);
|
|
8111
8111
|
color: var(--color-disabled);
|
|
8112
8112
|
cursor: default;
|
|
8113
8113
|
}
|
|
8114
8114
|
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8115
|
+
.Bm9c8--1XKs- optgroup[disabled] option:focus,
|
|
8116
|
+
.Bm9c8--1XKs- optgroup[disabled] option:focus-visible,
|
|
8117
|
+
.Bm9c8--1XKs- optgroup[disabled] option:checked,
|
|
8118
|
+
.Bm9c8--1XKs- optgroup[disabled] option:hover,
|
|
8119
|
+
.Bm9c8--1XKs- option[disabled]:focus,
|
|
8120
|
+
.Bm9c8--1XKs- option[disabled]:focus-visible,
|
|
8121
|
+
.Bm9c8--1XKs- option[disabled]:checked,
|
|
8122
|
+
.Bm9c8--1XKs- option[disabled]:hover {
|
|
8123
8123
|
background-color: transparent;
|
|
8124
8124
|
}
|
|
8125
8125
|
|
|
8126
8126
|
/* Animate the chevron rotation for the provided postfix class */
|
|
8127
|
-
|
|
8127
|
+
.Bm9c8--1XKs- + .LBiZF2RZlxc- svg {
|
|
8128
8128
|
transition: -webkit-transform 100ms;
|
|
8129
8129
|
transition: -webkit-transform var(--timing-quick);
|
|
8130
8130
|
transition: transform 100ms;
|
|
@@ -8135,7 +8135,7 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
|
|
|
8135
8135
|
transform-origin: 50% 50%;
|
|
8136
8136
|
}
|
|
8137
8137
|
/* Rotate the postfix chevron when the select is open */
|
|
8138
|
-
|
|
8138
|
+
.Bm9c8--1XKs-:open + .LBiZF2RZlxc- svg {
|
|
8139
8139
|
-webkit-transform: rotate(180deg);
|
|
8140
8140
|
transform: rotate(180deg);
|
|
8141
8141
|
}
|
|
@@ -126,6 +126,9 @@
|
|
|
126
126
|
"InputText",
|
|
127
127
|
"InputTime",
|
|
128
128
|
"InputValidation",
|
|
129
|
+
"LegacySelect",
|
|
130
|
+
"LegacySelect.Option",
|
|
131
|
+
"LegacySelect.OptionGroup",
|
|
129
132
|
"LightBox",
|
|
130
133
|
"LightBox.Background",
|
|
131
134
|
"LightBox.Caption",
|
|
@@ -201,9 +204,6 @@
|
|
|
201
204
|
"SegmentedControlContext.Consumer",
|
|
202
205
|
"SegmentedControlContext.Provider",
|
|
203
206
|
"SegmentedControlProvider",
|
|
204
|
-
"Select",
|
|
205
|
-
"Select.Option",
|
|
206
|
-
"Select.OptionGroup",
|
|
207
207
|
"SideDrawer",
|
|
208
208
|
"SideDrawer.Actions",
|
|
209
209
|
"SideDrawer.BackButton",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "8.17.
|
|
3
|
+
"version": "8.17.1-rename-sel-3e22d86.4+3e22d863",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -345,10 +345,10 @@
|
|
|
345
345
|
"import": "./dist/ResponsiveSwitcher/index.mjs",
|
|
346
346
|
"require": "./dist/ResponsiveSwitcher/index.cjs"
|
|
347
347
|
},
|
|
348
|
-
"./
|
|
349
|
-
"types": "./dist/
|
|
350
|
-
"import": "./dist/
|
|
351
|
-
"require": "./dist/
|
|
348
|
+
"./LegacySelect": {
|
|
349
|
+
"types": "./dist/LegacySelect/index.d.ts",
|
|
350
|
+
"import": "./dist/LegacySelect/index.mjs",
|
|
351
|
+
"require": "./dist/LegacySelect/index.cjs"
|
|
352
352
|
},
|
|
353
353
|
"./SideDrawer": {
|
|
354
354
|
"types": "./dist/SideDrawer/index.d.ts",
|
|
@@ -546,5 +546,5 @@
|
|
|
546
546
|
"> 1%",
|
|
547
547
|
"IE 10"
|
|
548
548
|
],
|
|
549
|
-
"gitHead": "
|
|
549
|
+
"gitHead": "3e22d863d7c9a143b1ded63e8b02868e84925501"
|
|
550
550
|
}
|
package/Select.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./dist/Select";
|
package/dist/Select/Select.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { SelectProps } from "./Select.types";
|
|
3
|
-
export declare function Select(props: SelectProps): React.JSX.Element;
|
|
4
|
-
export declare namespace Select {
|
|
5
|
-
var Option: typeof import("./Option").Option;
|
|
6
|
-
var OptionGroup: typeof import("./OptionGroup").OptionGroup;
|
|
7
|
-
}
|
package/dist/Select/index.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|