@kanso-labs/react-native-kanso-ui 0.7.0 → 0.9.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/README.md +37 -0
- package/dist/badge/index.js +9 -68
- package/dist/badge/index.js.map +1 -1
- package/dist/button/index.d.ts +2 -1
- package/dist/button/index.js +1 -1
- package/dist/button/index.js.map +1 -1
- package/dist/button/palettes.d.ts +2 -0
- package/dist/button/pending.js +17 -21
- package/dist/button/pending.js.map +1 -1
- package/dist/calendar/index.js +1 -1
- package/dist/components/autocomplete/index.js +28 -26
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/avatar/index.js +2 -2
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/index.d.ts +48 -0
- package/dist/components/badge/index.js +122 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/{badge → components/badge}/styles.js +10 -6
- package/dist/components/badge/styles.js.map +1 -0
- package/dist/components/breadcrumbs/index.d.ts +66 -0
- package/dist/components/breadcrumbs/index.js +285 -0
- package/dist/components/breadcrumbs/index.js.map +1 -0
- package/dist/components/calendar/index.d.ts +1 -1
- package/dist/components/calendar/index.js +77 -38
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/checkbox/index.d.ts +7 -1
- package/dist/components/checkbox/index.js +183 -138
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox-group/index.d.ts +93 -0
- package/dist/components/checkbox-group/index.js +306 -0
- package/dist/components/checkbox-group/index.js.map +1 -0
- package/dist/components/chip-group/index.d.ts +4 -3
- package/dist/components/chip-group/index.js +47 -45
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/code/index.d.ts +25 -0
- package/dist/components/code/index.js +87 -0
- package/dist/components/code/index.js.map +1 -0
- package/dist/components/container/index.d.ts +47 -0
- package/dist/components/container/index.js +85 -0
- package/dist/components/container/index.js.map +1 -0
- package/dist/components/copy-field/index.d.ts +5 -5
- package/dist/components/copy-field/index.js +30 -28
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/currency/index.d.ts +2 -2
- package/dist/components/currency/index.js +3 -1
- package/dist/components/currency/index.js.map +1 -1
- package/dist/components/fab/index.d.ts +80 -0
- package/dist/components/fab/index.js +231 -0
- package/dist/components/fab/index.js.map +1 -0
- package/dist/components/fab-menu/index.d.ts +120 -0
- package/dist/components/fab-menu/index.js +640 -0
- package/dist/components/fab-menu/index.js.map +1 -0
- package/dist/components/feed/index.d.ts +57 -0
- package/dist/components/feed/index.js +167 -0
- package/dist/components/feed/index.js.map +1 -0
- package/dist/components/keycap/index.d.ts +27 -0
- package/dist/components/keycap/index.js +136 -0
- package/dist/components/keycap/index.js.map +1 -0
- package/dist/components/list/index.d.ts +6 -5
- package/dist/components/list/index.js +97 -106
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +4 -3
- package/dist/components/menu/index.js +33 -40
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +2 -1
- package/dist/components/meter/index.js +9 -7
- package/dist/components/meter/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +7 -3
- package/dist/components/number-field/index.js +214 -192
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/product-icon/index.d.ts +2 -2
- package/dist/components/product-icon/index.js +2 -2
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.d.ts +2 -1
- package/dist/components/progress-indicator/index.js +15 -13
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +3 -3
- package/dist/components/search-field/index.js +105 -104
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/separator/index.d.ts +3 -2
- package/dist/components/separator/index.js +29 -26
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +2 -2
- package/dist/components/sheet/index.js +22 -26
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +3 -3
- package/dist/components/snackbar/index.js +36 -34
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/supporting-pane/index.d.ts +44 -0
- package/dist/components/supporting-pane/index.js +109 -0
- package/dist/components/supporting-pane/index.js.map +1 -0
- package/dist/components/tag/index.d.ts +58 -0
- package/dist/components/tag/index.js +205 -0
- package/dist/components/tag/index.js.map +1 -0
- package/dist/components/text/index.d.ts +1 -1
- package/dist/components/text/index.js +49 -21
- package/dist/components/text/index.js.map +1 -1
- package/dist/components/text-area/index.d.ts +145 -0
- package/dist/components/text-area/index.js +231 -0
- package/dist/components/text-area/index.js.map +1 -0
- package/dist/components/text-field/index.d.ts +6 -3
- package/dist/components/text-field/index.js +3 -0
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/toolbar/index.d.ts +53 -0
- package/dist/components/toolbar/index.js +185 -0
- package/dist/components/toolbar/index.js.map +1 -0
- package/dist/control/group.js +23 -0
- package/dist/control/group.js.map +1 -0
- package/dist/fab/index.d.ts +19 -0
- package/dist/fab/index.js +147 -0
- package/dist/fab/index.js.map +1 -0
- package/dist/field/index.js +123 -79
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +18 -0
- package/dist/field/styles.js.map +1 -1
- package/dist/form/index.d.ts +1 -2
- package/dist/form/index.js +1 -1
- package/dist/form/index.js.map +1 -1
- package/dist/i18n/index.js +12 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +367 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/i18n/provider.d.ts +53 -0
- package/dist/i18n/provider.js +96 -0
- package/dist/i18n/provider.js.map +1 -0
- package/dist/index.d.ts +19 -4
- package/dist/index.js +17 -3
- package/dist/indicator/index.js +1 -2
- package/dist/indicator/index.js.map +1 -1
- package/dist/mark/index.js +77 -117
- package/dist/mark/index.js.map +1 -1
- package/dist/mark/initials.js.map +1 -1
- package/dist/modal/index.js +59 -46
- package/dist/modal/index.js.map +1 -1
- package/dist/navigation/index.js +8 -5
- package/dist/navigation/index.js.map +1 -1
- package/dist/number/count.js +15 -0
- package/dist/number/count.js.map +1 -0
- package/dist/number/locale.js.map +1 -1
- package/dist/overlay/host.js +30 -21
- package/dist/overlay/host.js.map +1 -1
- package/dist/overlay/placement.js +3 -1
- package/dist/overlay/placement.js.map +1 -1
- package/dist/separator/index.js +7 -0
- package/dist/separator/index.js.map +1 -0
- package/dist/typography/size.js +14 -0
- package/dist/typography/size.js.map +1 -0
- package/package.json +1 -1
- package/dist/badge/styles.js.map +0 -1
|
@@ -2,6 +2,7 @@ import { useTheme } from "../../theme/scope.js";
|
|
|
2
2
|
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
3
3
|
import { usePressFeedback } from "../../press/index.js";
|
|
4
4
|
import { useTypeRole } from "../../typography/roles.js";
|
|
5
|
+
import { useMessages } from "../../i18n/provider.js";
|
|
5
6
|
import { CloseGlyph } from "../../glyphs/index.js";
|
|
6
7
|
import { AnimatedPressable, toggleState } from "../../button/index.js";
|
|
7
8
|
import { stylesOf } from "../../chip/styles.js";
|
|
@@ -98,14 +99,14 @@ function ChipGroup(t0) {
|
|
|
98
99
|
let label;
|
|
99
100
|
let onRemove;
|
|
100
101
|
let onSelectionChange;
|
|
102
|
+
let ownRemoveLabel;
|
|
101
103
|
let props;
|
|
102
104
|
let renderEmptyState;
|
|
103
105
|
let selectedKeys;
|
|
104
106
|
let style;
|
|
105
107
|
let t1;
|
|
106
|
-
let t2;
|
|
107
108
|
if ($[0] !== t0) {
|
|
108
|
-
({children, defaultSelectedKeys, description, disabledKeys, disallowEmptySelection, error, items, label, onRemove, onSelectionChange, removeLabel:
|
|
109
|
+
({children, defaultSelectedKeys, description, disabledKeys, disallowEmptySelection, error, items, label, onRemove, onSelectionChange, removeLabel: ownRemoveLabel, renderEmptyState, selectedKeys, selectionMode: t1, style, ...props} = t0);
|
|
109
110
|
$[0] = t0;
|
|
110
111
|
$[1] = children;
|
|
111
112
|
$[2] = defaultSelectedKeys;
|
|
@@ -117,12 +118,12 @@ function ChipGroup(t0) {
|
|
|
117
118
|
$[8] = label;
|
|
118
119
|
$[9] = onRemove;
|
|
119
120
|
$[10] = onSelectionChange;
|
|
120
|
-
$[11] =
|
|
121
|
-
$[12] =
|
|
122
|
-
$[13] =
|
|
123
|
-
$[14] =
|
|
124
|
-
$[15] =
|
|
125
|
-
$[16] =
|
|
121
|
+
$[11] = ownRemoveLabel;
|
|
122
|
+
$[12] = props;
|
|
123
|
+
$[13] = renderEmptyState;
|
|
124
|
+
$[14] = selectedKeys;
|
|
125
|
+
$[15] = style;
|
|
126
|
+
$[16] = t1;
|
|
126
127
|
} else {
|
|
127
128
|
children = $[1];
|
|
128
129
|
defaultSelectedKeys = $[2];
|
|
@@ -134,21 +135,22 @@ function ChipGroup(t0) {
|
|
|
134
135
|
label = $[8];
|
|
135
136
|
onRemove = $[9];
|
|
136
137
|
onSelectionChange = $[10];
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
ownRemoveLabel = $[11];
|
|
139
|
+
props = $[12];
|
|
140
|
+
renderEmptyState = $[13];
|
|
141
|
+
selectedKeys = $[14];
|
|
142
|
+
style = $[15];
|
|
143
|
+
t1 = $[16];
|
|
143
144
|
}
|
|
144
|
-
const
|
|
145
|
-
const
|
|
145
|
+
const selectionMode = t1 === void 0 ? "none" : t1;
|
|
146
|
+
const messages = useMessages();
|
|
147
|
+
const removeLabel = ownRemoveLabel ?? messages.remove;
|
|
146
148
|
const theme = useTheme();
|
|
147
|
-
const
|
|
148
|
-
let
|
|
149
|
-
if ($[17] !== defaultSelectedKeys || $[18] !== disabledKeys || $[19] !== disallowEmptySelection || $[20] !== items || $[21] !== onSelectionChange || $[22] !== selectedKeys || $[23] !== selectionMode || $[24] !==
|
|
150
|
-
|
|
151
|
-
children:
|
|
149
|
+
const t2 = children;
|
|
150
|
+
let t3;
|
|
151
|
+
if ($[17] !== defaultSelectedKeys || $[18] !== disabledKeys || $[19] !== disallowEmptySelection || $[20] !== items || $[21] !== onSelectionChange || $[22] !== selectedKeys || $[23] !== selectionMode || $[24] !== t2) {
|
|
152
|
+
t3 = {
|
|
153
|
+
children: t2,
|
|
152
154
|
defaultSelectedKeys,
|
|
153
155
|
disabledKeys,
|
|
154
156
|
disallowEmptySelection,
|
|
@@ -164,36 +166,36 @@ function ChipGroup(t0) {
|
|
|
164
166
|
$[21] = onSelectionChange;
|
|
165
167
|
$[22] = selectedKeys;
|
|
166
168
|
$[23] = selectionMode;
|
|
167
|
-
$[24] =
|
|
168
|
-
$[25] =
|
|
169
|
-
} else
|
|
170
|
-
const state = useListState(
|
|
169
|
+
$[24] = t2;
|
|
170
|
+
$[25] = t3;
|
|
171
|
+
} else t3 = $[25];
|
|
172
|
+
const state = useListState(t3);
|
|
171
173
|
const labelId = useId();
|
|
172
174
|
const messageId = useId();
|
|
173
175
|
const labelRole = useTypeRole("labelLarge");
|
|
174
176
|
const messageRole = useTypeRole("bodySmall");
|
|
175
|
-
let
|
|
177
|
+
let t4;
|
|
176
178
|
if ($[26] !== description || $[27] !== error || $[28] !== label || $[29] !== labelId || $[30] !== labelRole || $[31] !== messageId || $[32] !== messageRole || $[33] !== onRemove || $[34] !== props || $[35] !== removeLabel || $[36] !== renderEmptyState || $[37] !== state || $[38] !== style || $[39] !== theme) {
|
|
177
179
|
const own = groupStylesOf(theme);
|
|
178
180
|
const invalid = error !== void 0;
|
|
179
181
|
const message = error ?? description;
|
|
180
|
-
let
|
|
182
|
+
let t5;
|
|
181
183
|
if ($[41] !== state.collection) {
|
|
182
|
-
|
|
184
|
+
t5 = [...state.collection];
|
|
183
185
|
$[41] = state.collection;
|
|
184
|
-
$[42] =
|
|
185
|
-
} else
|
|
186
|
-
const nodes =
|
|
187
|
-
let
|
|
186
|
+
$[42] = t5;
|
|
187
|
+
} else t5 = $[42];
|
|
188
|
+
const nodes = t5;
|
|
189
|
+
let t6;
|
|
188
190
|
if ($[43] !== message || $[44] !== messageId) {
|
|
189
|
-
|
|
191
|
+
t6 = lineOf(messageId, message);
|
|
190
192
|
$[43] = message;
|
|
191
193
|
$[44] = messageId;
|
|
192
|
-
$[45] =
|
|
193
|
-
} else
|
|
194
|
-
let
|
|
194
|
+
$[45] = t6;
|
|
195
|
+
} else t6 = $[45];
|
|
196
|
+
let t7;
|
|
195
197
|
if ($[46] !== nodes || $[47] !== onRemove || $[48] !== removeLabel || $[49] !== renderEmptyState || $[50] !== state) {
|
|
196
|
-
|
|
198
|
+
t7 = nodes.length === 0 ? renderEmptyState?.() : nodes.map((node) => /* @__PURE__ */ jsx(GroupChip, {
|
|
197
199
|
node,
|
|
198
200
|
onRemove,
|
|
199
201
|
removeLabel,
|
|
@@ -204,13 +206,13 @@ function ChipGroup(t0) {
|
|
|
204
206
|
$[48] = removeLabel;
|
|
205
207
|
$[49] = renderEmptyState;
|
|
206
208
|
$[50] = state;
|
|
207
|
-
$[51] =
|
|
208
|
-
} else
|
|
209
|
-
|
|
209
|
+
$[51] = t7;
|
|
210
|
+
} else t7 = $[51];
|
|
211
|
+
t4 = /* @__PURE__ */ jsxs(View, {
|
|
210
212
|
...props,
|
|
211
213
|
"aria-labelledby": labelId,
|
|
212
214
|
role: "group",
|
|
213
|
-
...
|
|
215
|
+
...t6,
|
|
214
216
|
style: composeStyles(own.root, style),
|
|
215
217
|
children: [
|
|
216
218
|
/* @__PURE__ */ jsx(Text, {
|
|
@@ -220,7 +222,7 @@ function ChipGroup(t0) {
|
|
|
220
222
|
}),
|
|
221
223
|
/* @__PURE__ */ jsx(View, {
|
|
222
224
|
style: own.list,
|
|
223
|
-
children:
|
|
225
|
+
children: t7
|
|
224
226
|
}),
|
|
225
227
|
message === void 0 ? null : /* @__PURE__ */ jsx(View, {
|
|
226
228
|
style: own.messageLine,
|
|
@@ -246,9 +248,9 @@ function ChipGroup(t0) {
|
|
|
246
248
|
$[37] = state;
|
|
247
249
|
$[38] = style;
|
|
248
250
|
$[39] = theme;
|
|
249
|
-
$[40] =
|
|
250
|
-
} else
|
|
251
|
-
return
|
|
251
|
+
$[40] = t4;
|
|
252
|
+
} else t4 = $[40];
|
|
253
|
+
return t4;
|
|
252
254
|
}
|
|
253
255
|
/**
|
|
254
256
|
* One chip of a `ChipGroup`, which draws it: the group builds its set from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ComponentRef","ReactElement","ReactNode","Ref","GestureResponderEvent","Insets","PressableProps","StyleProp","TextStyle","ViewProps","ViewStyle","AnimatedStyle","Key","Node","Selection","SelectionMode","ListProps","ListState","useId","useState","Text","NativeText","Platform","Pressable","StyleSheet","View","Animated","useListState","AnimatedPressable","toggleState","ChipGlyph","ChipLabel","measureThen","paintOf","targetOf","useEasedColors","GLYPH_SIZE","RULE_WIDTH","stylesOf","CloseGlyph","TARGET_SIZE","usePressFeedback","useTheme","composeStyles","themedStyles","useTypeRole","ChipGroupChipProps","Omit","children","icon","id","isDisabled","ref","style","textValue","ChipGroupProps","item","T","defaultSelectedKeys","Iterable","description","disabledKeys","disallowEmptySelection","error","items","label","onRemove","keys","Set","onSelectionChange","removeLabel","renderEmptyState","selectedKeys","selectionMode","REMOVE_REACH","bottom","left","right","top","styles","create","chip","maxWidth","layer","position","groupStylesOf","colors","radii","sizing","spacing","stateLayerOpacity","color","onSurfaceVariant","labelError","list","alignItems","flexDirection","flexWrap","gap","sm","minHeight","controlXs","message","messageError","messageLine","marginTop","xs","removable","paddingEnd","lg","remove","borderRadius","circle","end","height","justifyContent","width","removeHovered","opacity","hover","removeLayer","removePressed","pressed","root","rowGap","ChipGroup","t0","$","_c","props","t1","t2","undefined","theme","t3","t4","state","labelId","messageId","labelRole","messageRole","t5","own","invalid","t6","collection","nodes","t7","lineOf","t8","length","map","node","key","ChipGroupChip","_props","getCollectionNode","hasChildNodes","rendered","type","GroupChip","hitSlop","onBlur","onFocus","onHoverIn","onHoverOut","onLayout","onPress","onPressIn","onPressOut","_id","_isDisabled","t9","t10","t11","t12","_textValue","t13","setWidth","selectionManager","selectable","selected","isSelected","assist","disabled","elevated","paint","eased","corners","feedback","container","ring","pill","glyph","content","target","handlers","selectThen","removeThen","OS","RemoveButton","disableRipple","T0","T1","hovered","ringOf","backgroundColor","outlineColor","outlineOffset","outlineStyle","outlineWidth","event","select","Chip","_c","NativeText"],"sources":["../../../src/components/chip-group/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactElement, ReactNode, Ref } from 'react'\nimport type {\n GestureResponderEvent,\n Insets,\n PressableProps,\n StyleProp,\n TextStyle,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\nimport type { Key, Node, Selection, SelectionMode } from 'react-stately'\nimport type { ListProps, ListState } from 'react-stately/useListState'\n\nimport { useId, useState } from 'react'\nimport {\n Text as NativeText,\n Platform,\n Pressable,\n StyleSheet,\n View,\n} from 'react-native'\nimport Animated from 'react-native-reanimated'\nimport { useListState } from 'react-stately/useListState'\n\nimport { AnimatedPressable, toggleState } from '../../button'\nimport {\n ChipGlyph,\n ChipLabel,\n measureThen,\n paintOf,\n targetOf,\n useEasedColors,\n} from '../../chip'\nimport { GLYPH_SIZE, RULE_WIDTH, stylesOf } from '../../chip/styles'\nimport { CloseGlyph } from '../../glyphs'\nimport { TARGET_SIZE, usePressFeedback } from '../../press'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// The chips page's filter and input chips as a set, as kanso-ui's ChipGroup\n// draws them: one or more chosen from a row that wraps, each one removable.\n// The pill is src/chip's, shared with Chip, so the two cannot drift; what is\n// here is the group around them.\n//\n// **Selection is the group's, not each chip's.** It is React Stately's\n// `useListState`, as web's is React Aria's, so `selectionMode`,\n// `selectedKeys`, `defaultSelectedKeys`, `onSelectionChange` and\n// `disabledKeys` behave as they do there. A press on a chip selects it, or\n// clears it if it was selected; in a group that selects one, a press on\n// another moves the selection there. A chip in a group that selects nothing is\n// not a button at all, since a press there would change nothing.\n//\n// **A chip can be removed.** Give the group `onRemove` and each chip draws the\n// page's trailing close glyph, an 18dp glyph in the label's colour, in a\n// target of its own so a press there removes rather than selects. It is a\n// sibling of the chip's own button rather than a child, laid over the pill's\n// end: VoiceOver reaches nothing inside a button, so a close target inside one\n// could never be focused. Its target is WCAG's 24dp, as on web, since the chip\n// around it is no spacing to lean on when the group selects. It draws its\n// hover and pressed layers in the label's colour, and on focus from a key a\n// 2dp ring in the same colour, 1dp out, as web's does: a second ring in the\n// focus role inside a chip would read as two focus treatments for one focus.\n//\n// The label, the line under the chips and the gaps between them are the\n// field chrome's, as RadioGroup draws them: the label in label large and on\n// surface variant, or error while the group has one; the chips 8dp apart and\n// wrapping, from the start edge, so from the right under a right-to-left\n// layout; and the line under them in body small, 4dp further down. The row\n// keeps a chip's height while it is empty, so removing the last chip leaves\n// what sits under the group where it was.\n//\n// Three departures from web. Arrow keys do not move between the chips, and\n// Backspace and Delete do not remove one: each chip and each close target is\n// a stop of its own for a hardware keyboard. The close target is named\n// `Remove` and the chip's text in English unless `removeLabel` says\n// otherwise, where web's follows the reader's locale. And the close glyph\n// takes the label's colour at once rather than easing with it, as the check\n// does.\n\ntype ChipGroupChipProps = Omit<\n PressableProps,\n 'children' | 'disabled' | 'id' | 'style'\n> & {\n /** The chip's label. */\n readonly children: ReactNode\n /**\n * An icon before the label, in the page's 18dp slot and the primary role,\n * which the slot hands it through `useIconStyle()`. The check takes its\n * place while the chip is chosen, so the chip keeps its width.\n */\n readonly icon?: ReactNode\n /**\n * The key selection and removal report the chip by. Without one, a chip\n * drawn from `items` takes its item's `id` or `key`.\n */\n readonly id?: Key\n /**\n * Draws the chip disabled, and takes no presses on it or on its close\n * target, as a key in the group's `disabledKeys` does.\n * @default false\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n /**\n * The chip's text, which names its close target. Read off `children` when\n * they are a plain string, so a chip whose label is an element passes it.\n */\n readonly textValue?: string\n}\n\ntype ChipGroupProps<T extends object = object> = Omit<\n ViewProps,\n 'children' | 'style'\n> & {\n /**\n * The chips, each a `ChipGroup.Chip` with an `id` of its own. With\n * `items`, a function from an item to its chip, called for each item in\n * turn.\n */\n readonly children?: ((item: T) => ReactElement) | ReactNode\n /** The keys selected at first, when the group keeps its own selection. */\n readonly defaultSelectedKeys?: 'all' | Iterable<Key>\n /**\n * A hint under the group. Replaced by `error` when there is one, so the\n * two never stack.\n */\n readonly description?: string\n /** The keys of the chips drawn disabled, which take no presses. */\n readonly disabledKeys?: Iterable<Key>\n /**\n * Keeps the last selected chip selected, so a press on it changes\n * nothing.\n * @default false\n */\n readonly disallowEmptySelection?: boolean\n /**\n * The problem with the current selection, in words. Its presence is what\n * puts the group in its error state: the message and the label's colour\n * both follow from it.\n */\n readonly error?: string\n /** The entries `children` draws a chip for, when it is a function. */\n readonly items?: Iterable<T>\n /**\n * What the group is for. Required rather than optional: a set of chips\n * with no name is a row a screen reader cannot introduce.\n */\n readonly label: string\n /**\n * Called with the key of the chip whose close target was pressed. Given\n * this, every chip draws one; the call site removes the chip from what it\n * renders.\n */\n readonly onRemove?: (keys: Set<Key>) => void\n /** Called with the selected keys whenever a press changes them. */\n readonly onSelectionChange?: (keys: Selection) => void\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * What the close target on each chip is called, for a screen reader. The\n * chip's own text follows it, so this is the verb rather than the whole\n * phrase: \"Remove\" becomes \"Remove First item\".\n * @default 'Remove'\n */\n readonly removeLabel?: string\n /** What the row draws once it holds no chips. */\n readonly renderEmptyState?: () => ReactNode\n /**\n * The selected keys, for a call site holding the selection itself with\n * `onSelectionChange`.\n */\n readonly selectedKeys?: 'all' | Iterable<Key>\n /**\n * Whether a press selects a chip: one at a time, several, or none, in\n * which case the chips are not buttons.\n * @default 'none'\n */\n readonly selectionMode?: SelectionMode\n readonly style?: StyleProp<ViewStyle>\n}\n\n// The close target reaches 3dp past its 18dp glyph on every side, which is\n// WCAG's 24dp.\nconst REMOVE_REACH: Insets = { bottom: 3, left: 3, right: 3, top: 3 }\n\nconst styles = StyleSheet.create({\n // Holds the pill and the close target laid over it, and is never wider\n // than the row, so the pill inside has a width to cut its label at.\n chip: {\n maxWidth: '100%',\n },\n layer: {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n})\n\nconst groupStylesOf = themedStyles(\n ({ colors, radii, sizing, spacing, stateLayerOpacity }) =>\n StyleSheet.create({\n label: {\n color: colors.onSurfaceVariant,\n },\n labelError: {\n color: colors.error,\n },\n // The chips, 8dp apart and wrapping rather than running off the end,\n // since a set is read all at once. A chip's height while empty.\n list: {\n alignItems: 'center',\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: spacing.sm,\n minHeight: sizing.controlXs,\n },\n message: {\n color: colors.onSurfaceVariant,\n },\n messageError: {\n color: colors.error,\n },\n messageLine: {\n marginTop: spacing.xs,\n },\n // A removable pill leaves room at its end for the close target, its 8dp\n // gap before it and the 8dp the page pads after it.\n removable: {\n paddingEnd: spacing.lg + GLYPH_SIZE,\n },\n // The close target, over the pill's end, where the pill's own padding\n // would end: the page pads 8dp on the side the glyph is on, and the\n // label keeps the chip's 8dp gap before it.\n remove: {\n alignItems: 'center',\n borderRadius: radii.circle,\n end: RULE_WIDTH + spacing.lg - spacing.sm,\n height: GLYPH_SIZE,\n justifyContent: 'center',\n marginTop: -GLYPH_SIZE / 2,\n position: 'absolute',\n top: '50%',\n width: GLYPH_SIZE,\n },\n removeHovered: {\n opacity: stateLayerOpacity.hover,\n },\n removeLayer: {\n borderRadius: radii.circle,\n opacity: 0,\n },\n removePressed: {\n opacity: stateLayerOpacity.pressed,\n },\n root: {\n flexDirection: 'column',\n rowGap: spacing.xs,\n },\n }),\n)\n\n/**\n * A labelled set of chips, one or more of which can be chosen, each of which\n * can be removed. Selection is React Stately's: set `selectionMode` to\n * `single` or `multiple`, and pass `selectedKeys` with `onSelectionChange` to\n * control it, or `defaultSelectedKeys` to let the group keep its own.\n *\n * ```tsx\n * <ChipGroup label=\"Label\" onRemove={remove} selectionMode=\"multiple\">\n * <ChipGroup.Chip id=\"first\">First item</ChipGroup.Chip>\n * </ChipGroup>\n * ```\n *\n * Give the group `onRemove` and each chip draws a close target. A chip that\n * toggles nothing else is Chip; this is for a set that shares a value.\n *\n * A screen reader hears a group named by its label, and each chip as a button\n * named by its label, selected or not. On the web the line under the group\n * describes it, as web's does; on iOS and Android it is read after the chips,\n * where it sits. `style`, `ref` and `testID` land on the group as a whole,\n * which is the element a layout positions.\n */\nfunction ChipGroup<T extends object = object>({\n children,\n defaultSelectedKeys,\n description,\n disabledKeys,\n disallowEmptySelection,\n error,\n items,\n label,\n onRemove,\n onSelectionChange,\n removeLabel = 'Remove',\n renderEmptyState,\n selectedKeys,\n selectionMode = 'none',\n style,\n ...props\n}: ChipGroupProps<T>) {\n const theme = useTheme()\n const state = useListState<T>({\n // Each chip builds its own entry in the collection; see\n // `ChipGroupChip.getCollectionNode`. The collection skips what is not an\n // element, as a ReactNode may be, and asks any element for its entry.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- see above\n children: children as ListProps<T>['children'],\n defaultSelectedKeys,\n disabledKeys,\n disallowEmptySelection,\n items,\n onSelectionChange,\n selectedKeys,\n selectionMode,\n })\n const labelId = useId()\n const messageId = useId()\n const labelRole = useTypeRole('labelLarge')\n const messageRole = useTypeRole('bodySmall')\n\n const own = groupStylesOf(theme)\n const invalid = error !== undefined\n const message = error ?? description\n const nodes = [...state.collection]\n\n return (\n <View\n {...props}\n aria-labelledby={labelId}\n role=\"group\"\n {...lineOf(messageId, message)}\n style={composeStyles<ViewStyle>(own.root, style)}\n >\n <NativeText\n id={labelId}\n style={composeStyles<TextStyle>(\n labelRole,\n own.label,\n invalid ? own.labelError : undefined,\n )}\n >\n {label}\n </NativeText>\n <View style={own.list}>\n {nodes.length === 0\n ? renderEmptyState?.()\n : nodes.map((node) => (\n <GroupChip\n key={node.key}\n node={node}\n onRemove={onRemove}\n removeLabel={removeLabel}\n state={state}\n />\n ))}\n </View>\n {message === undefined ? null : (\n <View style={own.messageLine}>\n <NativeText\n id={messageId}\n style={composeStyles<TextStyle>(\n messageRole,\n own.message,\n invalid ? own.messageError : undefined,\n )}\n >\n {message}\n </NativeText>\n </View>\n )}\n </View>\n )\n}\n\n/**\n * One chip of a `ChipGroup`, which draws it: the group builds its set from\n * these, so one renders nothing on its own. Give every chip an `id`, which is\n * the key selection and removal report it by.\n */\nfunction ChipGroupChip(_props: ChipGroupChipProps): null {\n return null\n}\n\n// The entry the group's collection holds for a chip, as React Stately's own\n// `Item` gives one: keyed by the chip's `id`, and carrying the props the group\n// draws it from.\nChipGroupChip.getCollectionNode = function* getCollectionNode(\n props: ChipGroupChipProps,\n) {\n yield {\n 'aria-label': props['aria-label'],\n hasChildNodes: false,\n key: props.id,\n props,\n rendered: props.children,\n textValue:\n props.textValue ??\n (typeof props.children === 'string' ? props.children : ''),\n type: 'item',\n }\n}\n\n/**\n * A chip as the group draws it, from its entry in the collection: the pill,\n * which is a button while the group selects, and the close target over its\n * end while the group removes.\n */\nfunction GroupChip<T>({\n node,\n onRemove,\n removeLabel,\n state,\n}: {\n readonly node: Node<T>\n readonly onRemove: ((keys: Set<Key>) => void) | undefined\n readonly removeLabel: string\n readonly state: ListState<T>\n}) {\n const theme = useTheme()\n // A node carries the props its chip was written with, which\n // `getCollectionNode` puts there and React Stately types as `any`.\n // oxlint-disable-next-line typescript/no-unsafe-assignment -- see above\n const {\n children,\n hitSlop,\n icon,\n id: _id,\n isDisabled: _isDisabled,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onLayout,\n onPress,\n onPressIn,\n onPressOut,\n style,\n textValue: _textValue,\n ...props\n }: ChipGroupChipProps = node.props\n // Until the chip is measured it takes no reach across, rather than one\n // sized for a chip of no width.\n const [width, setWidth] = useState(TARGET_SIZE)\n\n const { selectionManager } = state\n // The selection manager reads a chip's own `isDisabled` off its node, beside\n // the group's `disabledKeys`, so it answers for both.\n const isDisabled = selectionManager.isDisabled(node.key)\n const selectable = selectionManager.selectionMode !== 'none'\n const selected = selectionManager.isSelected(node.key)\n const paint = paintOf(theme, {\n assist: false,\n disabled: isDisabled,\n elevated: false,\n selected,\n })\n const eased = useEasedColors(paint)\n\n const feedback = usePressFeedback({\n color: paint.layer,\n corners: { borderRadius: theme.radii.sm },\n disabled: isDisabled,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onPressIn,\n onPressOut,\n })\n\n const pill = composeStyles<AnimatedStyle<ViewStyle>>(\n stylesOf(theme).pill,\n eased.container,\n onRemove === undefined ? undefined : groupStylesOf(theme).removable,\n feedback.ring,\n style,\n )\n const content = (\n <>\n {selectable ? feedback.layer : null}\n <ChipGlyph color={paint.glyph} icon={icon} selected={selected} />\n <ChipLabel color={eased.label}>{children}</ChipLabel>\n </>\n )\n const target = hitSlop ?? targetOf(width, theme)\n\n return (\n // The view holding the two takes the chip's target too: iOS and Android\n // hand a touch to a view only once its parent has taken it.\n <View hitSlop={selectable ? target : undefined} style={styles.chip}>\n {selectable ? (\n <AnimatedPressable\n role=\"button\"\n {...toggleState(selected)}\n {...props}\n {...feedback.handlers}\n disabled={isDisabled}\n hitSlop={target}\n onLayout={measureThen(setWidth, onLayout)}\n onPress={selectThen(state, node.key, onPress)}\n style={pill}\n >\n {content}\n </AnimatedPressable>\n ) : (\n // A press here changes nothing, so the chip is a view, and takes the\n // props a view has; a press handler among them is never called.\n <Animated.View\n {...props}\n aria-disabled={isDisabled}\n onLayout={onLayout ?? undefined}\n style={pill}\n >\n {content}\n </Animated.View>\n )}\n {onRemove === undefined ? null : (\n <RemoveButton\n color={paint.content}\n isDisabled={isDisabled}\n label={\n node.textValue === ''\n ? removeLabel\n : `${removeLabel} ${node.textValue}`\n }\n onPress={removeThen(onRemove, node.key)}\n />\n )}\n </View>\n )\n}\n\n/**\n * How the group is described by the line under it. On the web it points at\n * the line with `aria-describedby`, as web's group does. iOS and Android\n * focus the chips rather than the group, so there the line is left where a\n * screen reader reaches it in order, after the last chip.\n */\nfunction lineOf(id: string, message: string | undefined) {\n return Platform.OS === 'web' && message !== undefined\n ? { 'aria-describedby': id }\n : undefined\n}\n\n/**\n * A chip's close target: the close glyph in the label's colour, with a hover\n * and a pressed layer of its own and a ring for focus from a key, as the\n * header sets out.\n */\nfunction RemoveButton({\n color,\n isDisabled,\n label,\n onPress,\n}: {\n readonly color: string\n readonly isDisabled: boolean\n readonly label: string\n readonly onPress: () => void\n}) {\n const theme = useTheme()\n const feedback = usePressFeedback({\n color,\n disabled: isDisabled,\n disableRipple: true,\n })\n const own = groupStylesOf(theme)\n\n return (\n <Pressable\n aria-label={label}\n role=\"button\"\n {...feedback.handlers}\n disabled={isDisabled}\n hitSlop={REMOVE_REACH}\n onPress={onPress}\n style={composeStyles<ViewStyle>(\n own.remove,\n feedback.ring === undefined ? undefined : ringOf(color),\n )}\n >\n <View\n style={composeStyles<ViewStyle>(\n styles.layer,\n own.removeLayer,\n { backgroundColor: color },\n feedback.hovered ? own.removeHovered : undefined,\n feedback.pressed ? own.removePressed : undefined,\n )}\n />\n <CloseGlyph color={color} size={GLYPH_SIZE} />\n </Pressable>\n )\n}\n\n// What a press on a chip's close target reports. Built by a call rather than\n// declared in the component, which is what react-perf's\n// jsx-no-new-function-as-prop is after; the React Compiler memoises the\n// result on its inputs.\nfunction removeThen(onRemove: (keys: Set<Key>) => void, key: Key) {\n return () => {\n onRemove(new Set([key]))\n }\n}\n\n// The close target's ring: 2dp in the label's colour, 1dp out, as web's.\nfunction ringOf(color: string): ViewStyle {\n return {\n outlineColor: color,\n outlineOffset: 1,\n outlineStyle: 'solid',\n outlineWidth: 2,\n }\n}\n\n// A press on a chip: the call site's own `onPress`, then the selection,\n// which selects the chip, or clears it if it was selected and the group\n// allows that.\nfunction selectThen<T>(\n state: ListState<T>,\n key: Key,\n onPress: ((event: GestureResponderEvent) => void) | null | undefined,\n) {\n return (event: GestureResponderEvent) => {\n onPress?.(event)\n state.selectionManager.select(key)\n }\n}\n\nChipGroup.Chip = ChipGroupChip\n\nexport { ChipGroup, ChipGroupChip }\nexport type { ChipGroupChipProps, ChipGroupProps }\n"],"mappings":";;;;;;;;;;;;;;;AAyLA,MAAM0E,eAAuB;CAAEC,QAAQ;CAAGC,MAAM;CAAGC,OAAO;CAAGC,KAAK;AAAE;AAEpE,MAAMC,SAASvD,WAAWwD,OAAO;CAG/BC,MAAM,EACJC,UAAU,OACZ;CACAC,OAAO;EACLR,QAAQ;EACRC,MAAM;EACNQ,UAAU;EACVP,OAAO;EACPC,KAAK;CACP;AACF,CAAC;AAED,MAAMO,gBAAgBzC,cACnB,EAAE0C,QAAQC,OAAOC,QAAQC,SAASC,wBACjClE,WAAWwD,OAAO;CAChBf,OAAO,EACL0B,OAAOL,OAAOM,iBAChB;CACAC,YAAY,EACVF,OAAOL,OAAOvB,MAChB;CAGA+B,MAAM;EACJC,YAAY;EACZC,eAAe;EACfC,UAAU;EACVC,KAAKT,QAAQU;EACbC,WAAWZ,OAAOa;CACpB;CACAC,SAAS,EACPX,OAAOL,OAAOM,iBAChB;CACAW,cAAc,EACZZ,OAAOL,OAAOvB,MAChB;CACAyC,aAAa,EACXC,WAAWhB,QAAQiB,GACrB;CAGAC,WAAW,EACTC,YAAYnB,QAAQoB,KAAAA,GACtB;CAIAC,QAAQ;EACNf,YAAY;EACZgB,cAAcxB,MAAMyB;EACpBC,KAAAA,IAAkBxB,QAAQoB,KAAKpB,QAAQU;EACvCe,QAAAA;EACAC,gBAAgB;EAChBV,WAAW;EACXrB,UAAU;EACVN,KAAK;EACLsC,OAAAA;CACF;CACAC,eAAe,EACbC,SAAS5B,kBAAkB6B,MAC7B;CACAC,aAAa;EACXT,cAAcxB,MAAMyB;EACpBM,SAAS;CACX;CACAG,eAAe,EACbH,SAAS5B,kBAAkBgC,QAC7B;CACAC,MAAM;EACJ3B,eAAe;EACf4B,QAAQnC,QAAQiB;CAClB;AACF,CAAC,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AAa;EACXvF,yBAAS,IAAIE,IAAI,CAACqF,GAAG,CAAC,CAAC;CACzB;AACF;AAGA,SAASoD,OAAOlH,OAA0B;CACxC,OAAO;EACLoH,cAAcpH;EACdqH,eAAe;EACfC,cAAc;EACdC,cAAc;CAChB;AACF;AAKA,SAASb,WACP7D,OACAiB,KACAc,SACA;CACA,QAAQ4C,UAAiC;EACvC5C,UAAU4C,KAAK;EACf3E,MAAM2C,iBAAiBiC,OAAO3D,GAAG;CACnC;AACF;AAEA5B,UAAUwF,OAAO3D"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","ReactElement","ReactNode","Ref","GestureResponderEvent","Insets","PressableProps","StyleProp","TextStyle","ViewProps","ViewStyle","AnimatedStyle","Key","Node","Selection","SelectionMode","ListProps","ListState","useId","useState","Text","NativeText","Platform","Pressable","StyleSheet","View","Animated","useListState","AnimatedPressable","toggleState","ChipGlyph","ChipLabel","measureThen","paintOf","targetOf","useEasedColors","GLYPH_SIZE","RULE_WIDTH","stylesOf","CloseGlyph","useMessages","TARGET_SIZE","usePressFeedback","useTheme","composeStyles","themedStyles","useTypeRole","ChipGroupChipProps","Omit","children","icon","id","isDisabled","ref","style","textValue","ChipGroupProps","item","T","defaultSelectedKeys","Iterable","description","disabledKeys","disallowEmptySelection","error","items","label","onRemove","keys","Set","onSelectionChange","removeLabel","renderEmptyState","selectedKeys","selectionMode","REMOVE_REACH","bottom","left","right","top","styles","create","chip","maxWidth","layer","position","groupStylesOf","colors","radii","sizing","spacing","stateLayerOpacity","color","onSurfaceVariant","labelError","list","alignItems","flexDirection","flexWrap","gap","sm","minHeight","controlXs","message","messageError","messageLine","marginTop","xs","removable","paddingEnd","lg","remove","borderRadius","circle","end","height","justifyContent","width","removeHovered","opacity","hover","removeLayer","removePressed","pressed","root","rowGap","ChipGroup","t0","$","_c","ownRemoveLabel","props","t1","undefined","messages","theme","t2","t3","state","labelId","messageId","labelRole","messageRole","t4","own","invalid","t5","collection","nodes","t6","lineOf","t7","length","map","node","key","ChipGroupChip","_props","getCollectionNode","hasChildNodes","rendered","type","GroupChip","hitSlop","onBlur","onFocus","onHoverIn","onHoverOut","onLayout","onPress","onPressIn","onPressOut","_id","_isDisabled","t8","t9","t10","t11","t12","_textValue","t13","setWidth","selectionManager","selectable","selected","isSelected","assist","disabled","elevated","paint","eased","corners","feedback","container","ring","pill","glyph","content","target","handlers","selectThen","removeThen","OS","RemoveButton","disableRipple","T0","T1","hovered","ringOf","backgroundColor","outlineColor","outlineOffset","outlineStyle","outlineWidth","event","select","Chip","_c","NativeText"],"sources":["../../../src/components/chip-group/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactElement, ReactNode, Ref } from 'react'\nimport type {\n GestureResponderEvent,\n Insets,\n PressableProps,\n StyleProp,\n TextStyle,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\nimport type { Key, Node, Selection, SelectionMode } from 'react-stately'\nimport type { ListProps, ListState } from 'react-stately/useListState'\n\nimport { useId, useState } from 'react'\nimport {\n Text as NativeText,\n Platform,\n Pressable,\n StyleSheet,\n View,\n} from 'react-native'\nimport Animated from 'react-native-reanimated'\nimport { useListState } from 'react-stately/useListState'\n\nimport { AnimatedPressable, toggleState } from '../../button'\nimport {\n ChipGlyph,\n ChipLabel,\n measureThen,\n paintOf,\n targetOf,\n useEasedColors,\n} from '../../chip'\nimport { GLYPH_SIZE, RULE_WIDTH, stylesOf } from '../../chip/styles'\nimport { CloseGlyph } from '../../glyphs'\nimport { useMessages } from '../../i18n/provider'\nimport { TARGET_SIZE, usePressFeedback } from '../../press'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// The chips page's filter and input chips as a set, as kanso-ui's ChipGroup\n// draws them: one or more chosen from a row that wraps, each one removable.\n// The pill is src/chip's, shared with Chip, so the two cannot drift; what is\n// here is the group around them.\n//\n// **Selection is the group's, not each chip's.** It is React Stately's\n// `useListState`, as web's is React Aria's, so `selectionMode`,\n// `selectedKeys`, `defaultSelectedKeys`, `onSelectionChange` and\n// `disabledKeys` behave as they do there. A press on a chip selects it, or\n// clears it if it was selected; in a group that selects one, a press on\n// another moves the selection there. A chip in a group that selects nothing is\n// not a button at all, since a press there would change nothing.\n//\n// **A chip can be removed.** Give the group `onRemove` and each chip draws the\n// page's trailing close glyph, an 18dp glyph in the label's colour, in a\n// target of its own so a press there removes rather than selects. It is a\n// sibling of the chip's own button rather than a child, laid over the pill's\n// end: VoiceOver reaches nothing inside a button, so a close target inside one\n// could never be focused. Its target is WCAG's 24dp, as on web, since the chip\n// around it is no spacing to lean on when the group selects. It draws its\n// hover and pressed layers in the label's colour, and on focus from a key a\n// 2dp ring in the same colour, 1dp out, as web's does: a second ring in the\n// focus role inside a chip would read as two focus treatments for one focus.\n//\n// The label, the line under the chips and the gaps between them are the\n// field chrome's, as RadioGroup draws them: the label in label large and on\n// surface variant, or error while the group has one; the chips 8dp apart and\n// wrapping, from the start edge, so from the right under a right-to-left\n// layout; and the line under them in body small, 4dp further down. The row\n// keeps a chip's height while it is empty, so removing the last chip leaves\n// what sits under the group where it was.\n//\n// Two departures from web. Arrow keys do not move between the chips, and\n// Backspace and Delete do not remove one: each chip and each close target is\n// a stop of its own for a hardware keyboard. And the close glyph takes the\n// label's colour at once rather than easing with it, as the check does.\n\ntype ChipGroupChipProps = Omit<\n PressableProps,\n 'children' | 'disabled' | 'id' | 'style'\n> & {\n /** The chip's label. */\n readonly children: ReactNode\n /**\n * An icon before the label, in the page's 18dp slot and the primary role,\n * which the slot hands it through `useIconStyle()`. The check takes its\n * place while the chip is chosen, so the chip keeps its width.\n */\n readonly icon?: ReactNode\n /**\n * The key selection and removal report the chip by. Without one, a chip\n * drawn from `items` takes its item's `id` or `key`.\n */\n readonly id?: Key\n /**\n * Draws the chip disabled, and takes no presses on it or on its close\n * target, as a key in the group's `disabledKeys` does.\n * @default false\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n /**\n * The chip's text, which names its close target. Read off `children` when\n * they are a plain string, so a chip whose label is an element passes it.\n */\n readonly textValue?: string\n}\n\ntype ChipGroupProps<T extends object = object> = Omit<\n ViewProps,\n 'children' | 'style'\n> & {\n /**\n * The chips, each a `ChipGroup.Chip` with an `id` of its own. With\n * `items`, a function from an item to its chip, called for each item in\n * turn.\n */\n readonly children?: ((item: T) => ReactElement) | ReactNode\n /** The keys selected at first, when the group keeps its own selection. */\n readonly defaultSelectedKeys?: 'all' | Iterable<Key>\n /**\n * A hint under the group. Replaced by `error` when there is one, so the\n * two never stack.\n */\n readonly description?: string\n /** The keys of the chips drawn disabled, which take no presses. */\n readonly disabledKeys?: Iterable<Key>\n /**\n * Keeps the last selected chip selected, so a press on it changes\n * nothing.\n * @default false\n */\n readonly disallowEmptySelection?: boolean\n /**\n * The problem with the current selection, in words. Its presence is what\n * puts the group in its error state: the message and the label's colour\n * both follow from it.\n */\n readonly error?: string\n /** The entries `children` draws a chip for, when it is a function. */\n readonly items?: Iterable<T>\n /**\n * What the group is for. Required rather than optional: a set of chips\n * with no name is a row a screen reader cannot introduce.\n */\n readonly label: string\n /**\n * Called with the key of the chip whose close target was pressed. Given\n * this, every chip draws one; the call site removes the chip from what it\n * renders.\n */\n readonly onRemove?: (keys: Set<Key>) => void\n /** Called with the selected keys whenever a press changes them. */\n readonly onSelectionChange?: (keys: Selection) => void\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * What the close target on each chip is called, for a screen reader. The\n * chip's own text follows it, so this is the verb rather than the whole\n * phrase: \"Remove\" becomes \"Remove First item\". Left out, it is the word\n * React Aria gives web's in the `I18nProvider`'s locale, or the device's\n * outside one, \"Remove\" in English.\n */\n readonly removeLabel?: string\n /** What the row draws once it holds no chips. */\n readonly renderEmptyState?: () => ReactNode\n /**\n * The selected keys, for a call site holding the selection itself with\n * `onSelectionChange`.\n */\n readonly selectedKeys?: 'all' | Iterable<Key>\n /**\n * Whether a press selects a chip: one at a time, several, or none, in\n * which case the chips are not buttons.\n * @default 'none'\n */\n readonly selectionMode?: SelectionMode\n readonly style?: StyleProp<ViewStyle>\n}\n\n// The close target reaches 3dp past its 18dp glyph on every side, which is\n// WCAG's 24dp.\nconst REMOVE_REACH: Insets = { bottom: 3, left: 3, right: 3, top: 3 }\n\nconst styles = StyleSheet.create({\n // Holds the pill and the close target laid over it, and is never wider\n // than the row, so the pill inside has a width to cut its label at.\n chip: {\n maxWidth: '100%',\n },\n layer: {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n})\n\nconst groupStylesOf = themedStyles(\n ({ colors, radii, sizing, spacing, stateLayerOpacity }) =>\n StyleSheet.create({\n label: {\n color: colors.onSurfaceVariant,\n },\n labelError: {\n color: colors.error,\n },\n // The chips, 8dp apart and wrapping rather than running off the end,\n // since a set is read all at once. A chip's height while empty.\n list: {\n alignItems: 'center',\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: spacing.sm,\n minHeight: sizing.controlXs,\n },\n message: {\n color: colors.onSurfaceVariant,\n },\n messageError: {\n color: colors.error,\n },\n messageLine: {\n marginTop: spacing.xs,\n },\n // A removable pill leaves room at its end for the close target, its 8dp\n // gap before it and the 8dp the page pads after it.\n removable: {\n paddingEnd: spacing.lg + GLYPH_SIZE,\n },\n // The close target, over the pill's end, where the pill's own padding\n // would end: the page pads 8dp on the side the glyph is on, and the\n // label keeps the chip's 8dp gap before it.\n remove: {\n alignItems: 'center',\n borderRadius: radii.circle,\n end: RULE_WIDTH + spacing.lg - spacing.sm,\n height: GLYPH_SIZE,\n justifyContent: 'center',\n marginTop: -GLYPH_SIZE / 2,\n position: 'absolute',\n top: '50%',\n width: GLYPH_SIZE,\n },\n removeHovered: {\n opacity: stateLayerOpacity.hover,\n },\n removeLayer: {\n borderRadius: radii.circle,\n opacity: 0,\n },\n removePressed: {\n opacity: stateLayerOpacity.pressed,\n },\n root: {\n flexDirection: 'column',\n rowGap: spacing.xs,\n },\n }),\n)\n\n/**\n * A labelled set of chips, one or more of which can be chosen, each of which\n * can be removed. Selection is React Stately's: set `selectionMode` to\n * `single` or `multiple`, and pass `selectedKeys` with `onSelectionChange` to\n * control it, or `defaultSelectedKeys` to let the group keep its own.\n *\n * ```tsx\n * <ChipGroup label=\"Label\" onRemove={remove} selectionMode=\"multiple\">\n * <ChipGroup.Chip id=\"first\">First item</ChipGroup.Chip>\n * </ChipGroup>\n * ```\n *\n * Give the group `onRemove` and each chip draws a close target. A chip that\n * toggles nothing else is Chip; this is for a set that shares a value.\n *\n * A screen reader hears a group named by its label, and each chip as a button\n * named by its label, selected or not. On the web the line under the group\n * describes it, as web's does; on iOS and Android it is read after the chips,\n * where it sits. `style`, `ref` and `testID` land on the group as a whole,\n * which is the element a layout positions.\n */\nfunction ChipGroup<T extends object = object>({\n children,\n defaultSelectedKeys,\n description,\n disabledKeys,\n disallowEmptySelection,\n error,\n items,\n label,\n onRemove,\n onSelectionChange,\n removeLabel: ownRemoveLabel,\n renderEmptyState,\n selectedKeys,\n selectionMode = 'none',\n style,\n ...props\n}: ChipGroupProps<T>) {\n const messages = useMessages()\n const removeLabel = ownRemoveLabel ?? messages.remove\n const theme = useTheme()\n const state = useListState<T>({\n // Each chip builds its own entry in the collection; see\n // `ChipGroupChip.getCollectionNode`. The collection skips what is not an\n // element, as a ReactNode may be, and asks any element for its entry.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- see above\n children: children as ListProps<T>['children'],\n defaultSelectedKeys,\n disabledKeys,\n disallowEmptySelection,\n items,\n onSelectionChange,\n selectedKeys,\n selectionMode,\n })\n const labelId = useId()\n const messageId = useId()\n const labelRole = useTypeRole('labelLarge')\n const messageRole = useTypeRole('bodySmall')\n\n const own = groupStylesOf(theme)\n const invalid = error !== undefined\n const message = error ?? description\n const nodes = [...state.collection]\n\n return (\n <View\n {...props}\n aria-labelledby={labelId}\n role=\"group\"\n {...lineOf(messageId, message)}\n style={composeStyles<ViewStyle>(own.root, style)}\n >\n <NativeText\n id={labelId}\n style={composeStyles<TextStyle>(\n labelRole,\n own.label,\n invalid ? own.labelError : undefined,\n )}\n >\n {label}\n </NativeText>\n <View style={own.list}>\n {nodes.length === 0\n ? renderEmptyState?.()\n : nodes.map((node) => (\n <GroupChip\n key={node.key}\n node={node}\n onRemove={onRemove}\n removeLabel={removeLabel}\n state={state}\n />\n ))}\n </View>\n {message === undefined ? null : (\n <View style={own.messageLine}>\n <NativeText\n id={messageId}\n style={composeStyles<TextStyle>(\n messageRole,\n own.message,\n invalid ? own.messageError : undefined,\n )}\n >\n {message}\n </NativeText>\n </View>\n )}\n </View>\n )\n}\n\n/**\n * One chip of a `ChipGroup`, which draws it: the group builds its set from\n * these, so one renders nothing on its own. Give every chip an `id`, which is\n * the key selection and removal report it by.\n */\nfunction ChipGroupChip(_props: ChipGroupChipProps): null {\n return null\n}\n\n// The entry the group's collection holds for a chip, as React Stately's own\n// `Item` gives one: keyed by the chip's `id`, and carrying the props the group\n// draws it from.\nChipGroupChip.getCollectionNode = function* getCollectionNode(\n props: ChipGroupChipProps,\n) {\n yield {\n 'aria-label': props['aria-label'],\n hasChildNodes: false,\n key: props.id,\n props,\n rendered: props.children,\n textValue:\n props.textValue ??\n (typeof props.children === 'string' ? props.children : ''),\n type: 'item',\n }\n}\n\n/**\n * A chip as the group draws it, from its entry in the collection: the pill,\n * which is a button while the group selects, and the close target over its\n * end while the group removes.\n */\nfunction GroupChip<T>({\n node,\n onRemove,\n removeLabel,\n state,\n}: {\n readonly node: Node<T>\n readonly onRemove: ((keys: Set<Key>) => void) | undefined\n readonly removeLabel: string\n readonly state: ListState<T>\n}) {\n const theme = useTheme()\n // A node carries the props its chip was written with, which\n // `getCollectionNode` puts there and React Stately types as `any`.\n // oxlint-disable-next-line typescript/no-unsafe-assignment -- see above\n const {\n children,\n hitSlop,\n icon,\n id: _id,\n isDisabled: _isDisabled,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onLayout,\n onPress,\n onPressIn,\n onPressOut,\n style,\n textValue: _textValue,\n ...props\n }: ChipGroupChipProps = node.props\n // Until the chip is measured it takes no reach across, rather than one\n // sized for a chip of no width.\n const [width, setWidth] = useState(TARGET_SIZE)\n\n const { selectionManager } = state\n // The selection manager reads a chip's own `isDisabled` off its node, beside\n // the group's `disabledKeys`, so it answers for both.\n const isDisabled = selectionManager.isDisabled(node.key)\n const selectable = selectionManager.selectionMode !== 'none'\n const selected = selectionManager.isSelected(node.key)\n const paint = paintOf(theme, {\n assist: false,\n disabled: isDisabled,\n elevated: false,\n selected,\n })\n const eased = useEasedColors(paint)\n\n const feedback = usePressFeedback({\n color: paint.layer,\n corners: { borderRadius: theme.radii.sm },\n disabled: isDisabled,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onPressIn,\n onPressOut,\n })\n\n const pill = composeStyles<AnimatedStyle<ViewStyle>>(\n stylesOf(theme).pill,\n eased.container,\n onRemove === undefined ? undefined : groupStylesOf(theme).removable,\n feedback.ring,\n style,\n )\n const content = (\n <>\n {selectable ? feedback.layer : null}\n <ChipGlyph color={paint.glyph} icon={icon} selected={selected} />\n <ChipLabel color={eased.label}>{children}</ChipLabel>\n </>\n )\n const target = hitSlop ?? targetOf(width, theme)\n\n return (\n // The view holding the two takes the chip's target too: iOS and Android\n // hand a touch to a view only once its parent has taken it.\n <View hitSlop={selectable ? target : undefined} style={styles.chip}>\n {selectable ? (\n <AnimatedPressable\n role=\"button\"\n {...toggleState(selected)}\n {...props}\n {...feedback.handlers}\n disabled={isDisabled}\n hitSlop={target}\n onLayout={measureThen(setWidth, onLayout)}\n onPress={selectThen(state, node.key, onPress)}\n style={pill}\n >\n {content}\n </AnimatedPressable>\n ) : (\n // A press here changes nothing, so the chip is a view, and takes the\n // props a view has; a press handler among them is never called.\n <Animated.View\n {...props}\n aria-disabled={isDisabled}\n onLayout={onLayout ?? undefined}\n style={pill}\n >\n {content}\n </Animated.View>\n )}\n {onRemove === undefined ? null : (\n <RemoveButton\n color={paint.content}\n isDisabled={isDisabled}\n label={\n node.textValue === ''\n ? removeLabel\n : `${removeLabel} ${node.textValue}`\n }\n onPress={removeThen(onRemove, node.key)}\n />\n )}\n </View>\n )\n}\n\n/**\n * How the group is described by the line under it. On the web it points at\n * the line with `aria-describedby`, as web's group does. iOS and Android\n * focus the chips rather than the group, so there the line is left where a\n * screen reader reaches it in order, after the last chip.\n */\nfunction lineOf(id: string, message: string | undefined) {\n return Platform.OS === 'web' && message !== undefined\n ? { 'aria-describedby': id }\n : undefined\n}\n\n/**\n * A chip's close target: the close glyph in the label's colour, with a hover\n * and a pressed layer of its own and a ring for focus from a key, as the\n * header sets out.\n */\nfunction RemoveButton({\n color,\n isDisabled,\n label,\n onPress,\n}: {\n readonly color: string\n readonly isDisabled: boolean\n readonly label: string\n readonly onPress: () => void\n}) {\n const theme = useTheme()\n const feedback = usePressFeedback({\n color,\n disabled: isDisabled,\n disableRipple: true,\n })\n const own = groupStylesOf(theme)\n\n return (\n <Pressable\n aria-label={label}\n role=\"button\"\n {...feedback.handlers}\n disabled={isDisabled}\n hitSlop={REMOVE_REACH}\n onPress={onPress}\n style={composeStyles<ViewStyle>(\n own.remove,\n feedback.ring === undefined ? undefined : ringOf(color),\n )}\n >\n <View\n style={composeStyles<ViewStyle>(\n styles.layer,\n own.removeLayer,\n { backgroundColor: color },\n feedback.hovered ? own.removeHovered : undefined,\n feedback.pressed ? own.removePressed : undefined,\n )}\n />\n <CloseGlyph color={color} size={GLYPH_SIZE} />\n </Pressable>\n )\n}\n\n// What a press on a chip's close target reports. Built by a call rather than\n// declared in the component, which is what react-perf's\n// jsx-no-new-function-as-prop is after; the React Compiler memoises the\n// result on its inputs.\nfunction removeThen(onRemove: (keys: Set<Key>) => void, key: Key) {\n return () => {\n onRemove(new Set([key]))\n }\n}\n\n// The close target's ring: 2dp in the label's colour, 1dp out, as web's.\nfunction ringOf(color: string): ViewStyle {\n return {\n outlineColor: color,\n outlineOffset: 1,\n outlineStyle: 'solid',\n outlineWidth: 2,\n }\n}\n\n// A press on a chip: the call site's own `onPress`, then the selection,\n// which selects the chip, or clears it if it was selected and the group\n// allows that.\nfunction selectThen<T>(\n state: ListState<T>,\n key: Key,\n onPress: ((event: GestureResponderEvent) => void) | null | undefined,\n) {\n return (event: GestureResponderEvent) => {\n onPress?.(event)\n state.selectionManager.select(key)\n }\n}\n\nChipGroup.Chip = ChipGroupChip\n\nexport { ChipGroup, ChipGroupChip }\nexport type { ChipGroupChipProps, ChipGroupProps }\n"],"mappings":";;;;;;;;;;;;;;;;AAwLA,MAAM2E,eAAuB;CAAEC,QAAQ;CAAGC,MAAM;CAAGC,OAAO;CAAGC,KAAK;AAAE;AAEpE,MAAMC,SAASxD,WAAWyD,OAAO;CAG/BC,MAAM,EACJC,UAAU,OACZ;CACAC,OAAO;EACLR,QAAQ;EACRC,MAAM;EACNQ,UAAU;EACVP,OAAO;EACPC,KAAK;CACP;AACF,CAAC;AAED,MAAMO,gBAAgBzC,cACnB,EAAE0C,QAAQC,OAAOC,QAAQC,SAASC,wBACjCnE,WAAWyD,OAAO;CAChBf,OAAO,EACL0B,OAAOL,OAAOM,iBAChB;CACAC,YAAY,EACVF,OAAOL,OAAOvB,MAChB;CAGA+B,MAAM;EACJC,YAAY;EACZC,eAAe;EACfC,UAAU;EACVC,KAAKT,QAAQU;EACbC,WAAWZ,OAAOa;CACpB;CACAC,SAAS,EACPX,OAAOL,OAAOM,iBAChB;CACAW,cAAc,EACZZ,OAAOL,OAAOvB,MAChB;CACAyC,aAAa,EACXC,WAAWhB,QAAQiB,GACrB;CAGAC,WAAW,EACTC,YAAYnB,QAAQoB,KAAAA,GACtB;CAIAC,QAAQ;EACNf,YAAY;EACZgB,cAAcxB,MAAMyB;EACpBC,KAAAA,IAAkBxB,QAAQoB,KAAKpB,QAAQU;EACvCe,QAAAA;EACAC,gBAAgB;EAChBV,WAAW;EACXrB,UAAU;EACVN,KAAK;EACLs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AAAT,EAAA,MAAAe;EAAAf,EAAA,MAAAkB;EAAAlB,EAAA,MAAAqB;EAAArB,EAAA,MAAAuB;EAAAvB,EAAA,MAAA8C;EAAA9C,EAAA,MAAA+C;EAAA/C,EAAA,MAAAkD;CAAA,OAAAA,MAAAlD,EAAA;CAAA,OAtBZkD;AAsBY;AAQhB,SAASuB,WAAWtI,UAAoCwF,KAAU;CAChE,aAAa;EACXxF,yBAAS,IAAIE,IAAI,CAACsF,GAAG,CAAC,CAAC;CACzB;AACF;AAGA,SAASqD,OAAOpH,OAA0B;CACxC,OAAO;EACLsH,cAActH;EACduH,eAAe;EACfC,cAAc;EACdC,cAAc;CAChB;AACF;AAKA,SAASb,WACP9D,OACAiB,KACAc,SACA;CACA,QAAQ6C,UAAiC;EACvC7C,UAAU6C,KAAK;EACf5E,MAAM4C,iBAAiBiC,OAAO5D,GAAG;CACnC;AACF;AAEA7B,UAAU0F,OAAO5D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Text, TextProps } from "react-native";
|
|
2
|
+
import { ComponentRef, Ref } from "react";
|
|
3
|
+
//#region src/components/code/index.d.ts
|
|
4
|
+
type CodeProps = TextProps & {
|
|
5
|
+
readonly ref?: Ref<ComponentRef<typeof Text>>;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* A fragment of code, a path or an identifier set in the mono face, inside a
|
|
9
|
+
* run of text.
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <Text variant="bodyLarge">
|
|
13
|
+
* A sentence naming <Code>identifier</Code>
|
|
14
|
+
* </Text>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* It takes its colour from the Text around it and 0.875 of its size, so the
|
|
18
|
+
* same Code serves a heading and a footnote. `style`, `ref` and `testID` land
|
|
19
|
+
* on React Native's own Text, and a `style` there applies over the face and
|
|
20
|
+
* the size.
|
|
21
|
+
*/
|
|
22
|
+
declare function Code({ children, style, ...props }: CodeProps): import("react").JSX.Element;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Code, type CodeProps };
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useTheme } from "../../theme/scope.js";
|
|
2
|
+
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
3
|
+
import { useFontFamily } from "../../typography/fonts.js";
|
|
4
|
+
import { familyStyle, useTypeRole } from "../../typography/roles.js";
|
|
5
|
+
import { TextSizeContext, useTextSize } from "../../typography/size.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import { StyleSheet, Text } from "react-native";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/code/index.tsx
|
|
10
|
+
const SHARE = .875;
|
|
11
|
+
const stylesOf = themedStyles(({ colors }) => StyleSheet.create({ outside: { color: colors.onSurface } }));
|
|
12
|
+
/**
|
|
13
|
+
* A fragment of code, a path or an identifier set in the mono face, inside a
|
|
14
|
+
* run of text.
|
|
15
|
+
*
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Text variant="bodyLarge">
|
|
18
|
+
* A sentence naming <Code>identifier</Code>
|
|
19
|
+
* </Text>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* It takes its colour from the Text around it and 0.875 of its size, so the
|
|
23
|
+
* same Code serves a heading and a footnote. `style`, `ref` and `testID` land
|
|
24
|
+
* on React Native's own Text, and a `style` there applies over the face and
|
|
25
|
+
* the size.
|
|
26
|
+
*/
|
|
27
|
+
function Code(t0) {
|
|
28
|
+
const $ = c(18);
|
|
29
|
+
let children;
|
|
30
|
+
let props;
|
|
31
|
+
let style;
|
|
32
|
+
if ($[0] !== t0) {
|
|
33
|
+
({children, style, ...props} = t0);
|
|
34
|
+
$[0] = t0;
|
|
35
|
+
$[1] = children;
|
|
36
|
+
$[2] = props;
|
|
37
|
+
$[3] = style;
|
|
38
|
+
} else {
|
|
39
|
+
children = $[1];
|
|
40
|
+
props = $[2];
|
|
41
|
+
style = $[3];
|
|
42
|
+
}
|
|
43
|
+
const theme = useTheme();
|
|
44
|
+
const around = useTextSize();
|
|
45
|
+
const body = useTypeRole("bodyMedium");
|
|
46
|
+
const mono = useFontFamily(theme.typography.fontFamilyMono);
|
|
47
|
+
const outside = around === void 0;
|
|
48
|
+
const size = (around ?? theme.typography.bodyMediumSize) * SHARE;
|
|
49
|
+
let t1;
|
|
50
|
+
if ($[4] !== body || $[5] !== mono || $[6] !== outside || $[7] !== size || $[8] !== style || $[9] !== theme) {
|
|
51
|
+
t1 = composeStyles(outside ? body : null, outside ? stylesOf(theme).outside : null, familyStyle(mono), { fontSize: size }, style);
|
|
52
|
+
$[4] = body;
|
|
53
|
+
$[5] = mono;
|
|
54
|
+
$[6] = outside;
|
|
55
|
+
$[7] = size;
|
|
56
|
+
$[8] = style;
|
|
57
|
+
$[9] = theme;
|
|
58
|
+
$[10] = t1;
|
|
59
|
+
} else t1 = $[10];
|
|
60
|
+
let t2;
|
|
61
|
+
if ($[11] !== children || $[12] !== size) {
|
|
62
|
+
t2 = /* @__PURE__ */ jsx(TextSizeContext, {
|
|
63
|
+
value: size,
|
|
64
|
+
children
|
|
65
|
+
});
|
|
66
|
+
$[11] = children;
|
|
67
|
+
$[12] = size;
|
|
68
|
+
$[13] = t2;
|
|
69
|
+
} else t2 = $[13];
|
|
70
|
+
let t3;
|
|
71
|
+
if ($[14] !== props || $[15] !== t1 || $[16] !== t2) {
|
|
72
|
+
t3 = /* @__PURE__ */ jsx(Text, {
|
|
73
|
+
...props,
|
|
74
|
+
style: t1,
|
|
75
|
+
children: t2
|
|
76
|
+
});
|
|
77
|
+
$[14] = props;
|
|
78
|
+
$[15] = t1;
|
|
79
|
+
$[16] = t2;
|
|
80
|
+
$[17] = t3;
|
|
81
|
+
} else t3 = $[17];
|
|
82
|
+
return t3;
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
export { Code };
|
|
86
|
+
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","Ref","TextProps","NativeTextProps","TextStyle","Text","NativeText","StyleSheet","useTheme","composeStyles","themedStyles","useFontFamily","familyStyle","useTypeRole","TextSizeContext","useTextSize","SHARE","stylesOf","colors","create","outside","color","onSurface","CodeProps","ref","Code","t0","$","_c","children","props","style","theme","around","body","mono","typography","fontFamilyMono","undefined","size","bodyMediumSize","t1","fontSize","t2","t3","_c","NativeText"],"sources":["../../../src/components/code/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { TextProps as NativeTextProps, TextStyle } from 'react-native'\n\nimport { Text as NativeText, StyleSheet } from 'react-native'\n\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useFontFamily } from '../../typography/fonts'\nimport { familyStyle, useTypeRole } from '../../typography/roles'\nimport { TextSizeContext, useTextSize } from '../../typography/size'\n\n// kanso-ui's Code. No Material Design page draws inline code, so it follows\n// web's reading, which follows the type it interrupts: the role and the colour\n// of the text around it, in the mono face the type tokens carry, at 0.875 of\n// its size. A mono face at the same nominal size as the prose around it reads\n// a little larger, its glyphs being wider and its x-height taller, so the\n// ratio is what makes the two look level rather than what makes them measure\n// the same.\n//\n// No background, as on web. The mono face against the faces the rest of the\n// system uses is already the signal, and a tint would put a second surface\n// inside a Card or a Sheet. A call site wanting one can wrap this.\n//\n// It is a native Text nested in the one it interrupts, which hands it the\n// colour, the weight, the line height and the tracking with nothing set here.\n// The size is the one it cannot take as it stands, since 0.875 of a size needs\n// the number and a nested Text cannot read its parent's, so the library's Text\n// provides the size it ends up at and this sets the share of it. Outside a\n// Text there is no text around to take anything from, so it draws as a Text\n// of the default role and tone would, in body medium on surface, at the same\n// share of body medium's size. Inside some other component's text, which\n// provides no size, it does the same, so nest it in a Text.\n//\n// React Native has no `overflow-wrap: anywhere`. iOS and Android break a word\n// wider than its line between characters rather than letting it run past the\n// edge, and React Native Web's Text sets `overflow-wrap: break-word`, so a\n// package path or a hash still stays inside its container, breaking at the\n// hyphens and slashes in it where a line allows. The LongIdentifier story\n// shows it.\n\n// The size against the text around it, web's `0.875em`.\nconst SHARE = 0.875\n\nconst stylesOf = themedStyles(({ colors }) =>\n StyleSheet.create({\n // The colour of a Text's default tone, for a Code with no text around it.\n outside: {\n color: colors.onSurface,\n },\n }),\n)\n\ntype CodeProps = NativeTextProps & {\n readonly ref?: Ref<ComponentRef<typeof NativeText>>\n}\n\n/**\n * A fragment of code, a path or an identifier set in the mono face, inside a\n * run of text.\n *\n * ```tsx\n * <Text variant=\"bodyLarge\">\n * A sentence naming <Code>identifier</Code>\n * </Text>\n * ```\n *\n * It takes its colour from the Text around it and 0.875 of its size, so the\n * same Code serves a heading and a footnote. `style`, `ref` and `testID` land\n * on React Native's own Text, and a `style` there applies over the face and\n * the size.\n */\nfunction Code({ children, style, ...props }: CodeProps) {\n const theme = useTheme()\n const around = useTextSize()\n const body = useTypeRole('bodyMedium')\n const mono = useFontFamily(theme.typography.fontFamilyMono)\n const outside = around === undefined\n const size = (around ?? theme.typography.bodyMediumSize) * SHARE\n\n return (\n <NativeText\n {...props}\n style={composeStyles<TextStyle>(\n outside ? body : null,\n outside ? stylesOf(theme).outside : null,\n familyStyle(mono),\n { fontSize: size },\n style,\n )}\n >\n <TextSizeContext value={size}>{children}</TextSizeContext>\n </NativeText>\n )\n}\n\nexport type { CodeProps }\n\nexport { Code }\n"],"mappings":";;;;;;;;;AAyCA,MAAMgB,QAAQ;AAEd,MAAMC,WAAWP,cAAc,EAAEQ,aAC/BX,WAAWY,OAAO,EAEhBC,SAAS,EACPC,OAAOH,OAAOI,UAChB,EACF,CAAC,CACH;;;;;;;;;;;;;;;;AAqBA,SAAAG,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA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AV5DC,KAAA,oBAACE,MAAD;GAAW,GACLhB;GACG,OAAAW;GAQPE,UAAAA;EAVS,CAAA;EAWEhB,EAAA,MAAAG;EAAAH,EAAA,MAAAc;EAAAd,EAAA,MAAAgB;EAAAhB,EAAA,MAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,OAXbiB;AAWa"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { View, ViewProps } from "react-native";
|
|
2
|
+
import { ComponentRef, Ref } from "react";
|
|
3
|
+
//#region src/components/container/index.d.ts
|
|
4
|
+
type ContainerPadding = 'default' | 'none';
|
|
5
|
+
type ContainerProps = ViewProps & {
|
|
6
|
+
/**
|
|
7
|
+
* How wide the content may run before it stops growing, in dp or as a
|
|
8
|
+
* share of the width it is given. The container stands in the middle of
|
|
9
|
+
* whatever is left over.
|
|
10
|
+
*
|
|
11
|
+
* Worth setting. The default suits a page of mixed components; prose wants
|
|
12
|
+
* a narrower measure, since what makes a line hard to read is how many
|
|
13
|
+
* characters it holds.
|
|
14
|
+
* @default 960
|
|
15
|
+
*/
|
|
16
|
+
readonly maxInlineSize?: `${number}%` | number;
|
|
17
|
+
/**
|
|
18
|
+
* Horizontal padding, which is what keeps the content off the edge of the
|
|
19
|
+
* window once it is narrower than the measure: 16dp in a compact window and
|
|
20
|
+
* 24dp from medium up. `none` is for a container nested inside one that
|
|
21
|
+
* already has it.
|
|
22
|
+
* @default 'default'
|
|
23
|
+
*/
|
|
24
|
+
readonly padding?: ContainerPadding;
|
|
25
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* A centred measure for a screen or a section of one: content grows to a
|
|
29
|
+
* width and stops, with the leftover space split evenly either side.
|
|
30
|
+
*
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <Container maxInlineSize={600}>
|
|
33
|
+
* <Text>Supporting line</Text>
|
|
34
|
+
* </Container>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* Layout only: it paints no surface and gives its children no container of
|
|
38
|
+
* their own, which is what separates it from Card. It sets no gaps either, so
|
|
39
|
+
* reach for Stack inside it for the rhythm between sections.
|
|
40
|
+
*
|
|
41
|
+
* `style`, `ref` and `testID` land on the `View`, and a `style` there applies
|
|
42
|
+
* over the container's own.
|
|
43
|
+
*/
|
|
44
|
+
declare function Container({ maxInlineSize, padding, style, ...props }: ContainerProps): import("react").JSX.Element;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Container, type ContainerPadding, type ContainerProps };
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { useTheme } from "../../theme/scope.js";
|
|
2
|
+
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
3
|
+
import { useWindowSizeClass } from "../../hooks/useWindowSizeClass.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { StyleSheet, View } from "react-native";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/container/index.tsx
|
|
8
|
+
const DEFAULT_MAX_INLINE_SIZE = 960;
|
|
9
|
+
const styles = StyleSheet.create({ root: {
|
|
10
|
+
alignSelf: "center",
|
|
11
|
+
width: "100%"
|
|
12
|
+
} });
|
|
13
|
+
const stylesOf = themedStyles(({ spacing }) => StyleSheet.create({
|
|
14
|
+
compact: { paddingHorizontal: spacing.lg },
|
|
15
|
+
none: { paddingHorizontal: 0 },
|
|
16
|
+
wider: { paddingHorizontal: spacing.xl }
|
|
17
|
+
}));
|
|
18
|
+
/**
|
|
19
|
+
* A centred measure for a screen or a section of one: content grows to a
|
|
20
|
+
* width and stops, with the leftover space split evenly either side.
|
|
21
|
+
*
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <Container maxInlineSize={600}>
|
|
24
|
+
* <Text>Supporting line</Text>
|
|
25
|
+
* </Container>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* Layout only: it paints no surface and gives its children no container of
|
|
29
|
+
* their own, which is what separates it from Card. It sets no gaps either, so
|
|
30
|
+
* reach for Stack inside it for the rhythm between sections.
|
|
31
|
+
*
|
|
32
|
+
* `style`, `ref` and `testID` land on the `View`, and a `style` there applies
|
|
33
|
+
* over the container's own.
|
|
34
|
+
*/
|
|
35
|
+
function Container(t0) {
|
|
36
|
+
const $ = c(9);
|
|
37
|
+
let props;
|
|
38
|
+
let style;
|
|
39
|
+
let t1;
|
|
40
|
+
let t2;
|
|
41
|
+
if ($[0] !== t0) {
|
|
42
|
+
({maxInlineSize: t1, padding: t2, style, ...props} = t0);
|
|
43
|
+
$[0] = t0;
|
|
44
|
+
$[1] = props;
|
|
45
|
+
$[2] = style;
|
|
46
|
+
$[3] = t1;
|
|
47
|
+
$[4] = t2;
|
|
48
|
+
} else {
|
|
49
|
+
props = $[1];
|
|
50
|
+
style = $[2];
|
|
51
|
+
t1 = $[3];
|
|
52
|
+
t2 = $[4];
|
|
53
|
+
}
|
|
54
|
+
const maxInlineSize = t1 === void 0 ? DEFAULT_MAX_INLINE_SIZE : t1;
|
|
55
|
+
const padding = t2 === void 0 ? "default" : t2;
|
|
56
|
+
const own = stylesOf(useTheme());
|
|
57
|
+
const sizeClass = useWindowSizeClass();
|
|
58
|
+
const padded = padding === "none" ? own.none : sizeClass === "compact" ? own.compact : own.wider;
|
|
59
|
+
const T0 = View;
|
|
60
|
+
const t3 = composeStyles(styles.root, measureOf(maxInlineSize), padded, style);
|
|
61
|
+
let t4;
|
|
62
|
+
if ($[5] !== T0 || $[6] !== props || $[7] !== t3) {
|
|
63
|
+
t4 = /* @__PURE__ */ jsx(T0, {
|
|
64
|
+
...props,
|
|
65
|
+
style: t3
|
|
66
|
+
});
|
|
67
|
+
$[5] = T0;
|
|
68
|
+
$[6] = props;
|
|
69
|
+
$[7] = t3;
|
|
70
|
+
$[8] = t4;
|
|
71
|
+
} else t4 = $[8];
|
|
72
|
+
return t4;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The measure as a style. Built by a call rather than written inline, which
|
|
76
|
+
* is what react-perf's jsx-no-new-object-as-prop is after; the React Compiler
|
|
77
|
+
* memoises the result on its input.
|
|
78
|
+
*/
|
|
79
|
+
function measureOf(maxWidth) {
|
|
80
|
+
return { maxWidth };
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { Container };
|
|
84
|
+
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","Ref","ViewProps","ViewStyle","StyleSheet","View","useWindowSizeClass","useTheme","composeStyles","themedStyles","DEFAULT_MAX_INLINE_SIZE","styles","create","root","alignSelf","width","stylesOf","spacing","compact","paddingHorizontal","lg","none","wider","xl","ContainerPadding","ContainerProps","maxInlineSize","padding","ref","Container","t0","$","_c","props","style","t1","t2","undefined","own","sizeClass","padded","T0","t3","measureOf","t4","maxWidth","_c"],"sources":["../../../src/components/container/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { ViewProps, ViewStyle } from 'react-native'\n\nimport { StyleSheet, View } from 'react-native'\n\nimport { useWindowSizeClass } from '../../hooks/useWindowSizeClass'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// The measure kanso-ui's Container takes by default, the width its own story\n// files centre their page on. A measure is a property of the content: 960dp\n// suits a page of mixed components, and prose wants something narrower. Say\n// which one you mean rather than taking this.\nconst DEFAULT_MAX_INLINE_SIZE = 960\n\n// No Material Design page draws a page container; the layout pages give the\n// margins one keeps. The gutter is the margin those pages give a window of\n// each size, 16dp while the window is compact and 24dp from medium up, read\n// off the window's size class as web reads it off a media query. The measure\n// is the call site's, since the pages leave a pane's width to its content.\n//\n// The container fills the width it is given up to its measure and stands in\n// the middle of what is left, `alignSelf` doing what web's `marginInline:\n// auto` does, so it centres in a column whatever the column aligns its other\n// children to.\nconst styles = StyleSheet.create({\n root: {\n alignSelf: 'center',\n width: '100%',\n },\n})\n\nconst stylesOf = themedStyles(({ spacing }) =>\n StyleSheet.create({\n compact: {\n paddingHorizontal: spacing.lg,\n },\n none: {\n paddingHorizontal: 0,\n },\n wider: {\n paddingHorizontal: spacing.xl,\n },\n }),\n)\n\ntype ContainerPadding = 'default' | 'none'\n\ntype ContainerProps = ViewProps & {\n /**\n * How wide the content may run before it stops growing, in dp or as a\n * share of the width it is given. The container stands in the middle of\n * whatever is left over.\n *\n * Worth setting. The default suits a page of mixed components; prose wants\n * a narrower measure, since what makes a line hard to read is how many\n * characters it holds.\n * @default 960\n */\n readonly maxInlineSize?: `${number}%` | number\n /**\n * Horizontal padding, which is what keeps the content off the edge of the\n * window once it is narrower than the measure: 16dp in a compact window and\n * 24dp from medium up. `none` is for a container nested inside one that\n * already has it.\n * @default 'default'\n */\n readonly padding?: ContainerPadding\n readonly ref?: Ref<ComponentRef<typeof View>>\n}\n\n/**\n * A centred measure for a screen or a section of one: content grows to a\n * width and stops, with the leftover space split evenly either side.\n *\n * ```tsx\n * <Container maxInlineSize={600}>\n * <Text>Supporting line</Text>\n * </Container>\n * ```\n *\n * Layout only: it paints no surface and gives its children no container of\n * their own, which is what separates it from Card. It sets no gaps either, so\n * reach for Stack inside it for the rhythm between sections.\n *\n * `style`, `ref` and `testID` land on the `View`, and a `style` there applies\n * over the container's own.\n */\nfunction Container({\n maxInlineSize = DEFAULT_MAX_INLINE_SIZE,\n padding = 'default',\n style,\n ...props\n}: ContainerProps) {\n const own = stylesOf(useTheme())\n const sizeClass = useWindowSizeClass()\n const padded =\n padding === 'none'\n ? own.none\n : sizeClass === 'compact'\n ? own.compact\n : own.wider\n\n return (\n <View\n {...props}\n style={composeStyles<ViewStyle>(\n styles.root,\n measureOf(maxInlineSize),\n padded,\n style,\n )}\n />\n )\n}\n\n/**\n * The measure as a style. Built by a call rather than written inline, which\n * is what react-perf's jsx-no-new-object-as-prop is after; the React Compiler\n * memoises the result on its input.\n */\nfunction measureOf(maxWidth: ContainerProps['maxInlineSize']): ViewStyle {\n return { maxWidth }\n}\n\nexport type { ContainerPadding, ContainerProps }\n\nexport { Container }\n"],"mappings":";;;;;;;AAaA,MAAMU,0BAA0B;AAYhC,MAAMC,SAASP,WAAWQ,OAAO,EAC/BC,MAAM;CACJC,WAAW;CACXC,OAAO;AACT,EACF,CAAC;AAED,MAAMC,WAAWP,cAAc,EAAEQ,cAC/Bb,WAAWQ,OAAO;CAChBM,SAAS,EACPC,mBAAmBF,QAAQG,GAC7B;CACAC,MAAM,EACJF,mBAAmB,EACrB;CACAG,OAAO,EACLH,mBAAmBF,QAAQM,GAC7B;AACF,CAAC,CACH;;;;;;;;;;;;;;;;;;AA4CA,SAAAM,UAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAmB,CAAA,CAAAJ,eAAAS,IAAAR,SAAAS,IAAAF,OAAA,GAAAD,SAAAH;EAKFC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAH,QAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAJf,MAAAL,gBAAAS,OAAAE,KAAAA,IAAA3B,0BAAAyB;CACA,MAAAR,UAAAS,OAAAC,KAAAA,IAAA,YAAAD;CAIA,MAAAE,MAAYtB,SAAST,SAAS,CAAC;CAC/B,MAAAgC,YAAkBjC,mBAAmB;CACrC,MAAAkC,SACEb,YAAY,SACRW,IAAGjB,OACHkB,cAAc,YACZD,IAAGpB,UACHoB,IAAGhB;CAGR,MAAAmB,KAAApC;CAEQ,MAAAqC,KAAAlC,cACLG,OAAME,MACN8B,UAAUjB,aAAa,GACvBc,QACAN,KACF;CAAC,IAAAU;CAAA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