pixelize-design-library 2.4.2-beta.51 → 2.4.2-beta.53
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 +11 -4
- package/COMPONENT-GOTCHAS.md +3 -2
- package/DESIGN-GUIDE.md +1 -1
- package/dist/Components/AppSwitcher/AppSwitcher.js +2 -1
- package/dist/Components/Button/ButtonProps.d.ts +1 -1
- package/dist/Components/DatePicker/DatePickerProps.d.ts +1 -1
- package/dist/Components/Input/PhoneNumberInput.js +1 -1
- package/dist/Components/Input/PhoneNumberInputProps.d.ts +1 -0
- package/dist/Components/Input/TextInputProps.d.ts +1 -1
- package/dist/Components/MultiSelect/MultiSelectProps.d.ts +1 -1
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +4 -3
- package/dist/Components/PinInput/PinInputProps.d.ts +1 -1
- package/dist/Components/Search/SearchProps.d.ts +1 -1
- package/dist/Components/SearchSelect/SearchSelectProps.d.ts +1 -1
- package/dist/Components/SegmentedControl/SegmentedControlProps.d.ts +1 -1
- package/dist/Components/Select/SelectProps.d.ts +1 -1
- package/dist/Components/SelectSearch/SelectSearchProps.d.ts +1 -1
- package/dist/Components/SelectV2/SelectV2Props.d.ts +1 -1
- package/dist/Theme/tokens/primitives/controlSizes.js +3 -3
- package/dist/Theme/tokens/primitives/optionRowSizes.js +6 -6
- package/dist/esm/Components/AppSwitcher/AppSwitcher.js +2 -1
- package/dist/esm/Components/Input/PhoneNumberInput.js +1 -1
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +4 -3
- package/dist/esm/Theme/tokens/primitives/controlSizes.js +3 -3
- package/dist/esm/Theme/tokens/primitives/optionRowSizes.js +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -47,12 +47,19 @@ next major.
|
|
|
47
47
|
|
|
48
48
|
### Changed
|
|
49
49
|
|
|
50
|
-
- **Control heights: `xs` 24px →
|
|
50
|
+
- **Control heights: `xs` 24px → 30px, `sm` 32px → 38px, `md` 40px → 42px.** `lg` (48px) is
|
|
51
51
|
unchanged. `CONTROL_SIZES` is the one scale behind every field, select and button, so `Button`,
|
|
52
52
|
`TextInput`, `InputTextArea`, `NumberInput`, `PinInput`, `Select`, `SelectV2`, `SearchSelect`,
|
|
53
|
-
`SelectSearch`, `Search`, `Dropdown`, `SegmentedControl`
|
|
54
|
-
together and still line up side by side. `sm` is the default size,
|
|
55
|
-
height without passing anything.
|
|
53
|
+
`SelectSearch`, `Search`, `Dropdown`, `SegmentedControl`, `Tabs`, `TableToggle` and the
|
|
54
|
+
`DatePicker` family all grow together and still line up side by side. `sm` is the default size,
|
|
55
|
+
so most call sites gain 6px of height without passing anything.
|
|
56
|
+
- **`PhoneNumberInput` defaults to `size="sm"`, not `md`.** It was the one field still defaulting to `md`, so in a form it stood 4px taller than the `TextInput`s around it. Pass `size="md"` to keep the old height.
|
|
57
|
+
- **Option rows follow the scale: 24/30/34/40px → 26/32/36/40px** in `Select`, `SelectV2`,
|
|
58
|
+
`SearchSelect`, `SelectSearch`, `Dropdown`, table filter selects and Chakra `MenuItem` — always
|
|
59
|
+
6px inside the trigger that opens them (4px at `lg`).
|
|
60
|
+
- **`OrgSwitcher` and `AppSwitcher` sit on the control scale.** `OrgSwitcher` sm/md/lg were
|
|
61
|
+
32/40/48px and are now 38/42/48px; the `AppSwitcher` trigger was 36px and is now 38px, so both
|
|
62
|
+
line up with an `sm` button beside them.
|
|
56
63
|
|
|
57
64
|
- **`SideBar` sizing is one scale.** Rail, submenu, collapsed flyout and `SecondaryBar` rows now all
|
|
58
65
|
read `SIDEBAR_ROW`, so every nav label is 13px at every level. Visible changes: submenu and flyout
|
package/COMPONENT-GOTCHAS.md
CHANGED
|
@@ -312,7 +312,7 @@ not enough when the overlay sits inside a transition wrapper — the wrapper kee
|
|
|
312
312
|
|
|
313
313
|
| Component | beta.43 → beta.44 | Restore the old look |
|
|
314
314
|
| --- | --- | --- |
|
|
315
|
-
| Fields, selects, buttons (`Button`, `TextInput`, `InputTextArea`, `NumberInput`, DatePicker family, `Select`, `SelectV2`, `SearchSelect`, `SelectSearch`, `Search`, `Dropdown`, `SegmentedControl`) | Default size `md` → `sm` (
|
|
315
|
+
| Fields, selects, buttons (`Button`, `TextInput`, `InputTextArea`, `NumberInput`, DatePicker family, `Select`, `SelectV2`, `SearchSelect`, `SelectSearch`, `Search`, `Dropdown`, `SegmentedControl`) | Default size `md` → `sm` (38px). One scale for all: xs 30 / sm 38 / md 42 / lg 48 — the same height in every field, select and button. `TimePicker` has no `size` (fixed `sm`); `SegmentedControl` has no `xs` | `size="md"` |
|
|
316
316
|
| `Button` | Text one step smaller (sm 14→13px, md 16→14, lg 18→16). Busy = spinner only, width kept (was "Loading" + spinner). Outline: 1px border, hover is a tint, not a fill | `loadingText="Loading"` |
|
|
317
317
|
| `Tag` | `solid`/`md` → `subtle`/`sm`. Hover + pointer only with `onTagClick`; `maxW` truncates with the full text as a title. Exact heights 20/24/28/32, weight 500, 1px inset ring (never adds height); subtle is a light tint with ink ≥ 6.5:1 | `variant="solid" size="md"` |
|
|
318
318
|
| `resolveSoftTone` | `bg`/`border` are now translucent (alpha hex) — composite onto the surface before `contrastRatio`; optional 3rd `surface` arg; adds `hoverBg`/`activeBg`. Badge/Alert/Toaster/EmptyState follow | — |
|
|
@@ -330,6 +330,7 @@ not enough when the overlay sits inside a transition wrapper — the wrapper kee
|
|
|
330
330
|
| `SettingsSection` | New optional `action` slot, right of the title/description on the header row — additive, nothing changes without it | — |
|
|
331
331
|
| `Button` / `Buttons` | Icon-only buttons are square. `Buttons` (plural) is themed instead of hardcoded purple | — |
|
|
332
332
|
| `ProgressBar` | Fill lifted to ≥ 3:1 on its track — green/orange/blue/cyan are visibly darker in light mode | — |
|
|
333
|
+
| `PhoneNumberInput` | Default `size` `md` → `sm`, so it matches the `TextInput`s beside it | `size="md"` |
|
|
333
334
|
| `PhoneNumberInput` / `PinInput` / `NoteTextArea` | `ref` now attaches; labels bound; PIN digits grouped and named | — |
|
|
334
335
|
| `RangeDatePicker` | Outside click keeps a fully picked range (was discarded) | — |
|
|
335
336
|
| `FilePreview` / `ContactForm` | Radius `2xl` → `xl` | — |
|
|
@@ -358,7 +359,7 @@ not enough when the overlay sits inside a transition wrapper — the wrapper kee
|
|
|
358
359
|
| `Tag` | Label line-height 1.45 so descenders (`p`, `g`, `y`) are no longer clipped by the ellipsis overflow | — |
|
|
359
360
|
| `Toaster` | `error` toasts announce assertively (`role="alert"`); status icons have a text equivalent | — |
|
|
360
361
|
| `FeedbackForm` | Built on `TextInput`/`InputTextArea`/`RadioButtonGroup`; required fields show `*` in the label | — |
|
|
361
|
-
| `PinInput` | `size` now works (square cells
|
|
362
|
+
| `PinInput` | `size` now works (square cells 30 / 38 / 42 / 48, default `sm`) — it was silently ignored | `size="md"` |
|
|
362
363
|
| `Tag` | New `leadingIcon` (decorative, before the label) and `isDisabled` (sets `aria-disabled` + native `disabled` on the clickable/remove buttons, so they leave the tab order — not just dimmed) | — |
|
|
363
364
|
| `ToolTip` | Defaults a Popper `preventOverflow` padding of 8px, so a bubble near the right edge no longer overhangs by a subpixel and raises page scrollbars. A caller-supplied `preventOverflow` modifier still wins | pass your own `modifiers` |
|
|
364
365
|
| `Table` / `KanbanBoard` | Column sort buttons and draggable cards now show the library focus ring on keyboard focus (was an opacity flicker / the browser default outline). Kanban card wrappers render as Chakra `Box`; keyboard drag (Space, arrows, Space) is unchanged | — |
|
package/DESIGN-GUIDE.md
CHANGED
|
@@ -89,7 +89,7 @@ don't lean on that pair to distinguish two categories; reach for a utility schem
|
|
|
89
89
|
|
|
90
90
|
## 5. Controls — one scale, `sm` by default
|
|
91
91
|
|
|
92
|
-
Every control shares one height scale — `xs`
|
|
92
|
+
Every control shares one height scale — `xs` 30px · `sm` 38px · `md` 42px · `lg` 48px — and
|
|
93
93
|
**defaults to `sm`**: `Button`, `TextInput`, `InputTextArea`, `NumberInput`, `Select`, `Search`,
|
|
94
94
|
`RangeSlider`, the `DatePicker` family and `SegmentedControl`. So on a desktop page **don't pass `size`**; controls
|
|
95
95
|
side by side line up. Nothing in a toolbar or table row is taller than the fields beside it.
|
|
@@ -46,9 +46,10 @@ const useExclusiveOverlay_1 = require("../../Hooks/useExclusiveOverlay");
|
|
|
46
46
|
const AppMark_1 = __importStar(require("./AppMark"));
|
|
47
47
|
const AppSwitcherProps_1 = require("./AppSwitcherProps");
|
|
48
48
|
const useAppSwitcherShortcut_1 = require("./useAppSwitcherShortcut");
|
|
49
|
+
const controlSizes_1 = require("../../Theme/tokens/primitives/controlSizes");
|
|
49
50
|
const COLUMNS = 2;
|
|
50
51
|
const HEADING = "Your apps";
|
|
51
|
-
const s = { trigger:
|
|
52
|
+
const s = { trigger: controlSizes_1.CONTROL_SIZES.sm.height, mark: "32px", icon: 17, name: "0.875rem", sub: "0.75rem", row: "52px" };
|
|
52
53
|
const warned = new Set();
|
|
53
54
|
const warnOnce = (key, message) => {
|
|
54
55
|
if (process.env.NODE_ENV === "production" || warned.has(key))
|
|
@@ -11,7 +11,7 @@ export type ButtonProps = LayoutProps & DataAttributes & Pick<ChakraButtonProps,
|
|
|
11
11
|
loadingText?: string;
|
|
12
12
|
/** Defaults to "fit-content", not 100%; the w alias only applies when width is unset — width wins if both are passed. */
|
|
13
13
|
width?: string | number;
|
|
14
|
-
/** Control height xs
|
|
14
|
+
/** Control height xs 30 · sm 38 · md 42 · lg 48 (xl 56); defaults to "sm" via the theme, so a ButtonGroup size still applies. */
|
|
15
15
|
size?: "lg" | "md" | "sm" | "xs" | "xl";
|
|
16
16
|
/** Defaults to "solid"; "gradient" paints the theme's fixed brand gradient. */
|
|
17
17
|
variant?: "solid" | "outline" | "ghost" | "link" | "unstyled" | "gradient";
|
|
@@ -44,7 +44,7 @@ export type BaseDatePickerProps = {
|
|
|
44
44
|
width?: string | number;
|
|
45
45
|
/** Blocks today in the calendar and in typed input; the single picker preselects tomorrow instead. */
|
|
46
46
|
disableToday?: boolean;
|
|
47
|
-
/** Control-scale height: xs
|
|
47
|
+
/** Control-scale height: xs 30 · sm 38 · md 42 · lg 48px (default `sm`, like TextInput); also scales the calendar/clock icon. */
|
|
48
48
|
size?: "xs" | "sm" | "md" | "lg";
|
|
49
49
|
};
|
|
50
50
|
/** Single-date variant, Date API (default) — `isRange` must be false or omitted; this is the discriminant the DatePickerProps union switches on. */
|
|
@@ -21,7 +21,7 @@ const getFlagEmoji = (countryCode) => {
|
|
|
21
21
|
const sizeToPt = { xs: 2, sm: -1, md: 2, lg: 4 };
|
|
22
22
|
const sizeToWidth = { xs: "3.5rem", sm: "3.8rem", md: "4rem", lg: "4rem" };
|
|
23
23
|
/** Country-code-aware phone field with a flag/dial-code prefix; `ref` forwards to the number `<input>`. */
|
|
24
|
-
const PhoneNumberInput = (0, react_1.forwardRef)(function PhoneNumberInput({ size = "
|
|
24
|
+
const PhoneNumberInput = (0, react_1.forwardRef)(function PhoneNumberInput({ size = "sm", value, codeValueReturn = true, country, countries, placeholder = "Enter phone number", onChange, inputId, selectId, error, errorMessage, helperText, label, id, width = "100%", isInformation, informationMessage, isRequired, onBlur, onFocus, isReadOnly, height, autoComplete, showCountrySelect = true, name, minW, maxW, countrySelectAriaLabel = "Country code", ...rest }, ref) {
|
|
25
25
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
26
26
|
const ids = (0, useFieldIds_1.useFieldIds)(inputId !== null && inputId !== void 0 ? inputId : id, { error, errorMessage, helperText });
|
|
27
27
|
const getCountryTelCode = (0, react_1.useCallback)((countryCode) => {
|
|
@@ -10,6 +10,7 @@ export type PhoneNumberInputProps = {
|
|
|
10
10
|
label?: string;
|
|
11
11
|
/** Falls back to an auto-generated id (shared with `inputId` when that's omitted too), so the label is always bound. */
|
|
12
12
|
id?: string;
|
|
13
|
+
/** Control-scale height: "xs" | "sm" | "md" | "lg" (30 / 38 / 42 / 48px). Defaults to "sm", like TextInput, so it lines up in a form. */
|
|
13
14
|
size?: string;
|
|
14
15
|
value?: string;
|
|
15
16
|
codeValueReturn?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputProps, SystemProps } from "@chakra-ui/react";
|
|
2
2
|
import type { CSSProperties, ReactNode } from "react";
|
|
3
|
-
/** The library's primary single-line text field (default size `sm`,
|
|
3
|
+
/** The library's primary single-line text field (default size `sm`, 38px; no default placeholder). `type="password"` auto-renders a show/hide toggle unless `inputRightIcon` is set or `isPasswordToggleDisabled` is true. Inside a consumer's own `FormControl`, it detects the ancestor and skips rendering its own, inheriting id/invalid/required/disabled from it. */
|
|
4
4
|
export type TextInputProps = Omit<InputProps, "id" | "name" | "minW" | "maxW" | "autoComplete" | "ref" | "isInvalid"> & {
|
|
5
5
|
label?: string;
|
|
6
6
|
/** Optional — an id is generated when omitted, so the label is always bound. `isRequired` sets `aria-required`, not native `required`. */
|
|
@@ -18,7 +18,7 @@ export type MultiSelectProps = {
|
|
|
18
18
|
addOnBlur?: boolean;
|
|
19
19
|
/** Marks the field invalid (`aria-invalid` + error border) and swaps `helperText` for `errorMessage`; a rejected email sets this internally too. */
|
|
20
20
|
error?: boolean;
|
|
21
|
-
/** Height on the shared control scale (xs
|
|
21
|
+
/** Height on the shared control scale (xs 30 · sm 38 · md 42 · lg 48px). Defaults to `sm`. */
|
|
22
22
|
size?: "xs" | "sm" | "md" | "lg";
|
|
23
23
|
inputStyle?: object;
|
|
24
24
|
/** Rendered only while `error` is true; a rejected email's internal "Invalid email address" text wins over this until the input changes. */
|
|
@@ -11,10 +11,11 @@ const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
|
11
11
|
const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
|
|
12
12
|
const useExclusiveOverlay_1 = require("../../Hooks/useExclusiveOverlay");
|
|
13
13
|
const OrgSwitcherProps_1 = require("./OrgSwitcherProps");
|
|
14
|
+
const controlSizes_1 = require("../../Theme/tokens/primitives/controlSizes");
|
|
14
15
|
const sizeMap = {
|
|
15
|
-
sm: { h:
|
|
16
|
-
md: { h:
|
|
17
|
-
lg: { h:
|
|
16
|
+
sm: { h: controlSizes_1.CONTROL_SIZES.sm.height, avatar: "26px", font: "0.8rem", sub: "0.65rem", px: 2 },
|
|
17
|
+
md: { h: controlSizes_1.CONTROL_SIZES.md.height, avatar: "30px", font: "0.9rem", sub: "0.7rem", px: 3 },
|
|
18
|
+
lg: { h: controlSizes_1.CONTROL_SIZES.lg.height, avatar: "34px", font: "1rem", sub: "0.78rem", px: 4 },
|
|
18
19
|
};
|
|
19
20
|
const Avatar = ({ org, boxSize, fontSize, }) => {
|
|
20
21
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
@@ -2,7 +2,7 @@ import { PinInputProps } from "@chakra-ui/react";
|
|
|
2
2
|
/** The only pin/OTP component exported from the package. */
|
|
3
3
|
export type ChakraPinInputProps = Pick<PinInputProps, "otp" | "mask" | "defaultValue" | "placeholder" | "manageFocus" | "errorBorderColor" | "focusBorderColor" | "onChange" | "onComplete"> & {
|
|
4
4
|
type?: "alphanumeric" | "number";
|
|
5
|
-
/** Square cell size, aligned to CONTROL_SIZES heights (xs
|
|
5
|
+
/** Square cell size, aligned to CONTROL_SIZES heights (xs 30 · sm 38 · md 42 · lg 48). Defaults to "sm". */
|
|
6
6
|
size?: "xs" | "sm" | "md" | "lg";
|
|
7
7
|
variant?: "flushed" | "outline" | "filled" | "unstyled";
|
|
8
8
|
color?: "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "whiteAlpha" | "blackAlpha" | "primary";
|
|
@@ -15,7 +15,7 @@ export type SearchProps = {
|
|
|
15
15
|
onClear?: () => void;
|
|
16
16
|
/** @deprecated Use `onClear` — same behaviour, consistent casing. */
|
|
17
17
|
onclose?: () => void;
|
|
18
|
-
/** Height on the shared control scale (xs
|
|
18
|
+
/** Height on the shared control scale (xs 30 · sm 38 · md 42 · lg 48px). Defaults to `sm`. */
|
|
19
19
|
size?: ControlSize;
|
|
20
20
|
name?: string;
|
|
21
21
|
/** Disables the input and hides the clear button; the hotkey still focuses it. */
|
|
@@ -38,7 +38,7 @@ export type SearchSelectProps = {
|
|
|
38
38
|
width?: string | number;
|
|
39
39
|
/** Only sets the insideSelect segment's height, not the main field's — that's driven by `size`. */
|
|
40
40
|
height?: string | number;
|
|
41
|
-
/** Height on the shared control scale (xs
|
|
41
|
+
/** Height on the shared control scale (xs 30 · sm 38 · md 42 · lg 48px). Defaults to `sm`. */
|
|
42
42
|
size?: "xs" | "sm" | "md" | "lg";
|
|
43
43
|
/** Blocks opening, typing, chip removal and clearing; renders the shared disabled field look. */
|
|
44
44
|
isDisabled?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ControlSize } from "../../Theme/tokens/primitives/controlSizes";
|
|
2
|
-
/** Whole-track height on the shared control scale (sm
|
|
2
|
+
/** Whole-track height on the shared control scale (sm 38 · md 42 · lg 48px); defaults to "sm". */
|
|
3
3
|
export type SegmentedControlSize = Exclude<ControlSize, "xs">;
|
|
4
4
|
/** brandSlide = primary view switcher; underlineSlide = dense toolbar; default = plain buttons. */
|
|
5
5
|
export type SegmentedControlVariant = "default" | "brandSlide" | "underlineSlide";
|
|
@@ -24,7 +24,7 @@ type SelectCommonProps = {
|
|
|
24
24
|
label?: string;
|
|
25
25
|
/** Native: the built-in placeholder `<option>`. Popup: trigger text when nothing is selected. Defaults to "Select Option". */
|
|
26
26
|
placeholder?: string;
|
|
27
|
-
/** Height on the shared control scale (xs
|
|
27
|
+
/** Height on the shared control scale (xs 30 · sm 38 · md 42 · lg 48px). Defaults to `sm`. */
|
|
28
28
|
size?: ControlSize;
|
|
29
29
|
/** Applied to the wrapping FormControl. */
|
|
30
30
|
width?: string | number;
|
|
@@ -49,7 +49,7 @@ export type SelectSearchProps = {
|
|
|
49
49
|
errorMessage?: string | undefined;
|
|
50
50
|
/** Hint under the field; replaced by `errorMessage` while `error` is true. */
|
|
51
51
|
helperText?: string;
|
|
52
|
-
/** Height on the shared control scale (xs
|
|
52
|
+
/** Height on the shared control scale (xs 30 · sm 38 · md 42 · lg 48px). Defaults to `sm`. */
|
|
53
53
|
size?: ControlSize;
|
|
54
54
|
/** Shows a sticky "Add New"-style footer row in the popup; required for all Bottom* props. */
|
|
55
55
|
isBottomIcon?: boolean | undefined;
|
|
@@ -33,7 +33,7 @@ type SelectV2CommonProps = {
|
|
|
33
33
|
isReadOnly?: boolean;
|
|
34
34
|
/** Label asterisk + `aria-required` only; never blocks an empty submit. */
|
|
35
35
|
isRequired?: boolean;
|
|
36
|
-
/** Shared control scale (xs
|
|
36
|
+
/** Shared control scale (xs 30 · sm 38 · md 42 · lg 48px). Defaults to `sm`. */
|
|
37
37
|
size?: ControlSize;
|
|
38
38
|
/** Shows a type-ahead filter input at the top of the popup. Defaults to true. */
|
|
39
39
|
isSearchable?: boolean;
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isControlSize = exports.DEFAULT_CONTROL_SIZE = exports.CONTROL_SIZE_NAMES = exports.CONTROL_SIZES = void 0;
|
|
4
4
|
/** One height scale for fields, selects and buttons, so controls side by side line up. */
|
|
5
5
|
exports.CONTROL_SIZES = {
|
|
6
|
-
xs: { height: "1.
|
|
7
|
-
sm: { height: "2.
|
|
8
|
-
md: { height: "2.
|
|
6
|
+
xs: { height: "1.875rem", fontSize: "0.75rem", paddingX: "0.5rem", iconSize: 12 },
|
|
7
|
+
sm: { height: "2.375rem", fontSize: "0.8125rem", paddingX: "0.75rem", iconSize: 14 },
|
|
8
|
+
md: { height: "2.625rem", fontSize: "0.875rem", paddingX: "1rem", iconSize: 16 },
|
|
9
9
|
lg: { height: "3rem", fontSize: "1rem", paddingX: "1.5rem", iconSize: 18 },
|
|
10
10
|
};
|
|
11
11
|
exports.CONTROL_SIZE_NAMES = ["xs", "sm", "md", "lg"];
|
|
@@ -4,19 +4,19 @@ exports.optionRowSpec = exports.OPTION_ROW_RADIUS = exports.OPTION_ROW_SIZES = v
|
|
|
4
4
|
/** One density for every option row — Select, SearchSelect, SelectSearch, table filters and Chakra's MenuItem. */
|
|
5
5
|
exports.OPTION_ROW_SIZES = {
|
|
6
6
|
xs: {
|
|
7
|
-
minH: "1.
|
|
7
|
+
minH: "1.625rem", px: "0.5rem", py: "0.125rem", gap: "0.375rem", mx: "0.25rem",
|
|
8
8
|
fontSize: "0.75rem", descriptionFontSize: "0.6875rem", iconSize: 12,
|
|
9
|
-
avatarSize: "2xs", virtualRowHeightPx:
|
|
9
|
+
avatarSize: "2xs", virtualRowHeightPx: 26,
|
|
10
10
|
},
|
|
11
11
|
sm: {
|
|
12
|
-
minH: "
|
|
12
|
+
minH: "2rem", px: "0.625rem", py: "0.25rem", gap: "0.5rem", mx: "0.375rem",
|
|
13
13
|
fontSize: "0.8125rem", descriptionFontSize: "0.75rem", iconSize: 14,
|
|
14
|
-
avatarSize: "xs", virtualRowHeightPx:
|
|
14
|
+
avatarSize: "xs", virtualRowHeightPx: 32,
|
|
15
15
|
},
|
|
16
16
|
md: {
|
|
17
|
-
minH: "2.
|
|
17
|
+
minH: "2.25rem", px: "0.75rem", py: "0.3125rem", gap: "0.5rem", mx: "0.375rem",
|
|
18
18
|
fontSize: "0.875rem", descriptionFontSize: "0.75rem", iconSize: 16,
|
|
19
|
-
avatarSize: "xs", virtualRowHeightPx:
|
|
19
|
+
avatarSize: "xs", virtualRowHeightPx: 36,
|
|
20
20
|
},
|
|
21
21
|
lg: {
|
|
22
22
|
minH: "2.5rem", px: "0.875rem", py: "0.375rem", gap: "0.625rem", mx: "0.5rem",
|
|
@@ -11,9 +11,10 @@ import { useExclusiveOverlay } from "../../Hooks/useExclusiveOverlay.js";
|
|
|
11
11
|
import AppMark, { assignAppHues } from "./AppMark.js";
|
|
12
12
|
import { filterApps, formatShortcut, } from "./AppSwitcherProps.js";
|
|
13
13
|
import { useAppSwitcherShortcut } from "./useAppSwitcherShortcut.js";
|
|
14
|
+
import { CONTROL_SIZES } from "../../Theme/tokens/primitives/controlSizes.js";
|
|
14
15
|
const COLUMNS = 2;
|
|
15
16
|
const HEADING = "Your apps";
|
|
16
|
-
const s = { trigger:
|
|
17
|
+
const s = { trigger: CONTROL_SIZES.sm.height, mark: "32px", icon: 17, name: "0.875rem", sub: "0.75rem", row: "52px" };
|
|
17
18
|
const warned = new Set();
|
|
18
19
|
const warnOnce = (key, message) => {
|
|
19
20
|
if (process.env.NODE_ENV === "production" || warned.has(key))
|
|
@@ -16,7 +16,7 @@ const getFlagEmoji = (countryCode) => {
|
|
|
16
16
|
const sizeToPt = { xs: 2, sm: -1, md: 2, lg: 4 };
|
|
17
17
|
const sizeToWidth = { xs: "3.5rem", sm: "3.8rem", md: "4rem", lg: "4rem" };
|
|
18
18
|
/** Country-code-aware phone field with a flag/dial-code prefix; `ref` forwards to the number `<input>`. */
|
|
19
|
-
const PhoneNumberInput = forwardRef(function PhoneNumberInput({ size = "
|
|
19
|
+
const PhoneNumberInput = forwardRef(function PhoneNumberInput({ size = "sm", value, codeValueReturn = true, country, countries, placeholder = "Enter phone number", onChange, inputId, selectId, error, errorMessage, helperText, label, id, width = "100%", isInformation, informationMessage, isRequired, onBlur, onFocus, isReadOnly, height, autoComplete, showCountrySelect = true, name, minW, maxW, countrySelectAriaLabel = "Country code", ...rest }, ref) {
|
|
20
20
|
const theme = useCustomTheme();
|
|
21
21
|
const ids = useFieldIds(inputId !== null && inputId !== void 0 ? inputId : id, { error, errorMessage, helperText });
|
|
22
22
|
const getCountryTelCode = useCallback((countryCode) => {
|
|
@@ -9,10 +9,11 @@ import { resolveHoverTint } from "../../Theme/tokens/builders/outlineRung.js";
|
|
|
9
9
|
import { listRowBackgrounds } from "../../Theme/tokens/builders/rowStates.js";
|
|
10
10
|
import { useExclusiveOverlay } from "../../Hooks/useExclusiveOverlay.js";
|
|
11
11
|
import { avatarColor, orgInitial, } from "./OrgSwitcherProps.js";
|
|
12
|
+
import { CONTROL_SIZES } from "../../Theme/tokens/primitives/controlSizes.js";
|
|
12
13
|
const sizeMap = {
|
|
13
|
-
sm: { h:
|
|
14
|
-
md: { h:
|
|
15
|
-
lg: { h:
|
|
14
|
+
sm: { h: CONTROL_SIZES.sm.height, avatar: "26px", font: "0.8rem", sub: "0.65rem", px: 2 },
|
|
15
|
+
md: { h: CONTROL_SIZES.md.height, avatar: "30px", font: "0.9rem", sub: "0.7rem", px: 3 },
|
|
16
|
+
lg: { h: CONTROL_SIZES.lg.height, avatar: "34px", font: "1rem", sub: "0.78rem", px: 4 },
|
|
16
17
|
};
|
|
17
18
|
const Avatar = ({ org, boxSize, fontSize, }) => {
|
|
18
19
|
const { colors } = useCustomTheme();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** One height scale for fields, selects and buttons, so controls side by side line up. */
|
|
2
2
|
export const CONTROL_SIZES = {
|
|
3
|
-
xs: { height: "1.
|
|
4
|
-
sm: { height: "2.
|
|
5
|
-
md: { height: "2.
|
|
3
|
+
xs: { height: "1.875rem", fontSize: "0.75rem", paddingX: "0.5rem", iconSize: 12 },
|
|
4
|
+
sm: { height: "2.375rem", fontSize: "0.8125rem", paddingX: "0.75rem", iconSize: 14 },
|
|
5
|
+
md: { height: "2.625rem", fontSize: "0.875rem", paddingX: "1rem", iconSize: 16 },
|
|
6
6
|
lg: { height: "3rem", fontSize: "1rem", paddingX: "1.5rem", iconSize: 18 },
|
|
7
7
|
};
|
|
8
8
|
export const CONTROL_SIZE_NAMES = ["xs", "sm", "md", "lg"];
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/** One density for every option row — Select, SearchSelect, SelectSearch, table filters and Chakra's MenuItem. */
|
|
2
2
|
export const OPTION_ROW_SIZES = {
|
|
3
3
|
xs: {
|
|
4
|
-
minH: "1.
|
|
4
|
+
minH: "1.625rem", px: "0.5rem", py: "0.125rem", gap: "0.375rem", mx: "0.25rem",
|
|
5
5
|
fontSize: "0.75rem", descriptionFontSize: "0.6875rem", iconSize: 12,
|
|
6
|
-
avatarSize: "2xs", virtualRowHeightPx:
|
|
6
|
+
avatarSize: "2xs", virtualRowHeightPx: 26,
|
|
7
7
|
},
|
|
8
8
|
sm: {
|
|
9
|
-
minH: "
|
|
9
|
+
minH: "2rem", px: "0.625rem", py: "0.25rem", gap: "0.5rem", mx: "0.375rem",
|
|
10
10
|
fontSize: "0.8125rem", descriptionFontSize: "0.75rem", iconSize: 14,
|
|
11
|
-
avatarSize: "xs", virtualRowHeightPx:
|
|
11
|
+
avatarSize: "xs", virtualRowHeightPx: 32,
|
|
12
12
|
},
|
|
13
13
|
md: {
|
|
14
|
-
minH: "2.
|
|
14
|
+
minH: "2.25rem", px: "0.75rem", py: "0.3125rem", gap: "0.5rem", mx: "0.375rem",
|
|
15
15
|
fontSize: "0.875rem", descriptionFontSize: "0.75rem", iconSize: 16,
|
|
16
|
-
avatarSize: "xs", virtualRowHeightPx:
|
|
16
|
+
avatarSize: "xs", virtualRowHeightPx: 36,
|
|
17
17
|
},
|
|
18
18
|
lg: {
|
|
19
19
|
minH: "2.5rem", px: "0.875rem", py: "0.375rem", gap: "0.625rem", mx: "0.5rem",
|
package/package.json
CHANGED