@kismet-ux/constellation 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/form/Checkbox/checkbox.js +1 -0
- package/dist/form/Checkbox/checkbox.js.map +1 -1
- package/dist/form/DatePicker/date-picker.js +1 -0
- package/dist/form/DatePicker/date-picker.js.map +1 -1
- package/dist/form.d.ts +1 -1
- package/dist/index-BaTZEId2.d.ts +354 -0
- package/dist/index-BgAs5Dmg.d.ts +354 -0
- package/dist/index-BhyLuP25.d.ts +354 -0
- package/dist/index-BnhsWXrb.d.ts +354 -0
- package/dist/index-CcD4F6q1.d.ts +633 -0
- package/dist/index-ClPGArR0.d.ts +633 -0
- package/dist/index-D2L-7_nr.d.ts +354 -0
- package/dist/index-DHbG5cYq.d.ts +633 -0
- package/dist/index-DxbOGj5Y.d.ts +354 -0
- package/dist/index-bK5ZOxgI.d.ts +633 -0
- package/dist/index-p7kVnzRy.d.ts +633 -0
- package/dist/index-xQq5cJnf.d.ts +633 -0
- package/dist/index.css +88 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/layout/AppSidebarHeader/app-sidebar-header.js +1 -0
- package/dist/layout/AppSidebarHeader/app-sidebar-header.js.map +1 -1
- package/dist/layout.d.ts +2 -2
- package/dist/navigation/Sheet/sheet.js +1 -0
- package/dist/navigation/Sheet/sheet.js.map +1 -1
- package/dist/navigation.d.ts +1 -1
- package/dist/settings/AppearanceTabs/appearance-tabs.js +1 -0
- package/dist/settings/AppearanceTabs/appearance-tabs.js.map +1 -1
- package/dist/tokens.css +30 -0
- package/dist/tooltip-CZ7BC0g3.d.ts +46 -0
- package/dist/tooltip-Cf_wdeef.d.ts +46 -0
- package/dist/tooltip-D1Wex2bz.d.ts +46 -0
- package/dist/typography/Typography/typography.css +14 -14
- package/dist/ui/ChipSelect/chip-select.css +63 -0
- package/dist/ui/ChipSelect/chip-select.d.ts +69 -0
- package/dist/ui/ChipSelect/chip-select.d.ts.map +1 -0
- package/dist/ui/ChipSelect/chip-select.js +209 -0
- package/dist/ui/ChipSelect/chip-select.js.map +1 -0
- package/dist/ui/ChipSelect/chip-select.module.scss.js +6 -0
- package/dist/ui/ChipSelect/chip-select.module.scss.js.map +1 -0
- package/dist/ui/ChipSelect/index.d.ts +3 -0
- package/dist/ui/ChipSelect/index.d.ts.map +1 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui.d.ts +2 -2
- package/dist/ui.js +1 -0
- package/dist/ui.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.chip-select-module_chip-select__DesJh {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
max-width: 100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* The caret is a hint that there is more under the chip, not a control. It is
|
|
9
|
+
* deliberately tiny — the chip is already small, and a full chevron doubles the
|
|
10
|
+
* visual weight of a word like "32oz".
|
|
11
|
+
*/
|
|
12
|
+
.chip-select-module_caret__Du-C1 {
|
|
13
|
+
border-bottom: 3px solid currentColor;
|
|
14
|
+
border-left: 3px solid transparent;
|
|
15
|
+
border-right: 3px solid transparent;
|
|
16
|
+
display: inline-block;
|
|
17
|
+
height: 0;
|
|
18
|
+
margin-left: 0.35em;
|
|
19
|
+
opacity: 0.55;
|
|
20
|
+
transform: rotate(180deg);
|
|
21
|
+
transition: transform 160ms ease;
|
|
22
|
+
width: 0;
|
|
23
|
+
}
|
|
24
|
+
[data-open] .chip-select-module_caret__Du-C1 {
|
|
25
|
+
transform: rotate(0deg);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.chip-select-module_flyout__EzyIR {
|
|
29
|
+
background: var(--surface-muted);
|
|
30
|
+
border: 1px solid var(--divider);
|
|
31
|
+
border-radius: var(--radius-lg);
|
|
32
|
+
box-shadow: var(--shadow-elevation-8);
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
gap: var(--size-0-5);
|
|
36
|
+
max-width: min(84vw, 22rem);
|
|
37
|
+
padding: var(--size-0-5);
|
|
38
|
+
position: fixed;
|
|
39
|
+
z-index: var(--z-popover);
|
|
40
|
+
}
|
|
41
|
+
.chip-select-module_flyout__EzyIR [data-slot=chip-option] {
|
|
42
|
+
animation: chip-select-module_chip-option-in__FN6D0 180ms cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
|
|
43
|
+
animation-delay: calc(var(--i, 0) * 26ms);
|
|
44
|
+
}
|
|
45
|
+
@media (prefers-reduced-motion: reduce) {
|
|
46
|
+
.chip-select-module_flyout__EzyIR :root:not([data-motion=full]) [data-slot=chip-option] {
|
|
47
|
+
animation: none;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
.chip-select-module_flyout__EzyIR :root[data-motion=reduced] [data-slot=chip-option] {
|
|
51
|
+
animation: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@keyframes chip-select-module_chip-option-in__FN6D0 {
|
|
55
|
+
from {
|
|
56
|
+
opacity: 0;
|
|
57
|
+
transform: translateY(-6px) scale(0.94);
|
|
58
|
+
}
|
|
59
|
+
to {
|
|
60
|
+
opacity: 1;
|
|
61
|
+
transform: none;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ChipProps } from '../Chip';
|
|
3
|
+
export interface ChipSelectOption {
|
|
4
|
+
value: string;
|
|
5
|
+
/** What the chip reads. Defaults to `value`. */
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
/** A `title` on the chip — the reckoning behind the option, if there is one. */
|
|
8
|
+
hint?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ChipSelectProps {
|
|
12
|
+
options: ChipSelectOption[];
|
|
13
|
+
value?: string;
|
|
14
|
+
onValueChange?: (value: string) => void;
|
|
15
|
+
/**
|
|
16
|
+
* What the anchor shows while nothing is selected — the option the caller
|
|
17
|
+
* would pick for you. Its chip draws as a suggestion rather than a choice.
|
|
18
|
+
*/
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
/** Accessible name for the control. */
|
|
21
|
+
label: string;
|
|
22
|
+
/** Per-option chip props — the caller's own vocabulary for what an option IS. */
|
|
23
|
+
optionProps?: (option: ChipSelectOption, state: {
|
|
24
|
+
selected: boolean;
|
|
25
|
+
suggested: boolean;
|
|
26
|
+
}) => Partial<ChipProps>;
|
|
27
|
+
/** Chip defaults for every option. */
|
|
28
|
+
size?: ChipProps['size'];
|
|
29
|
+
theme?: ChipProps['theme'];
|
|
30
|
+
variant?: ChipProps['variant'];
|
|
31
|
+
mono?: boolean;
|
|
32
|
+
/** Taking the selection off again — off by default; a second tap does nothing. */
|
|
33
|
+
clearable?: boolean;
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* ONE CHIP UNTIL ASKED.
|
|
38
|
+
*
|
|
39
|
+
* A row of chips is the friendliest way to offer six sizes, four cuts or three
|
|
40
|
+
* grinds — and the most expensive thing on the card, because it is as tall as
|
|
41
|
+
* the row wraps to and it is spending that room on options nobody is choosing
|
|
42
|
+
* right now. Andrew, whose kitchen card this was crowding out: *"Only the
|
|
43
|
+
* default (if not yet selected) or selected pill should be visible. Hovering on
|
|
44
|
+
* desktop or tapping on mobile would then fly-out the other options from under
|
|
45
|
+
* the default pill. That way, the entire area is limited to the space of just
|
|
46
|
+
* one pill."*
|
|
47
|
+
*
|
|
48
|
+
* So: the selection is the control. The rest live under it and come out when
|
|
49
|
+
* asked — on hover where there is a pointer, on a tap where there is not.
|
|
50
|
+
*
|
|
51
|
+
* ⚠️ THE FLYOUT IS PORTALED, and it has to be. A chip select is small enough to
|
|
52
|
+
* look like it could open in place, but it is used inside cards, sheets and
|
|
53
|
+
* drawers — and a `Sheet` is `overflow: hidden` while a scrolling body is a
|
|
54
|
+
* clipping box on both axes. Opening in flow would either be clipped at the
|
|
55
|
+
* worst moment (an option near the foot of a long sheet) or push the card's own
|
|
56
|
+
* content around every time somebody moved a mouse over it.
|
|
57
|
+
*
|
|
58
|
+
* ⚠️ A TAP IS NOT A HOVER. On a touch screen the first tap must OPEN and select
|
|
59
|
+
* nothing — a pointer-driven `mouseenter` fires on touch too, and without this
|
|
60
|
+
* the first tap both opened the flyout and committed whatever the anchor
|
|
61
|
+
* happened to be showing.
|
|
62
|
+
*
|
|
63
|
+
* The options emerge with a stagger, which is the whole point of the gesture:
|
|
64
|
+
* they should read as having come out from under the anchor rather than
|
|
65
|
+
* appearing beside it. `prefers-reduced-motion` takes the movement out and
|
|
66
|
+
* keeps the reveal.
|
|
67
|
+
*/
|
|
68
|
+
export declare const ChipSelect: React.ForwardRefExoticComponent<ChipSelectProps & React.RefAttributes<HTMLDivElement>>;
|
|
69
|
+
//# sourceMappingURL=chip-select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip-select.d.ts","sourceRoot":"","sources":["../../../src/ui/ChipSelect/chip-select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAG/C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,gFAAgF;IAChF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,WAAW,CAAC,EAAE,CACZ,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,KAC7C,OAAO,CAAC,SAAS,CAAC,CAAC;IACxB,sCAAsC;IACtC,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kFAAkF;IAClF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,UAAU,wFAyOrB,CAAC"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import cn from 'clsx';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
import { Chip } from '../Chip/chip.js';
|
|
6
|
+
import s from './chip-select.module.scss.js';
|
|
7
|
+
|
|
8
|
+
/** Hover-intent: long enough not to fire in passing, short enough not to feel late. */
|
|
9
|
+
const OPEN_DELAY = 90;
|
|
10
|
+
const CLOSE_DELAY = 220;
|
|
11
|
+
/**
|
|
12
|
+
* ONE CHIP UNTIL ASKED.
|
|
13
|
+
*
|
|
14
|
+
* A row of chips is the friendliest way to offer six sizes, four cuts or three
|
|
15
|
+
* grinds — and the most expensive thing on the card, because it is as tall as
|
|
16
|
+
* the row wraps to and it is spending that room on options nobody is choosing
|
|
17
|
+
* right now. Andrew, whose kitchen card this was crowding out: *"Only the
|
|
18
|
+
* default (if not yet selected) or selected pill should be visible. Hovering on
|
|
19
|
+
* desktop or tapping on mobile would then fly-out the other options from under
|
|
20
|
+
* the default pill. That way, the entire area is limited to the space of just
|
|
21
|
+
* one pill."*
|
|
22
|
+
*
|
|
23
|
+
* So: the selection is the control. The rest live under it and come out when
|
|
24
|
+
* asked — on hover where there is a pointer, on a tap where there is not.
|
|
25
|
+
*
|
|
26
|
+
* ⚠️ THE FLYOUT IS PORTALED, and it has to be. A chip select is small enough to
|
|
27
|
+
* look like it could open in place, but it is used inside cards, sheets and
|
|
28
|
+
* drawers — and a `Sheet` is `overflow: hidden` while a scrolling body is a
|
|
29
|
+
* clipping box on both axes. Opening in flow would either be clipped at the
|
|
30
|
+
* worst moment (an option near the foot of a long sheet) or push the card's own
|
|
31
|
+
* content around every time somebody moved a mouse over it.
|
|
32
|
+
*
|
|
33
|
+
* ⚠️ A TAP IS NOT A HOVER. On a touch screen the first tap must OPEN and select
|
|
34
|
+
* nothing — a pointer-driven `mouseenter` fires on touch too, and without this
|
|
35
|
+
* the first tap both opened the flyout and committed whatever the anchor
|
|
36
|
+
* happened to be showing.
|
|
37
|
+
*
|
|
38
|
+
* The options emerge with a stagger, which is the whole point of the gesture:
|
|
39
|
+
* they should read as having come out from under the anchor rather than
|
|
40
|
+
* appearing beside it. `prefers-reduced-motion` takes the movement out and
|
|
41
|
+
* keeps the reveal.
|
|
42
|
+
*/
|
|
43
|
+
const ChipSelect = React.forwardRef(function ChipSelect({ options, value, onValueChange, placeholder, label, optionProps, size = 'xs', theme, variant = 'outline', mono, clearable = false, className, }, ref) {
|
|
44
|
+
const [open, setOpen] = React.useState(false);
|
|
45
|
+
const [coords, setCoords] = React.useState(null);
|
|
46
|
+
const anchorRef = React.useRef(null);
|
|
47
|
+
const flyoutRef = React.useRef(null);
|
|
48
|
+
const timer = React.useRef(0);
|
|
49
|
+
/* Whether the gesture that opened this was a touch — a tap must not also
|
|
50
|
+
pick, and a touch flyout must not close because a finger left the chip. */
|
|
51
|
+
const touched = React.useRef(false);
|
|
52
|
+
const selected = options.find(o => o.value === value) || null;
|
|
53
|
+
const suggestion = !selected && placeholder ? options.find(o => o.value === placeholder) : null;
|
|
54
|
+
/* What the one visible chip says. A selection, else the suggestion, else the
|
|
55
|
+
first thing on offer — there is always exactly one chip. */
|
|
56
|
+
const anchor = selected || suggestion || options[0] || null;
|
|
57
|
+
const clearTimer = () => {
|
|
58
|
+
if (timer.current)
|
|
59
|
+
window.clearTimeout(timer.current);
|
|
60
|
+
timer.current = 0;
|
|
61
|
+
};
|
|
62
|
+
const place = React.useCallback(() => {
|
|
63
|
+
const el = anchorRef.current;
|
|
64
|
+
if (!el)
|
|
65
|
+
return;
|
|
66
|
+
const r = el.getBoundingClientRect();
|
|
67
|
+
setCoords({ top: r.bottom + 6, left: r.left });
|
|
68
|
+
}, []);
|
|
69
|
+
const show = React.useCallback(() => {
|
|
70
|
+
clearTimer();
|
|
71
|
+
place();
|
|
72
|
+
setOpen(true);
|
|
73
|
+
}, [place]);
|
|
74
|
+
const hide = React.useCallback(() => {
|
|
75
|
+
clearTimer();
|
|
76
|
+
setOpen(false);
|
|
77
|
+
touched.current = false;
|
|
78
|
+
}, []);
|
|
79
|
+
// Closing the page, scrolling the list or turning the phone all move the
|
|
80
|
+
// anchor out from under a fixed flyout. Follow it rather than leave it behind.
|
|
81
|
+
React.useEffect(() => {
|
|
82
|
+
if (!open)
|
|
83
|
+
return undefined;
|
|
84
|
+
const onScroll = () => place();
|
|
85
|
+
window.addEventListener('scroll', onScroll, true);
|
|
86
|
+
window.addEventListener('resize', onScroll);
|
|
87
|
+
return () => {
|
|
88
|
+
window.removeEventListener('scroll', onScroll, true);
|
|
89
|
+
window.removeEventListener('resize', onScroll);
|
|
90
|
+
};
|
|
91
|
+
}, [open, place]);
|
|
92
|
+
// A tap anywhere else puts it away. Pointerdown rather than click, so it
|
|
93
|
+
// closes on the way down like every other dismissible surface here.
|
|
94
|
+
React.useEffect(() => {
|
|
95
|
+
if (!open)
|
|
96
|
+
return undefined;
|
|
97
|
+
const onDown = (e) => {
|
|
98
|
+
const t = e.target;
|
|
99
|
+
if (anchorRef.current?.contains(t) || flyoutRef.current?.contains(t))
|
|
100
|
+
return;
|
|
101
|
+
hide();
|
|
102
|
+
};
|
|
103
|
+
document.addEventListener('pointerdown', onDown);
|
|
104
|
+
return () => document.removeEventListener('pointerdown', onDown);
|
|
105
|
+
}, [open, hide]);
|
|
106
|
+
React.useEffect(() => () => clearTimer(), []);
|
|
107
|
+
const pick = (option) => {
|
|
108
|
+
if (option.disabled)
|
|
109
|
+
return;
|
|
110
|
+
const next = clearable && option.value === value ? '' : option.value;
|
|
111
|
+
onValueChange?.(next);
|
|
112
|
+
hide();
|
|
113
|
+
};
|
|
114
|
+
const onKeyDown = (e) => {
|
|
115
|
+
if (e.key === 'Escape' && open) {
|
|
116
|
+
e.preventDefault();
|
|
117
|
+
hide();
|
|
118
|
+
anchorRef.current?.focus();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter' || e.key === ' ') {
|
|
122
|
+
if (!open) {
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
show();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (!open)
|
|
129
|
+
return;
|
|
130
|
+
const items = flyoutRef.current?.querySelectorAll('[data-slot="chip-option"]');
|
|
131
|
+
if (!items?.length)
|
|
132
|
+
return;
|
|
133
|
+
const list = Array.from(items);
|
|
134
|
+
const at = list.indexOf(document.activeElement);
|
|
135
|
+
let next = null;
|
|
136
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowRight')
|
|
137
|
+
next = at < 0 ? 0 : (at + 1) % list.length;
|
|
138
|
+
else if (e.key === 'ArrowUp' || e.key === 'ArrowLeft')
|
|
139
|
+
next = at < 0 ? list.length - 1 : (at - 1 + list.length) % list.length;
|
|
140
|
+
else if (e.key === 'Home')
|
|
141
|
+
next = 0;
|
|
142
|
+
else if (e.key === 'End')
|
|
143
|
+
next = list.length - 1;
|
|
144
|
+
if (next !== null) {
|
|
145
|
+
e.preventDefault();
|
|
146
|
+
list[next].focus();
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
const chipFor = (option, isAnchor) => {
|
|
150
|
+
const isSelected = option.value === value;
|
|
151
|
+
const isSuggested = !value && option.value === placeholder;
|
|
152
|
+
return {
|
|
153
|
+
size,
|
|
154
|
+
theme,
|
|
155
|
+
mono,
|
|
156
|
+
variant: isSelected ? 'soft' : variant,
|
|
157
|
+
dashed: isSuggested || undefined,
|
|
158
|
+
...(optionProps?.(option, { selected: isSelected, suggested: isSuggested }) ?? {}),
|
|
159
|
+
...(isAnchor ? {} : {}),
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
if (!anchor)
|
|
163
|
+
return null;
|
|
164
|
+
return (jsxs("div", { ref: ref, "data-slot": 'chip-select', className: cn(s['chip-select'], className), onKeyDown: onKeyDown, onPointerEnter: e => {
|
|
165
|
+
// Touch fires this too; only a real pointer opens on its own.
|
|
166
|
+
if (e.pointerType === 'touch')
|
|
167
|
+
return;
|
|
168
|
+
clearTimer();
|
|
169
|
+
timer.current = window.setTimeout(show, OPEN_DELAY);
|
|
170
|
+
}, onPointerLeave: e => {
|
|
171
|
+
if (e.pointerType === 'touch' || touched.current)
|
|
172
|
+
return;
|
|
173
|
+
clearTimer();
|
|
174
|
+
timer.current = window.setTimeout(hide, CLOSE_DELAY);
|
|
175
|
+
}, children: [jsx(Chip, { ...chipFor(anchor, true), asChild: true, children: jsxs("button", { ref: anchorRef, type: 'button', "data-slot": 'chip-select-anchor', "data-open": open || undefined, "aria-haspopup": 'listbox', "aria-expanded": open, "aria-label": `${label}: ${selected ? String(selected.value) : 'not set'}`, title: anchor.hint,
|
|
176
|
+
// ⚠️ The first TAP opens and picks nothing. Without this the same tap
|
|
177
|
+
// that reveals the options also commits whatever was under the finger.
|
|
178
|
+
onPointerDown: e => {
|
|
179
|
+
if (e.pointerType !== 'touch')
|
|
180
|
+
return;
|
|
181
|
+
touched.current = true;
|
|
182
|
+
e.preventDefault();
|
|
183
|
+
if (open)
|
|
184
|
+
hide();
|
|
185
|
+
else
|
|
186
|
+
show();
|
|
187
|
+
}, onClick: e => {
|
|
188
|
+
if (touched.current) {
|
|
189
|
+
e.preventDefault();
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (open)
|
|
193
|
+
hide();
|
|
194
|
+
else
|
|
195
|
+
show();
|
|
196
|
+
}, children: [anchor.label ?? anchor.value, jsx("span", { "aria-hidden": 'true', "data-slot": 'chip-select-caret', className: s.caret })] }) }), open &&
|
|
197
|
+
coords &&
|
|
198
|
+
createPortal(jsx("div", { ref: flyoutRef, "data-constellation-portal": '', "data-slot": 'chip-select-flyout', role: 'listbox', "aria-label": label, className: s.flyout, style: { top: coords.top, left: coords.left }, onKeyDown: onKeyDown, onPointerEnter: () => clearTimer(), onPointerLeave: e => {
|
|
199
|
+
if (e.pointerType === 'touch' || touched.current)
|
|
200
|
+
return;
|
|
201
|
+
timer.current = window.setTimeout(hide, CLOSE_DELAY);
|
|
202
|
+
}, children: options.map((option, i) => (jsx(Chip, { ...chipFor(option, false), asChild: true, children: jsx("button", { type: 'button', "data-slot": 'chip-option', role: 'option', "aria-selected": option.value === value, disabled: option.disabled, title: option.hint,
|
|
203
|
+
/* The stagger is what makes them read as having come out from
|
|
204
|
+
under the anchor rather than appearing all at once. */
|
|
205
|
+
style: { '--i': i }, onMouseDown: e => e.preventDefault(), onClick: () => pick(option), children: option.label ?? option.value }) }, option.value))) }), document.body)] }));
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
export { ChipSelect };
|
|
209
|
+
//# sourceMappingURL=chip-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip-select.js","sources":["../../../src/ui/ChipSelect/chip-select.tsx"],"sourcesContent":["import cn from 'clsx';\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { Chip, type ChipProps } from '../Chip';\nimport s from './chip-select.module.scss';\n\nexport interface ChipSelectOption {\n value: string;\n /** What the chip reads. Defaults to `value`. */\n label?: React.ReactNode;\n /** A `title` on the chip — the reckoning behind the option, if there is one. */\n hint?: string;\n disabled?: boolean;\n}\n\nexport interface ChipSelectProps {\n options: ChipSelectOption[];\n value?: string;\n onValueChange?: (value: string) => void;\n /**\n * What the anchor shows while nothing is selected — the option the caller\n * would pick for you. Its chip draws as a suggestion rather than a choice.\n */\n placeholder?: string;\n /** Accessible name for the control. */\n label: string;\n /** Per-option chip props — the caller's own vocabulary for what an option IS. */\n optionProps?: (\n option: ChipSelectOption,\n state: { selected: boolean; suggested: boolean },\n ) => Partial<ChipProps>;\n /** Chip defaults for every option. */\n size?: ChipProps['size'];\n theme?: ChipProps['theme'];\n variant?: ChipProps['variant'];\n mono?: boolean;\n /** Taking the selection off again — off by default; a second tap does nothing. */\n clearable?: boolean;\n className?: string;\n}\n\n/** Hover-intent: long enough not to fire in passing, short enough not to feel late. */\nconst OPEN_DELAY = 90;\nconst CLOSE_DELAY = 220;\n\n/**\n * ONE CHIP UNTIL ASKED.\n *\n * A row of chips is the friendliest way to offer six sizes, four cuts or three\n * grinds — and the most expensive thing on the card, because it is as tall as\n * the row wraps to and it is spending that room on options nobody is choosing\n * right now. Andrew, whose kitchen card this was crowding out: *\"Only the\n * default (if not yet selected) or selected pill should be visible. Hovering on\n * desktop or tapping on mobile would then fly-out the other options from under\n * the default pill. That way, the entire area is limited to the space of just\n * one pill.\"*\n *\n * So: the selection is the control. The rest live under it and come out when\n * asked — on hover where there is a pointer, on a tap where there is not.\n *\n * ⚠️ THE FLYOUT IS PORTALED, and it has to be. A chip select is small enough to\n * look like it could open in place, but it is used inside cards, sheets and\n * drawers — and a `Sheet` is `overflow: hidden` while a scrolling body is a\n * clipping box on both axes. Opening in flow would either be clipped at the\n * worst moment (an option near the foot of a long sheet) or push the card's own\n * content around every time somebody moved a mouse over it.\n *\n * ⚠️ A TAP IS NOT A HOVER. On a touch screen the first tap must OPEN and select\n * nothing — a pointer-driven `mouseenter` fires on touch too, and without this\n * the first tap both opened the flyout and committed whatever the anchor\n * happened to be showing.\n *\n * The options emerge with a stagger, which is the whole point of the gesture:\n * they should read as having come out from under the anchor rather than\n * appearing beside it. `prefers-reduced-motion` takes the movement out and\n * keeps the reveal.\n */\nexport const ChipSelect = React.forwardRef<HTMLDivElement, ChipSelectProps>(function ChipSelect(\n {\n options,\n value,\n onValueChange,\n placeholder,\n label,\n optionProps,\n size = 'xs',\n theme,\n variant = 'outline',\n mono,\n clearable = false,\n className,\n },\n ref,\n) {\n const [open, setOpen] = React.useState(false);\n const [coords, setCoords] = React.useState<{ top: number; left: number } | null>(null);\n const anchorRef = React.useRef<HTMLButtonElement>(null);\n const flyoutRef = React.useRef<HTMLDivElement>(null);\n const timer = React.useRef<number>(0);\n /* Whether the gesture that opened this was a touch — a tap must not also\n pick, and a touch flyout must not close because a finger left the chip. */\n const touched = React.useRef(false);\n\n const selected = options.find(o => o.value === value) || null;\n const suggestion = !selected && placeholder ? options.find(o => o.value === placeholder) : null;\n /* What the one visible chip says. A selection, else the suggestion, else the\n first thing on offer — there is always exactly one chip. */\n const anchor = selected || suggestion || options[0] || null;\n\n const clearTimer = () => {\n if (timer.current) window.clearTimeout(timer.current);\n timer.current = 0;\n };\n\n const place = React.useCallback(() => {\n const el = anchorRef.current;\n if (!el) return;\n const r = el.getBoundingClientRect();\n setCoords({ top: r.bottom + 6, left: r.left });\n }, []);\n\n const show = React.useCallback(() => {\n clearTimer();\n place();\n setOpen(true);\n }, [place]);\n\n const hide = React.useCallback(() => {\n clearTimer();\n setOpen(false);\n touched.current = false;\n }, []);\n\n // Closing the page, scrolling the list or turning the phone all move the\n // anchor out from under a fixed flyout. Follow it rather than leave it behind.\n React.useEffect(() => {\n if (!open) return undefined;\n const onScroll = () => place();\n window.addEventListener('scroll', onScroll, true);\n window.addEventListener('resize', onScroll);\n return () => {\n window.removeEventListener('scroll', onScroll, true);\n window.removeEventListener('resize', onScroll);\n };\n }, [open, place]);\n\n // A tap anywhere else puts it away. Pointerdown rather than click, so it\n // closes on the way down like every other dismissible surface here.\n React.useEffect(() => {\n if (!open) return undefined;\n const onDown = (e: PointerEvent) => {\n const t = e.target as Node;\n if (anchorRef.current?.contains(t) || flyoutRef.current?.contains(t)) return;\n hide();\n };\n document.addEventListener('pointerdown', onDown);\n return () => document.removeEventListener('pointerdown', onDown);\n }, [open, hide]);\n\n React.useEffect(() => () => clearTimer(), []);\n\n const pick = (option: ChipSelectOption) => {\n if (option.disabled) return;\n const next = clearable && option.value === value ? '' : option.value;\n onValueChange?.(next);\n hide();\n };\n\n const onKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape' && open) {\n e.preventDefault();\n hide();\n anchorRef.current?.focus();\n return;\n }\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter' || e.key === ' ') {\n if (!open) {\n e.preventDefault();\n show();\n return;\n }\n }\n if (!open) return;\n const items = flyoutRef.current?.querySelectorAll<HTMLButtonElement>(\n '[data-slot=\"chip-option\"]',\n );\n if (!items?.length) return;\n const list = Array.from(items);\n const at = list.indexOf(document.activeElement as HTMLButtonElement);\n let next: number | null = null;\n if (e.key === 'ArrowDown' || e.key === 'ArrowRight') next = at < 0 ? 0 : (at + 1) % list.length;\n else if (e.key === 'ArrowUp' || e.key === 'ArrowLeft')\n next = at < 0 ? list.length - 1 : (at - 1 + list.length) % list.length;\n else if (e.key === 'Home') next = 0;\n else if (e.key === 'End') next = list.length - 1;\n if (next !== null) {\n e.preventDefault();\n list[next].focus();\n }\n };\n\n const chipFor = (option: ChipSelectOption, isAnchor: boolean): Partial<ChipProps> => {\n const isSelected = option.value === value;\n const isSuggested = !value && option.value === placeholder;\n return {\n size,\n theme,\n mono,\n variant: isSelected ? 'soft' : variant,\n dashed: isSuggested || undefined,\n ...(optionProps?.(option, { selected: isSelected, suggested: isSuggested }) ?? {}),\n ...(isAnchor ? {} : {}),\n };\n };\n\n if (!anchor) return null;\n\n return (\n <div\n ref={ref}\n data-slot={'chip-select'}\n className={cn(s['chip-select'], className)}\n onKeyDown={onKeyDown}\n onPointerEnter={e => {\n // Touch fires this too; only a real pointer opens on its own.\n if (e.pointerType === 'touch') return;\n clearTimer();\n timer.current = window.setTimeout(show, OPEN_DELAY);\n }}\n onPointerLeave={e => {\n if (e.pointerType === 'touch' || touched.current) return;\n clearTimer();\n timer.current = window.setTimeout(hide, CLOSE_DELAY);\n }}\n >\n <Chip {...chipFor(anchor, true)} asChild>\n <button\n ref={anchorRef}\n type={'button'}\n data-slot={'chip-select-anchor'}\n data-open={open || undefined}\n aria-haspopup={'listbox'}\n aria-expanded={open}\n aria-label={`${label}: ${selected ? String(selected.value) : 'not set'}`}\n title={anchor.hint}\n // ⚠️ The first TAP opens and picks nothing. Without this the same tap\n // that reveals the options also commits whatever was under the finger.\n onPointerDown={e => {\n if (e.pointerType !== 'touch') return;\n touched.current = true;\n e.preventDefault();\n if (open) hide();\n else show();\n }}\n onClick={e => {\n if (touched.current) {\n e.preventDefault();\n return;\n }\n if (open) hide();\n else show();\n }}\n >\n {anchor.label ?? anchor.value}\n <span aria-hidden={'true'} data-slot={'chip-select-caret'} className={s.caret} />\n </button>\n </Chip>\n\n {open &&\n coords &&\n createPortal(\n <div\n ref={flyoutRef}\n data-constellation-portal={''}\n data-slot={'chip-select-flyout'}\n role={'listbox'}\n aria-label={label}\n className={s.flyout}\n style={{ top: coords.top, left: coords.left }}\n onKeyDown={onKeyDown}\n onPointerEnter={() => clearTimer()}\n onPointerLeave={e => {\n if (e.pointerType === 'touch' || touched.current) return;\n timer.current = window.setTimeout(hide, CLOSE_DELAY);\n }}\n >\n {options.map((option, i) => (\n <Chip key={option.value} {...chipFor(option, false)} asChild>\n <button\n type={'button'}\n data-slot={'chip-option'}\n role={'option'}\n aria-selected={option.value === value}\n disabled={option.disabled}\n title={option.hint}\n /* The stagger is what makes them read as having come out from\n under the anchor rather than appearing all at once. */\n style={{ '--i': i } as React.CSSProperties}\n onMouseDown={e => e.preventDefault()}\n onClick={() => pick(option)}\n >\n {option.label ?? option.value}\n </button>\n </Chip>\n ))}\n </div>,\n document.body,\n )}\n </div>\n );\n});\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAyCA;AACA,MAAM,UAAU,GAAG,EAAE;AACrB,MAAM,WAAW,GAAG,GAAG;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACI,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAkC,SAAS,UAAU,CAC7F,EACE,OAAO,EACP,KAAK,EACL,aAAa,EACb,WAAW,EACX,KAAK,EACL,WAAW,EACX,IAAI,GAAG,IAAI,EACX,KAAK,EACL,OAAO,GAAG,SAAS,EACnB,IAAI,EACJ,SAAS,GAAG,KAAK,EACjB,SAAS,GACV,EACD,GAAG,EAAA;AAEH,IAAA,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC7C,IAAA,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAuC,IAAI,CAAC;IACtF,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAoB,IAAI,CAAC;IACvD,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC;IACpD,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAS,CAAC,CAAC;AACrC;AAC6E;IAC7E,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;AAEnC,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,IAAI;IAC7D,MAAM,UAAU,GAAG,CAAC,QAAQ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yD;4BACzD,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAyB,EAC1C,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,EACpC,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,EAAA,QAAA,EAE1B,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,EAAA,CACtB,EAAA,EAfA,MAAM,CAAC,KAAK,CAgBhB,CACR,CAAC,EAAA,CACE,EACN,QAAQ,CAAC,IAAI,CACd,CAAA,EAAA,CACC;AAEV,CAAC;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip-select.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ChipSelect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/ui/index.d.ts
CHANGED
package/dist/ui/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { a as Alert, b as AlertBanner, c as AlertBannerProps, d as AlertDescription, f as AlertProps, g as AlertProvider, i as AlertTitle, j as Avatar, k as AvatarFallback, l as AvatarFallbackProps, m as AvatarImage, n as AvatarImageProps, o as AvatarProps, C as Chip, p as ChipProps, q as
|
|
2
|
-
export { B as Button, a as ButtonProps, T as Tooltip, b as TooltipContent, c as TooltipContentProps, d as TooltipProps, e as TooltipProvider, f as TooltipTrigger, g as TooltipTriggerProps } from './tooltip-
|
|
1
|
+
export { a as Alert, b as AlertBanner, c as AlertBannerProps, d as AlertDescription, f as AlertProps, g as AlertProvider, i as AlertTitle, j as Avatar, k as AvatarFallback, l as AvatarFallbackProps, m as AvatarImage, n as AvatarImageProps, o as AvatarProps, C as Chip, p as ChipProps, q as ChipSelect, r as ChipSelectOption, s as ChipSelectProps, t as CodeBlock, u as CodeBlockProps, D as DevIndicator, v as DevIndicatorProps, w as Dialog, x as DialogClose, y as DialogCloseProps, z as DialogContent, B as DialogContentProps, E as DialogDescription, F as DialogFooter, G as DialogHeader, H as DialogOverlay, I as DialogPortal, J as DialogProps, K as DialogTitle, L as DialogTrigger, M as DialogTriggerProps, N as EmptyState, O as EmptyStateProps, P as Icon, Q as IconProps, R as List, T as ListItem, U as ListItemProps, V as ListProps, W as Pagination, Y as ProgressBar, Z as ProgressBarProps, $ as Separator, a0 as SeparatorProps, a3 as StatCard, a4 as StatCardDirection, a5 as StatCardProps, a6 as StatCardSize, a7 as StatCardTheme, a8 as StatCardVariant, a9 as StatusDot, aa as StatusDotProps, ab as Step, ac as StepProgress, ad as StepProgressProps, ae as Switch, af as SwitchProps, ag as Table, ah as TableActionCell, ai as TableActionCellProps, aj as TableActionItem, ak as TableBody, al as TableBodyProps, am as TableCard, an as TableCell, ao as TableFooter, ap as TableHead, aq as TableHeader, ar as TableRow, as as TableSortableHeader, at as TableSortableHeaderProps, au as TableToolbar, av as TableToolbarProps, aw as Toggle, ax as ToggleGroup, ay as ToggleGroupProps, az as ToggleProps, aA as TrendDirection, aB as persistAlert, aC as statusDotVariants } from './index-p7kVnzRy.js';
|
|
2
|
+
export { B as Button, a as ButtonProps, T as Tooltip, b as TooltipContent, c as TooltipContentProps, d as TooltipProps, e as TooltipProvider, f as TooltipTrigger, g as TooltipTriggerProps } from './tooltip-DXoSckt9.js';
|
|
3
3
|
import 'class-variance-authority';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'class-variance-authority/types';
|
package/dist/ui.js
CHANGED
|
@@ -4,6 +4,7 @@ export { AlertProvider } from './ui/Alert/alert-provider.js';
|
|
|
4
4
|
export { Avatar, AvatarFallback, AvatarImage } from './ui/Avatar/avatar.js';
|
|
5
5
|
export { Button } from './ui/Button/button.js';
|
|
6
6
|
export { Chip } from './ui/Chip/chip.js';
|
|
7
|
+
export { ChipSelect } from './ui/ChipSelect/chip-select.js';
|
|
7
8
|
export { CodeBlock } from './ui/CodeBlock/code-block.js';
|
|
8
9
|
export { DevIndicator } from './ui/DevIndicator/dev-indicator.js';
|
|
9
10
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from './ui/Dialog/dialog.js';
|
package/dist/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ui.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|