@coinbase/cds-web 9.9.0 → 9.10.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/CHANGELOG.md +6 -0
- package/dts/alpha/select/DefaultSelectControl.d.ts.map +1 -1
- package/dts/alpha/select/DefaultSelectDropdown.d.ts.map +1 -1
- package/dts/alpha/select/Select.d.ts +1 -0
- package/dts/alpha/select/Select.d.ts.map +1 -1
- package/dts/alpha/select/types.d.ts +27 -2
- package/dts/alpha/select/types.d.ts.map +1 -1
- package/dts/alpha/select-chip/SelectChip.d.ts +8 -2
- package/dts/alpha/select-chip/SelectChip.d.ts.map +1 -1
- package/dts/alpha/select-chip/SelectChipControl.d.ts +3 -4
- package/dts/alpha/select-chip/SelectChipControl.d.ts.map +1 -1
- package/dts/alpha/tabbed-chips/TabbedChips.d.ts +8 -1
- package/dts/alpha/tabbed-chips/TabbedChips.d.ts.map +1 -1
- package/dts/buttons/AvatarButton.d.ts +7 -3
- package/dts/buttons/AvatarButton.d.ts.map +1 -1
- package/dts/buttons/Button.d.ts +11 -1
- package/dts/buttons/Button.d.ts.map +1 -1
- package/dts/buttons/IconButton.d.ts +18 -2
- package/dts/buttons/IconButton.d.ts.map +1 -1
- package/dts/cards/FeedCard.d.ts.map +1 -1
- package/dts/cards/NudgeCard.d.ts +1 -1
- package/dts/cards/UpsellCard.d.ts +1 -1
- package/dts/carousel/DefaultCarouselNavigation.d.ts +8 -0
- package/dts/carousel/DefaultCarouselNavigation.d.ts.map +1 -1
- package/dts/chips/Chip.d.ts +2 -2
- package/dts/chips/Chip.d.ts.map +1 -1
- package/dts/chips/ChipProps.d.ts +11 -1
- package/dts/chips/ChipProps.d.ts.map +1 -1
- package/dts/chips/MediaChip.d.ts.map +1 -1
- package/dts/controls/NativeInput.d.ts +2 -0
- package/dts/controls/NativeInput.d.ts.map +1 -1
- package/dts/controls/NativeTextArea.d.ts +8 -3
- package/dts/controls/NativeTextArea.d.ts.map +1 -1
- package/dts/controls/SearchInput.d.ts +5 -2
- package/dts/controls/SearchInput.d.ts.map +1 -1
- package/dts/controls/TextInput.d.ts +27 -4
- package/dts/controls/TextInput.d.ts.map +1 -1
- package/dts/dates/DateInput.d.ts +18 -3
- package/dts/dates/DateInput.d.ts.map +1 -1
- package/dts/dates/DatePicker.d.ts +13 -0
- package/dts/dates/DatePicker.d.ts.map +1 -1
- package/dts/pagination/DefaultPaginationNavigationTextButton.d.ts +1 -10
- package/dts/pagination/DefaultPaginationNavigationTextButton.d.ts.map +1 -1
- package/dts/tabs/Paddle.d.ts +7 -0
- package/dts/tabs/Paddle.d.ts.map +1 -1
- package/esm/alpha/select/DefaultSelectControl.js +70 -32
- package/esm/alpha/select/DefaultSelectDropdown.js +5 -2
- package/esm/alpha/select/Select.js +8 -1
- package/esm/alpha/select/types.js +8 -0
- package/esm/alpha/select-chip/SelectChip.js +14 -6
- package/esm/alpha/select-chip/SelectChipControl.js +2 -0
- package/esm/alpha/tabbed-chips/TabbedChips.js +10 -5
- package/esm/buttons/Button.js +47 -6
- package/esm/buttons/IconButton.js +31 -3
- package/esm/cards/CardBody.js +1 -1
- package/esm/cards/FeedCard.js +23 -8
- package/esm/cards/MessagingCard/MessagingCardLayout.js +2 -2
- package/esm/cards/NudgeCard.js +1 -1
- package/esm/cards/UpsellCard.js +2 -2
- package/esm/carousel/DefaultCarouselNavigation.js +10 -3
- package/esm/chips/Chip.js +24 -5
- package/esm/chips/MediaChip.js +7 -3
- package/esm/controls/NativeInput.js +3 -0
- package/esm/controls/SearchInput.js +15 -7
- package/esm/controls/TextInput.css +2 -2
- package/esm/controls/TextInput.js +37 -18
- package/esm/dates/DateInput.js +2 -1
- package/esm/dates/DatePicker.js +4 -2
- package/esm/overlays/Toast.js +1 -1
- package/esm/pagination/DefaultPaginationNavigationButton.js +1 -1
- package/esm/pagination/DefaultPaginationNavigationTextButton.js +3 -3
- package/esm/pagination/DefaultPaginationPageButton.js +1 -1
- package/esm/tabs/Paddle.js +3 -1
- package/esm/visualizations/ProgressContainerWithButtons.js +2 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../src/controls/SearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAOpE,OAAO,
|
|
1
|
+
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../src/controls/SearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAOpE,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,eAAO,MAAM,MAAM;;;CAGT,CAAC;AAEX,sEAAsE;AACtE,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC;AAE5C,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,kBAAkB,EAChB,mBAAmB,GACnB,oBAAoB,GACpB,yBAAyB,GACzB,UAAU,GACV,cAAc,GACd,SAAS,GACT,UAAU,GACV,kBAAkB,GAClB,oBAAoB,GACpB,uCAAuC,GACvC,MAAM,GACN,WAAW,GACX,YAAY,GACZ,aAAa,GACb,MAAM,GACN,QAAQ,GACR,WAAW,GACX,OAAO,CACV,GAAG;IACF;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC,CAAC;IACtD;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB;;OAEG;IACH,2BAA2B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD;;OAEG;IACH,2BAA2B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GACjD,cAAc,GAAG;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;CACnC,CAAC;AAEJ,eAAO,MAAM,WAAW,mGAsGvB,CAAC"}
|
|
@@ -2,8 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import type { SharedInputProps } from '@coinbase/cds-common/types/InputBaseProps';
|
|
3
3
|
import type { InputStackBaseProps } from './InputStack';
|
|
4
4
|
import { type NativeInputBaseProps, type NativeInputProps } from './NativeInput';
|
|
5
|
-
export type
|
|
6
|
-
|
|
5
|
+
export type TextInputSize = 's' | 'm' | 'l';
|
|
6
|
+
export type TextInputBaseProps = Omit<NativeInputBaseProps, 'caretColor' | 'compact'> &
|
|
7
|
+
Pick<
|
|
8
|
+
SharedInputProps,
|
|
9
|
+
'label' | 'labelFont' | 'labelColor' | 'placeholder' | 'helperText' | 'readOnly'
|
|
10
|
+
> &
|
|
7
11
|
Pick<
|
|
8
12
|
InputStackBaseProps,
|
|
9
13
|
| 'height'
|
|
@@ -12,7 +16,6 @@ export type TextInputBaseProps = Omit<NativeInputBaseProps, 'caretColor'> &
|
|
|
12
16
|
| 'disabled'
|
|
13
17
|
| 'borderRadius'
|
|
14
18
|
| 'enableColorSurge'
|
|
15
|
-
| 'labelVariant'
|
|
16
19
|
| 'inputBackground'
|
|
17
20
|
> & {
|
|
18
21
|
/**
|
|
@@ -27,6 +30,25 @@ export type TextInputBaseProps = Omit<NativeInputBaseProps, 'caretColor'> &
|
|
|
27
30
|
* Supplying a `ref` on the `inputNode` element is redundant; if present, it will be merged with the component's ref.
|
|
28
31
|
* */
|
|
29
32
|
inputNode?: React.ReactElement;
|
|
33
|
+
/**
|
|
34
|
+
* Controls overall density of the input field, inside of the border.
|
|
35
|
+
* @default 'l'
|
|
36
|
+
*/
|
|
37
|
+
size?: TextInputSize;
|
|
38
|
+
/**
|
|
39
|
+
* Enables compact variation. Prefer `size="s"` or `size="m"` with an explicit `labelVariant`.
|
|
40
|
+
*
|
|
41
|
+
* @deprecated Unset and use `size="s"` instead. This will be removed in a future major release.
|
|
42
|
+
* @deprecationExpectedRemoval v10
|
|
43
|
+
*/
|
|
44
|
+
compact?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Determines where the provided label/labelNode is rendered.
|
|
47
|
+
* By default, the label is rendered outisde, above the input element.
|
|
48
|
+
* When size is `l` (the default), an `inside` label is stacked vertically with the input; otherwise is rendered horizontally.
|
|
49
|
+
* @default 'outside'
|
|
50
|
+
*/
|
|
51
|
+
labelVariant?: InputStackBaseProps['labelVariant'];
|
|
30
52
|
/**
|
|
31
53
|
* Adds border to input.
|
|
32
54
|
* When set to `false`, focus border styling is disabled by default.
|
|
@@ -66,7 +88,8 @@ export type TextInputBaseProps = Omit<NativeInputBaseProps, 'caretColor'> &
|
|
|
66
88
|
*/
|
|
67
89
|
labelNode?: React.ReactNode;
|
|
68
90
|
};
|
|
69
|
-
export type TextInputProps = TextInputBaseProps &
|
|
91
|
+
export type TextInputProps = TextInputBaseProps &
|
|
92
|
+
Omit<NativeInputProps, 'caretColor' | 'compact' | 'size'>;
|
|
70
93
|
export declare const TextInput: React.NamedExoticComponent<
|
|
71
94
|
Omit<TextInputProps, 'ref'> & React.RefAttributes<HTMLInputElement>
|
|
72
95
|
>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/controls/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAgB,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAahG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAe,KAAK,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/controls/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAgB,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAahG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAe,KAAK,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAqD9F,MAAM,MAAM,aAAa,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAI5C,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,oBAAoB,EAAE,YAAY,GAAG,SAAS,CAAC,GACnF,IAAI,CACF,gBAAgB,EAChB,OAAO,GAAG,WAAW,GAAG,YAAY,GAAG,aAAa,GAAG,YAAY,GAAG,UAAU,CACjF,GACD,IAAI,CACF,mBAAmB,EACjB,QAAQ,GACR,SAAS,GACT,OAAO,GACP,UAAU,GACV,cAAc,GACd,kBAAkB,GAClB,iBAAiB,CACpB,GAAG;IACF;;;;;;;;;;SAUK;IACL,SAAS,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAC;IACnD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;IAC/D;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uHAAuH;IACvH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,mHAAmH;IACnH,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE;QACV,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF;;;OAGG;IACH,qCAAqC,CAAC,EAAE,MAAM,CAAC;IAC/C;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,SAAS,GAAG,MAAM,CAAC,CAAC;AAW5D,eAAO,MAAM,SAAS,iGAmSrB,CAAC"}
|
package/dts/dates/DateInput.d.ts
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type DateInputOptions } from '@coinbase/cds-common/dates/useDateInput';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
type TextInputBaseProps,
|
|
5
|
+
type TextInputProps,
|
|
6
|
+
type TextInputSize,
|
|
7
|
+
} from '../controls/TextInput';
|
|
4
8
|
export type DateInputBaseProps = Omit<DateInputOptions, 'intlDateFormat'> &
|
|
5
|
-
Omit<TextInputBaseProps, 'inputNode' | 'value' | 'defaultValue' | 'style'> & {
|
|
9
|
+
Omit<TextInputBaseProps, 'inputNode' | 'value' | 'defaultValue' | 'style' | 'compact'> & {
|
|
6
10
|
/** Date format separator character, e.g. the / in "MM/DD/YYYY". Defaults to forward slash (/). */
|
|
7
11
|
separator?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Controls the vertical density (size) of the input field.
|
|
14
|
+
* @default 'l'
|
|
15
|
+
*/
|
|
16
|
+
size?: TextInputSize;
|
|
17
|
+
/**
|
|
18
|
+
* Enables a smaller, compact input.
|
|
19
|
+
* @deprecated Use `size="s"` instead. This will be removed in a future major release.
|
|
20
|
+
* @deprecationExpectedRemoval v10
|
|
21
|
+
*/
|
|
22
|
+
compact?: boolean;
|
|
8
23
|
};
|
|
9
24
|
export type DateInputProps = DateInputBaseProps &
|
|
10
|
-
Omit<TextInputProps, 'inputNode' | 'value' | 'defaultValue' | 'style'> & {
|
|
25
|
+
Omit<TextInputProps, 'inputNode' | 'value' | 'defaultValue' | 'style' | 'compact'> & {
|
|
11
26
|
className?: string;
|
|
12
27
|
style?: React.CSSProperties;
|
|
13
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/dates/DateInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,yCAAyC,CAAC;AAG9F,OAAO,
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/dates/DateInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,yCAAyC,CAAC;AAG9F,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,uBAAuB,CAAC;AAI/B,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,GACvE,IAAI,CAAC,kBAAkB,EAAE,WAAW,GAAG,OAAO,GAAG,cAAc,GAAG,OAAO,GAAG,SAAS,CAAC,GAAG;IACvF,kGAAkG;IAClG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,OAAO,GAAG,cAAc,GAAG,OAAO,GAAG,SAAS,CAAC,GAAG;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAEJ,eAAO,MAAM,SAAS,iGAoGrB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DateInputValidationError } from '@coinbase/cds-common/dates/DateInputValidationError';
|
|
2
|
+
import type { TextInputSize } from '../controls/TextInput';
|
|
2
3
|
import { type PopoverProps } from '../overlays/popover/PopoverProps';
|
|
3
4
|
import { type CalendarBaseProps } from './Calendar';
|
|
4
5
|
import { type DateInputProps } from './DateInput';
|
|
@@ -47,6 +48,17 @@ export type DatePickerBaseProps = Pick<
|
|
|
47
48
|
* @default 'Close calendar'
|
|
48
49
|
*/
|
|
49
50
|
closeCalendarAccessibilityLabel?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Controls the vertical density (size) of the DatePicker's input field.
|
|
53
|
+
* @default 'l'
|
|
54
|
+
*/
|
|
55
|
+
size?: TextInputSize;
|
|
56
|
+
/**
|
|
57
|
+
* Enables a smaller, compact input.
|
|
58
|
+
* @deprecated Use `size="s"` instead. This will be removed in a future major release.
|
|
59
|
+
* @deprecationExpectedRemoval v10
|
|
60
|
+
*/
|
|
61
|
+
compact?: boolean;
|
|
50
62
|
};
|
|
51
63
|
export type DatePickerProps = DatePickerBaseProps &
|
|
52
64
|
Pick<PopoverProps, 'showOverlay'> &
|
|
@@ -61,6 +73,7 @@ export type DatePickerProps = DatePickerBaseProps &
|
|
|
61
73
|
| 'disabledDateError'
|
|
62
74
|
| 'className'
|
|
63
75
|
| 'style'
|
|
76
|
+
| 'compact'
|
|
64
77
|
> & {
|
|
65
78
|
/** Control the default open state of the Calendar popover. */
|
|
66
79
|
defaultOpen?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../src/dates/DatePicker.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../src/dates/DatePicker.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ButtonProps } from '../buttons/Button';
|
|
3
3
|
export declare const DefaultPaginationNavigationTextButton: React.ForwardRefExoticComponent<
|
|
4
|
-
Omit<
|
|
5
|
-
ButtonProps<
|
|
6
|
-
(<AsComponent extends React.ElementType = 'button'>(
|
|
7
|
-
props: ButtonProps<AsComponent>,
|
|
8
|
-
) => import('..').Polymorphic.ReactReturn) &
|
|
9
|
-
import('..').Polymorphic.ReactNamed
|
|
10
|
-
>,
|
|
11
|
-
'ref'
|
|
12
|
-
> &
|
|
13
|
-
React.RefAttributes<HTMLButtonElement>
|
|
4
|
+
Omit<ButtonProps, 'ref'> & React.RefAttributes<HTMLButtonElement>
|
|
14
5
|
>;
|
|
15
6
|
//# sourceMappingURL=DefaultPaginationNavigationTextButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultPaginationNavigationTextButton.d.ts","sourceRoot":"","sources":["../../src/pagination/DefaultPaginationNavigationTextButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,eAAO,MAAM,qCAAqC,
|
|
1
|
+
{"version":3,"file":"DefaultPaginationNavigationTextButton.d.ts","sourceRoot":"","sources":["../../src/pagination/DefaultPaginationNavigationTextButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,eAAO,MAAM,qCAAqC,oGA6BjD,CAAC"}
|
package/dts/tabs/Paddle.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { ThemeVars } from '@coinbase/cds-common/core/theme';
|
|
3
3
|
import type { SharedAccessibilityProps } from '@coinbase/cds-common/types/SharedAccessibilityProps';
|
|
4
4
|
import type { SharedProps } from '@coinbase/cds-common/types/SharedProps';
|
|
5
|
+
import { type IconButtonSize } from '../buttons/IconButton';
|
|
5
6
|
import type { TabLabelBaseProps } from '../tabs/TabLabel';
|
|
6
7
|
export declare const paddleWidth = 80;
|
|
7
8
|
export type PaddleProps = {
|
|
@@ -14,6 +15,11 @@ export type PaddleProps = {
|
|
|
14
15
|
* Web only. Styling for the paddle icon button. Mobile does not have paddles.
|
|
15
16
|
*/
|
|
16
17
|
paddleStyle?: React.CSSProperties;
|
|
18
|
+
/**
|
|
19
|
+
* Size of the paddle icon button, so the paddle can track the size of the
|
|
20
|
+
* content it scrolls. Defaults to the `IconButton` default size.
|
|
21
|
+
*/
|
|
22
|
+
size?: IconButtonSize;
|
|
17
23
|
} & SharedProps &
|
|
18
24
|
SharedAccessibilityProps;
|
|
19
25
|
/**
|
|
@@ -28,6 +34,7 @@ export declare const Paddle: {
|
|
|
28
34
|
testID,
|
|
29
35
|
accessibilityLabel,
|
|
30
36
|
paddleStyle,
|
|
37
|
+
size,
|
|
31
38
|
}: PaddleProps): import('react/jsx-runtime').JSX.Element;
|
|
32
39
|
displayName: string;
|
|
33
40
|
};
|
package/dts/tabs/Paddle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paddle.d.ts","sourceRoot":"","sources":["../../src/tabs/Paddle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"Paddle.d.ts","sourceRoot":"","sources":["../../src/tabs/Paddle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAK1E,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,eAAO,MAAM,WAAW,KAAK,CAAC;AAwB9B,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB,GAAG,WAAW,GACb,wBAAwB,CAAC;AA8B3B;;GAEG;AACH,eAAO,MAAM,MAAM;+FAShB,WAAW;;CAwDb,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["role", "type", "options", "value", "onChange", "open", "placeholder", "disabled", "readOnly", "setOpen", "variant", "helperText", "label", "labelVariant", "contentNode", "startNode", "endNode", "compact", "blendStyles", "align", "font", "labelColor", "labelFont", "bordered", "borderWidth", "focusedBorderWidth", "inputBackground", "borderRadius", "maxSelectedOptionsToShow", "hiddenSelectedOptionsLabel", "removeSelectedOptionAccessibilityLabel", "accessibilityLabel", "ariaHaspopup", "tabIndex", "onKeyDown", "styles", "classNames"];
|
|
1
|
+
const _excluded = ["role", "type", "options", "value", "onChange", "open", "placeholder", "disabled", "readOnly", "setOpen", "variant", "helperText", "label", "labelVariant", "contentNode", "startNode", "endNode", "compact", "size", "blendStyles", "align", "font", "labelColor", "labelFont", "bordered", "borderWidth", "focusedBorderWidth", "inputBackground", "borderRadius", "maxSelectedOptionsToShow", "hiddenSelectedOptionsLabel", "removeSelectedOptionAccessibilityLabel", "accessibilityLabel", "ariaHaspopup", "tabIndex", "onKeyDown", "styles", "classNames"];
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -19,7 +19,25 @@ import { Pressable } from '../../system/Pressable';
|
|
|
19
19
|
import { Text } from '../../typography/Text';
|
|
20
20
|
import { findClosestNonDisabledNodeIndex } from '../../utils/findClosestNonDisabledNodeIndex';
|
|
21
21
|
import { isSelectOptionGroup } from './Select';
|
|
22
|
+
import { defaultSelectSize } from './types';
|
|
22
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
const selectSizeVerticalSpaceVar = {
|
|
25
|
+
s: 'var(--space-1)',
|
|
26
|
+
m: 'var(--space-1_5)',
|
|
27
|
+
l: 'var(--space-2)'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// A multi-select's selected-value chips add their own height, so the vertical padding is
|
|
31
|
+
// tightened per size to keep the overall field height aligned with the single-select scale.
|
|
32
|
+
const multiSelectVerticalSpaceVar = {
|
|
33
|
+
s: 'var(--space-0_5)',
|
|
34
|
+
m: 'var(--space-1)',
|
|
35
|
+
l: 'var(--space-1_5)'
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// Multi-select value chips always use the compact `xs` size (even at size `l`) so several chips —
|
|
39
|
+
// and a stacked inside label — stay within the field's natural height.
|
|
40
|
+
const multiSelectValueChipSize = 'xs';
|
|
23
41
|
const noFocusOutlineCss = "noFocusOutlineCss-n1gl6kcn";
|
|
24
42
|
const selectedOptionChipContentCss = "selectedOptionChipContentCss-s1kle8pq";
|
|
25
43
|
const variantColor = {
|
|
@@ -50,6 +68,7 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
50
68
|
startNode,
|
|
51
69
|
endNode: customEndNode,
|
|
52
70
|
compact,
|
|
71
|
+
size,
|
|
53
72
|
blendStyles,
|
|
54
73
|
align = 'start',
|
|
55
74
|
font = 'body',
|
|
@@ -78,12 +97,23 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
78
97
|
setOpen(currentOpen => !currentOpen);
|
|
79
98
|
}, [isInteractionBlocked, setOpen]);
|
|
80
99
|
const isMultiSelect = type === 'multi';
|
|
81
|
-
//
|
|
82
|
-
const
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
const
|
|
86
|
-
const
|
|
100
|
+
// `size` wins over the deprecated `compact` for geometry.
|
|
101
|
+
const resolvedSize = size !== null && size !== void 0 ? size : compact ? 's' : defaultSelectSize;
|
|
102
|
+
// The deprecated `compact` only forces label placement when the caller did NOT set an explicit
|
|
103
|
+
// `size`; once `size` is provided, placement follows the normal `labelVariant` rules.
|
|
104
|
+
const useLegacyCompact = Boolean(compact) && size === undefined;
|
|
105
|
+
const labelVariant = useLegacyCompact ? undefined : labelVariantProp;
|
|
106
|
+
const hasLabel = !!label;
|
|
107
|
+
|
|
108
|
+
// Label placement mirrors TextInput: `compact` (set alone) forces an inside label; otherwise
|
|
109
|
+
// placement follows `labelVariant`. An inside label sits horizontally in the start slot at every
|
|
110
|
+
// size EXCEPT `l`, where it stacks vertically above the value. Multi-select is the one exception:
|
|
111
|
+
// its value chips can't share a row with an inline label, so legacy compact multi-select keeps
|
|
112
|
+
// its label outside (only an explicit `inside` labelVariant places a multi-select's label inside).
|
|
113
|
+
const isCompactLabel = useLegacyCompact && !isMultiSelect;
|
|
114
|
+
const wantsInsideLabel = hasLabel && (isCompactLabel || labelVariant === 'inside');
|
|
115
|
+
const insideVerticalLabel = wantsInsideLabel && !isCompactLabel && resolvedSize === 'l';
|
|
116
|
+
const insideHorizontalLabel = wantsInsideLabel && !insideVerticalLabel;
|
|
87
117
|
const hasValue = value !== null && !(Array.isArray(value) && value.length === 0);
|
|
88
118
|
// Map of options to their values
|
|
89
119
|
// If multiple options share the same value, the first occurrence wins (matches native HTML select behavior)
|
|
@@ -175,7 +205,7 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
175
205
|
children: helperText
|
|
176
206
|
}) : helperText, [helperText, variant, classNames === null || classNames === void 0 ? void 0 : classNames.controlHelperTextNode, styles === null || styles === void 0 ? void 0 : styles.controlHelperTextNode]);
|
|
177
207
|
const labelNode = useMemo(() => {
|
|
178
|
-
if (
|
|
208
|
+
if (insideVerticalLabel || insideHorizontalLabel) return null;
|
|
179
209
|
if (typeof label === 'string') {
|
|
180
210
|
return /*#__PURE__*/_jsx(InputLabel, {
|
|
181
211
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.controlLabelNode,
|
|
@@ -187,9 +217,9 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
187
217
|
});
|
|
188
218
|
}
|
|
189
219
|
return label;
|
|
190
|
-
}, [
|
|
220
|
+
}, [insideVerticalLabel, insideHorizontalLabel, classNames === null || classNames === void 0 ? void 0 : classNames.controlLabelNode, styles === null || styles === void 0 ? void 0 : styles.controlLabelNode, label, labelColor, labelFont]);
|
|
191
221
|
const inlineLabelNode = useMemo(() => {
|
|
192
|
-
if (!
|
|
222
|
+
if (!insideVerticalLabel && !insideHorizontalLabel) return null;
|
|
193
223
|
if (typeof label === 'string') {
|
|
194
224
|
return /*#__PURE__*/_jsx(InputLabel, {
|
|
195
225
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.controlLabelNode,
|
|
@@ -201,7 +231,7 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
201
231
|
});
|
|
202
232
|
}
|
|
203
233
|
return label;
|
|
204
|
-
}, [
|
|
234
|
+
}, [insideVerticalLabel, insideHorizontalLabel, classNames === null || classNames === void 0 ? void 0 : classNames.controlLabelNode, styles === null || styles === void 0 ? void 0 : styles.controlLabelNode, label, labelColor, labelFont]);
|
|
205
235
|
const valueNode = useMemo(() => {
|
|
206
236
|
if (hasValue && isMultiSelect) {
|
|
207
237
|
const valuesToShow = value.length <= maxSelectedOptionsToShow ? value : value.slice(0, maxSelectedOptionsToShow);
|
|
@@ -213,7 +243,6 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
213
243
|
var _option$value, _ref6, _ref7, _option$label2;
|
|
214
244
|
const accessibilityLabel = typeof option.label === 'string' ? option.label : typeof option.description === 'string' ? option.description : (_option$value = option.value) !== null && _option$value !== void 0 ? _option$value : '';
|
|
215
245
|
return /*#__PURE__*/_jsx(InputChip, {
|
|
216
|
-
compact: true,
|
|
217
246
|
"data-selected-value": true,
|
|
218
247
|
accessibilityLabel: "".concat(removeSelectedOptionAccessibilityLabel, " ").concat(accessibilityLabel),
|
|
219
248
|
borderWidth: 0,
|
|
@@ -224,19 +253,14 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
224
253
|
invertColorScheme: false,
|
|
225
254
|
maxWidth: 200,
|
|
226
255
|
onClick: isInteractionBlocked ? undefined : event => handleUnselectValue(event, index),
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
flexShrink: 1,
|
|
230
|
-
font: "label1",
|
|
231
|
-
overflow: "truncate",
|
|
232
|
-
children: (_ref6 = (_ref7 = (_option$label2 = option.label) !== null && _option$label2 !== void 0 ? _option$label2 : option.description) !== null && _ref7 !== void 0 ? _ref7 : option.value) !== null && _ref6 !== void 0 ? _ref6 : ''
|
|
233
|
-
})
|
|
256
|
+
size: multiSelectValueChipSize,
|
|
257
|
+
children: (_ref6 = (_ref7 = (_option$label2 = option.label) !== null && _option$label2 !== void 0 ? _option$label2 : option.description) !== null && _ref7 !== void 0 ? _ref7 : option.value) !== null && _ref6 !== void 0 ? _ref6 : ''
|
|
234
258
|
}, option.value);
|
|
235
259
|
}), value.length - maxSelectedOptionsToShow > 0 && /*#__PURE__*/_jsx(InputChip, {
|
|
236
|
-
compact: true,
|
|
237
260
|
borderWidth: 0,
|
|
238
261
|
end: null,
|
|
239
262
|
invertColorScheme: false,
|
|
263
|
+
size: multiSelectValueChipSize,
|
|
240
264
|
children: "+".concat(value.length - maxSelectedOptionsToShow, " ").concat(hiddenSelectedOptionsLabel)
|
|
241
265
|
})]
|
|
242
266
|
});
|
|
@@ -283,11 +307,12 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
283
307
|
paddingEnd: 2,
|
|
284
308
|
style: styles === null || styles === void 0 ? void 0 : styles.controlStartNode,
|
|
285
309
|
children: startNode
|
|
286
|
-
}),
|
|
310
|
+
}), insideHorizontalLabel ? /*#__PURE__*/_jsx(HStack, {
|
|
287
311
|
alignItems: "center",
|
|
312
|
+
flexShrink: 0,
|
|
288
313
|
paddingEnd: 1,
|
|
289
314
|
children: inlineLabelNode
|
|
290
|
-
}) : null,
|
|
315
|
+
}) : null, insideVerticalLabel ? /*#__PURE__*/_jsxs(VStack, {
|
|
291
316
|
flexGrow: 1,
|
|
292
317
|
minWidth: 0,
|
|
293
318
|
width: "100%",
|
|
@@ -334,7 +359,7 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
334
359
|
children: [valueNode, contentNode]
|
|
335
360
|
})
|
|
336
361
|
})]
|
|
337
|
-
}), [computedControlAccessibilityLabel, ariaHaspopup, open, role, interactableBlendStyles, classNames === null || classNames === void 0 ? void 0 : classNames.controlInputNode, classNames === null || classNames === void 0 ? void 0 : classNames.controlStartNode, classNames === null || classNames === void 0 ? void 0 : classNames.controlValueNode, disabled, readOnly, styles === null || styles === void 0 ? void 0 : styles.controlInputNode, styles === null || styles === void 0 ? void 0 : styles.controlStartNode, styles === null || styles === void 0 ? void 0 : styles.controlValueNode, tabIndex, onKeyDown, startNode,
|
|
362
|
+
}), [computedControlAccessibilityLabel, ariaHaspopup, open, role, interactableBlendStyles, classNames === null || classNames === void 0 ? void 0 : classNames.controlInputNode, classNames === null || classNames === void 0 ? void 0 : classNames.controlStartNode, classNames === null || classNames === void 0 ? void 0 : classNames.controlValueNode, disabled, readOnly, styles === null || styles === void 0 ? void 0 : styles.controlInputNode, styles === null || styles === void 0 ? void 0 : styles.controlStartNode, styles === null || styles === void 0 ? void 0 : styles.controlValueNode, tabIndex, onKeyDown, startNode, insideHorizontalLabel, insideVerticalLabel, inlineLabelNode, align, valueNode, contentNode, handleToggleOpen]);
|
|
338
363
|
const endNode = useMemo(() => /*#__PURE__*/_jsx(Pressable, {
|
|
339
364
|
"aria-hidden": true,
|
|
340
365
|
flexShrink: 0,
|
|
@@ -345,7 +370,7 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
345
370
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.controlEndNode,
|
|
346
371
|
flexGrow: 1,
|
|
347
372
|
height: "100%",
|
|
348
|
-
justifyContent:
|
|
373
|
+
justifyContent: insideVerticalLabel ? 'flex-end' : undefined,
|
|
349
374
|
paddingStart: 2,
|
|
350
375
|
style: styles === null || styles === void 0 ? void 0 : styles.controlEndNode,
|
|
351
376
|
children: customEndNode ? customEndNode : /*#__PURE__*/_jsx(AnimatedCaret, {
|
|
@@ -353,13 +378,26 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
353
378
|
rotate: open ? 0 : 180
|
|
354
379
|
})
|
|
355
380
|
})
|
|
356
|
-
}), [classNames === null || classNames === void 0 ? void 0 : classNames.controlEndNode,
|
|
357
|
-
const inputStackStyles = useMemo(() =>
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
381
|
+
}), [classNames === null || classNames === void 0 ? void 0 : classNames.controlEndNode, insideVerticalLabel, styles === null || styles === void 0 ? void 0 : styles.controlEndNode, customEndNode, open, handleToggleOpen]);
|
|
382
|
+
const inputStackStyles = useMemo(() => {
|
|
383
|
+
let verticalSpaceVar;
|
|
384
|
+
if (insideVerticalLabel) {
|
|
385
|
+
// A vertically-stacked inside label (size `l`) tightens the padding so the stacked label +
|
|
386
|
+
// value fit the same 58px field an outside label produces. A multi-select with chips
|
|
387
|
+
// (taller than a single text line) tightens further.
|
|
388
|
+
verticalSpaceVar = isMultiSelect && hasValue ? 'var(--space-0_25)' : 'var(--space-0_75)';
|
|
389
|
+
} else if (isMultiSelect && hasValue) {
|
|
390
|
+
verticalSpaceVar = multiSelectVerticalSpaceVar[resolvedSize];
|
|
391
|
+
} else {
|
|
392
|
+
verticalSpaceVar = selectSizeVerticalSpaceVar[resolvedSize];
|
|
393
|
+
}
|
|
394
|
+
return {
|
|
395
|
+
paddingTop: verticalSpaceVar,
|
|
396
|
+
paddingBottom: verticalSpaceVar,
|
|
397
|
+
paddingLeft: 'var(--space-2)',
|
|
398
|
+
paddingRight: 'var(--space-2)'
|
|
399
|
+
};
|
|
400
|
+
}, [insideVerticalLabel, resolvedSize, isMultiSelect, hasValue]);
|
|
363
401
|
return /*#__PURE__*/_jsx(InputStack, _objectSpread({
|
|
364
402
|
ref: ref,
|
|
365
403
|
blendStyles: interactableBlendStyles,
|
|
@@ -374,7 +412,7 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
374
412
|
inputBackground: inputBackground,
|
|
375
413
|
inputNode: inputNode,
|
|
376
414
|
labelNode: labelNode,
|
|
377
|
-
labelVariant:
|
|
415
|
+
labelVariant: insideVerticalLabel ? 'inside' : 'outside',
|
|
378
416
|
styles: {
|
|
379
417
|
input: inputStackStyles
|
|
380
418
|
},
|
|
@@ -219,10 +219,13 @@ const DefaultSelectDropdownComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef
|
|
|
219
219
|
compact: compact,
|
|
220
220
|
disabled: disabled,
|
|
221
221
|
end: end !== null && end !== void 0 ? end : /*#__PURE__*/_jsx(Button, {
|
|
222
|
-
compact: true,
|
|
223
222
|
transparent: true,
|
|
224
223
|
onClick: handleClearAll,
|
|
225
|
-
role: "option"
|
|
224
|
+
role: "option"
|
|
225
|
+
// Intentionally always the densest size: the dropdown's inline
|
|
226
|
+
// affordances stay compact regardless of the control's size.
|
|
227
|
+
,
|
|
228
|
+
size: "s",
|
|
226
229
|
style: {
|
|
227
230
|
margin: 'var(--space-0_5)'
|
|
228
231
|
},
|
|
@@ -18,6 +18,7 @@ import { DefaultSelectDropdown } from './DefaultSelectDropdown';
|
|
|
18
18
|
import { DefaultSelectEmptyDropdownContents } from './DefaultSelectEmptyDropdownContents';
|
|
19
19
|
import { DefaultSelectOption } from './DefaultSelectOption';
|
|
20
20
|
import { DefaultSelectOptionGroup } from './DefaultSelectOptionGroup';
|
|
21
|
+
import { defaultSelectSize } from './types';
|
|
21
22
|
|
|
22
23
|
// Re-export all types for backward compatibility
|
|
23
24
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -42,6 +43,7 @@ const SelectBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
|
42
43
|
placeholder,
|
|
43
44
|
helperText,
|
|
44
45
|
compact,
|
|
46
|
+
size,
|
|
45
47
|
label,
|
|
46
48
|
labelVariant,
|
|
47
49
|
accessibilityLabel = typeof label === 'string' ? label : 'Select dropdown',
|
|
@@ -83,6 +85,10 @@ const SelectBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
|
83
85
|
testID
|
|
84
86
|
} = mergedProps;
|
|
85
87
|
const hasMounted = useHasMounted();
|
|
88
|
+
// The dropdown keeps a binary density toggle instead of the t-shirt scale, so Select owns
|
|
89
|
+
// the translation: only the smallest control size renders a compact dropdown. The control
|
|
90
|
+
// still receives the raw `compact` because it needs it for legacy label placement.
|
|
91
|
+
const dropdownCompact = (size !== null && size !== void 0 ? size : compact ? 's' : defaultSelectSize) === 's';
|
|
86
92
|
const [openInternal, setOpenInternal] = useState(defaultOpen !== null && defaultOpen !== void 0 ? defaultOpen : false);
|
|
87
93
|
const open = openProp !== null && openProp !== void 0 ? openProp : openInternal;
|
|
88
94
|
const setOpen = setOpenProp !== null && setOpenProp !== void 0 ? setOpenProp : setOpenInternal;
|
|
@@ -213,6 +219,7 @@ const SelectBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
|
213
219
|
readOnly: readOnly,
|
|
214
220
|
removeSelectedOptionAccessibilityLabel: removeSelectedOptionAccessibilityLabel,
|
|
215
221
|
setOpen: setOpen,
|
|
222
|
+
size: size,
|
|
216
223
|
startNode: startNode,
|
|
217
224
|
style: styles === null || styles === void 0 ? void 0 : styles.control,
|
|
218
225
|
styles: controlStyles,
|
|
@@ -232,7 +239,7 @@ const SelectBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
|
232
239
|
accessory: accessory,
|
|
233
240
|
classNames: dropdownClassNames,
|
|
234
241
|
clearAllLabel: clearAllLabel,
|
|
235
|
-
compact:
|
|
242
|
+
compact: dropdownCompact,
|
|
236
243
|
controlRef: refs.reference,
|
|
237
244
|
disabled: disabled,
|
|
238
245
|
emptyOptionsLabel: emptyOptionsLabel,
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* T-shirt size scale for the Select control. The Figma Select component set exposes
|
|
3
|
+
* three sizes (`s | m | l`); there is intentionally no `xs`.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** Size the Select control resolves to when neither `size` nor the deprecated `compact` is set. */
|
|
7
|
+
export const defaultSelectSize = 'l';
|
|
8
|
+
|
|
1
9
|
/**
|
|
2
10
|
* Configuration for a single option in the Select component
|
|
3
11
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["invertColorScheme", "numberOfLines", "maxWidth", "displayValue"];
|
|
1
|
+
const _excluded = ["invertColorScheme", "numberOfLines", "maxWidth", "displayValue", "size", "compact"];
|
|
2
2
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -21,15 +21,19 @@ function createSelectChipControlWrapper(_ref) {
|
|
|
21
21
|
invertColorScheme,
|
|
22
22
|
numberOfLines,
|
|
23
23
|
maxWidth,
|
|
24
|
-
displayValue
|
|
24
|
+
displayValue,
|
|
25
|
+
size,
|
|
26
|
+
compact
|
|
25
27
|
} = _ref;
|
|
26
28
|
return /*#__PURE__*/memo(/*#__PURE__*/forwardRef((controlProps, controlRef) => {
|
|
27
29
|
return /*#__PURE__*/_jsx(SelectChipControl, _objectSpread(_objectSpread({}, controlProps), {}, {
|
|
28
30
|
ref: controlRef,
|
|
31
|
+
compact: compact,
|
|
29
32
|
displayValue: displayValue,
|
|
30
33
|
invertColorScheme: invertColorScheme,
|
|
31
34
|
maxWidth: maxWidth,
|
|
32
|
-
numberOfLines: numberOfLines
|
|
35
|
+
numberOfLines: numberOfLines,
|
|
36
|
+
size: size
|
|
33
37
|
}));
|
|
34
38
|
}));
|
|
35
39
|
}
|
|
@@ -44,15 +48,19 @@ const SelectChipComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, r
|
|
|
44
48
|
invertColorScheme,
|
|
45
49
|
numberOfLines,
|
|
46
50
|
maxWidth,
|
|
47
|
-
displayValue
|
|
51
|
+
displayValue,
|
|
52
|
+
size,
|
|
53
|
+
compact
|
|
48
54
|
} = mergedProps,
|
|
49
55
|
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
50
56
|
const WrappedSelectChipControl = useMemo(() => createSelectChipControlWrapper({
|
|
51
57
|
invertColorScheme,
|
|
52
58
|
numberOfLines,
|
|
53
59
|
maxWidth,
|
|
54
|
-
displayValue
|
|
55
|
-
|
|
60
|
+
displayValue,
|
|
61
|
+
size,
|
|
62
|
+
compact
|
|
63
|
+
}), [displayValue, invertColorScheme, numberOfLines, maxWidth, size, compact]);
|
|
56
64
|
return /*#__PURE__*/_jsx(Select, _objectSpread({
|
|
57
65
|
ref: ref,
|
|
58
66
|
SelectControlComponent: WrappedSelectChipControl,
|
|
@@ -21,6 +21,7 @@ const SelectChipControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_r
|
|
|
21
21
|
hiddenSelectedOptionsLabel = 'more',
|
|
22
22
|
label,
|
|
23
23
|
compact,
|
|
24
|
+
size,
|
|
24
25
|
invertColorScheme,
|
|
25
26
|
numberOfLines,
|
|
26
27
|
disabled,
|
|
@@ -112,6 +113,7 @@ const SelectChipControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_r
|
|
|
112
113
|
maxWidth: maxWidth,
|
|
113
114
|
numberOfLines: numberOfLines,
|
|
114
115
|
onClick: () => setOpen(s => !s),
|
|
116
|
+
size: size,
|
|
115
117
|
start: startNode,
|
|
116
118
|
style: style,
|
|
117
119
|
children: labelContent
|