@lt-three/love3 0.1.0 → 0.1.1
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 +40 -40
- package/dist/native/analytics/animation.d.ts +1 -1
- package/dist/native/analytics/animation.js +1 -1
- package/dist/native/analytics/chart.types.d.ts +3 -3
- package/dist/native/analytics/metric-card.d.ts +3 -3
- package/dist/native/analytics/metric-card.js +3 -3
- package/dist/native/analytics/multi-line-chart.d.ts +9 -8
- package/dist/native/analytics/multi-line-chart.js +14 -13
- package/dist/native/analytics/pie-chart.d.ts +7 -7
- package/dist/native/analytics/pie-chart.js +8 -8
- package/dist/native/analytics/single-number.d.ts +4 -4
- package/dist/native/analytics/single-number.js +2 -2
- package/dist/native/atom/avatar.d.ts +6 -6
- package/dist/native/atom/avatar.js +2 -2
- package/dist/native/atom/badge.d.ts +5 -5
- package/dist/native/atom/button.d.ts +12 -12
- package/dist/native/atom/button.js +8 -8
- package/dist/native/atom/checkbox.d.ts +4 -4
- package/dist/native/atom/checkbox.js +2 -2
- package/dist/native/atom/colored-value.d.ts +4 -4
- package/dist/native/atom/colored-value.js +4 -4
- package/dist/native/atom/image.d.ts +7 -7
- package/dist/native/atom/image.js +2 -2
- package/dist/native/atom/label.d.ts +5 -5
- package/dist/native/atom/label.js +2 -2
- package/dist/native/atom/link.d.ts +5 -5
- package/dist/native/atom/link.js +5 -5
- package/dist/native/atom/readout.d.ts +7 -7
- package/dist/native/atom/readout.js +3 -3
- package/dist/native/atom/search-input.d.ts +2 -2
- package/dist/native/atom/search-input.js +2 -2
- package/dist/native/atom/select.d.ts +14 -14
- package/dist/native/atom/select.js +8 -8
- package/dist/native/atom/separator.d.ts +2 -3
- package/dist/native/atom/separator.js +2 -3
- package/dist/native/atom/skeleton.d.ts +3 -3
- package/dist/native/atom/skeleton.js +3 -3
- package/dist/native/atom/slider.d.ts +6 -6
- package/dist/native/atom/slider.js +3 -3
- package/dist/native/atom/spinner.d.ts +4 -4
- package/dist/native/atom/spinner.js +2 -2
- package/dist/native/atom/switch.d.ts +4 -4
- package/dist/native/atom/switch.js +3 -3
- package/dist/native/atom/symbol.d.ts +7 -7
- package/dist/native/atom/symbol.js +7 -7
- package/dist/native/atom/symbol.types.d.ts +8 -8
- package/dist/native/atom/symbol.types.js +7 -7
- package/dist/native/atom/text-field.d.ts +15 -15
- package/dist/native/atom/text-field.js +5 -5
- package/dist/native/atom/theme-toggle.d.ts +7 -7
- package/dist/native/atom/theme-toggle.js +4 -4
- package/dist/native/atom/timezone-select.d.ts +5 -5
- package/dist/native/atom/timezone-select.js +4 -4
- package/dist/native/atom/typography.d.ts +2 -2
- package/dist/native/atom/typography.js +2 -2
- package/dist/native/base/button.d.ts +13 -13
- package/dist/native/base/button.js +4 -4
- package/dist/native/base/form.d.ts +15 -15
- package/dist/native/base/form.js +11 -11
- package/dist/native/base/glass-card.d.ts +3 -3
- package/dist/native/base/glass-card.js +3 -3
- package/dist/native/base/input.d.ts +8 -8
- package/dist/native/base/input.js +7 -7
- package/dist/native/base/sheet.d.ts +27 -27
- package/dist/native/base/sheet.js +15 -15
- package/dist/native/form/checkbox.d.ts +3 -3
- package/dist/native/form/checkbox.js +2 -2
- package/dist/native/form/date-picker.d.ts +9 -9
- package/dist/native/form/date-picker.js +9 -9
- package/dist/native/form/form.d.ts +5 -6
- package/dist/native/form/form.js +4 -5
- package/dist/native/form/radio-group.d.ts +5 -5
- package/dist/native/form/radio-group.js +4 -4
- package/dist/native/form/select.d.ts +2 -2
- package/dist/native/form/select.js +2 -2
- package/dist/native/form/slider.d.ts +2 -2
- package/dist/native/form/slider.js +2 -2
- package/dist/native/form/switch.d.ts +2 -2
- package/dist/native/form/switch.js +2 -2
- package/dist/native/form/text-area.d.ts +2 -2
- package/dist/native/form/text-area.js +1 -1
- package/dist/native/form/text-input.d.ts +5 -5
- package/dist/native/form/text-input.js +8 -8
- package/dist/native/layout/accordion.d.ts +5 -5
- package/dist/native/layout/accordion.js +2 -2
- package/dist/native/layout/card.d.ts +8 -8
- package/dist/native/layout/card.js +3 -3
- package/dist/native/layout/description.d.ts +2 -2
- package/dist/native/layout/description.js +2 -2
- package/dist/native/layout/error.d.ts +5 -5
- package/dist/native/layout/error.js +2 -2
- package/dist/native/layout/information.d.ts +4 -4
- package/dist/native/layout/information.js +3 -3
- package/dist/native/layout/locked.d.ts +15 -15
- package/dist/native/layout/locked.js +7 -7
- package/dist/native/layout/modal.d.ts +8 -8
- package/dist/native/layout/modal.js +5 -5
- package/dist/native/layout/not-found.d.ts +4 -4
- package/dist/native/layout/not-found.js +3 -3
- package/dist/native/layout/page-frame.d.ts +8 -8
- package/dist/native/layout/page-frame.js +3 -3
- package/dist/native/layout/panel.d.ts +5 -5
- package/dist/native/layout/panel.js +5 -5
- package/dist/native/layout/reorderable-list.d.ts +14 -14
- package/dist/native/layout/reorderable-list.js +10 -10
- package/dist/native/layout/sheet.d.ts +10 -10
- package/dist/native/layout/sheet.js +4 -4
- package/dist/native/layout/simple-dialog.d.ts +3 -3
- package/dist/native/layout/simple-dialog.js +2 -2
- package/dist/native/layout/simple-table.d.ts +18 -18
- package/dist/native/layout/simple-table.js +1 -1
- package/dist/native/layout/tab-bar.d.ts +10 -10
- package/dist/native/layout/tab-bar.js +4 -4
- package/dist/native/layout/tabs.d.ts +6 -6
- package/dist/native/layout/tabs.js +4 -4
- package/dist/native/layout/tuning-panel.d.ts +10 -10
- package/dist/native/layout/tuning-panel.js +15 -15
- package/dist/native/lib/autocomplete.d.ts +1 -1
- package/dist/native/lib/autocomplete.js +1 -1
- package/dist/native/lib/breakpoints.d.ts +3 -3
- package/dist/native/lib/breakpoints.js +3 -3
- package/dist/native/lib/chart-palette.d.ts +2 -2
- package/dist/native/lib/chart-palette.js +2 -2
- package/dist/native/lib/confirm.d.ts +15 -16
- package/dist/native/lib/confirm.js +9 -10
- package/dist/native/lib/control.d.ts +9 -9
- package/dist/native/lib/external-store.d.ts +4 -5
- package/dist/native/lib/keyboard.d.ts +7 -7
- package/dist/native/lib/keyboard.js +7 -7
- package/dist/native/lib/labels.d.ts +6 -6
- package/dist/native/lib/labels.js +6 -6
- package/dist/native/lib/loading.d.ts +3 -3
- package/dist/native/lib/loading.js +3 -3
- package/dist/native/lib/network.d.ts +5 -6
- package/dist/native/lib/network.js +5 -6
- package/dist/native/lib/scheme.d.ts +7 -7
- package/dist/native/lib/scheme.js +3 -3
- package/dist/native/lib/snackbar.d.ts +12 -13
- package/dist/native/lib/snackbar.js +7 -8
- package/dist/native/lib/theme.d.ts +15 -15
- package/dist/native/lib/theme.js +15 -15
- package/dist/native/lib/timezone.d.ts +13 -13
- package/dist/native/lib/timezone.js +13 -13
- package/dist/native/lib/token-color.d.ts +1 -1
- package/dist/native/lib/token-color.js +1 -1
- package/dist/native/lib/tuning-context.d.ts +2 -2
- package/dist/native/lib/tuning.d.ts +10 -10
- package/dist/native/lib/tuning.js +8 -8
- package/dist/native/lib/typography.d.ts +3 -3
- package/dist/native/lib/typography.js +3 -3
- package/dist/native/lib/utils.d.ts +3 -3
- package/dist/native/lib/utils.js +3 -3
- package/dist/native/once/confirm.d.ts +2 -2
- package/dist/native/once/confirm.js +2 -2
- package/dist/native/once/error-boundary.d.ts +3 -3
- package/dist/native/once/error-boundary.js +2 -2
- package/dist/native/once/loading-lock.d.ts +3 -3
- package/dist/native/once/loading-lock.js +3 -3
- package/dist/native/once/offline-banner.d.ts +6 -6
- package/dist/native/once/offline-banner.js +5 -5
- package/dist/native/once/snackbar.d.ts +7 -7
- package/dist/native/once/snackbar.js +5 -5
- package/dist/native/styles.css +21 -21
- package/dist/shared/analytics.d.ts +23 -23
- package/dist/shared/button.d.ts +1 -1
- package/dist/shared/form.d.ts +7 -7
- package/dist/shared/form.js +2 -2
- package/dist/tokens/contrast-pairs.d.ts +9 -9
- package/dist/tokens/contrast-pairs.js +10 -10
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/styles.gen.css +87 -87
- package/dist/tokens/tokens.gen.d.ts +2 -2
- package/dist/tokens/tokens.gen.js +2 -2
- package/dist/tuning/catalog.d.ts +8 -8
- package/dist/tuning/catalog.js +9 -9
- package/dist/tuning/color.d.ts +4 -4
- package/dist/tuning/color.js +5 -5
- package/dist/tuning/css.d.ts +13 -13
- package/dist/tuning/css.js +17 -17
- package/dist/tuning/model.d.ts +11 -11
- package/dist/tuning/model.js +11 -11
- package/dist/tuning/native.d.ts +18 -18
- package/dist/tuning/native.js +18 -18
- package/dist/tuning/schema.d.ts +15 -15
- package/dist/tuning/schema.js +22 -22
- package/dist/tuning/types.d.ts +25 -25
- package/dist/tuning/types.js +6 -6
- package/dist/web/analytics/line-chart.d.ts +6 -6
- package/dist/web/analytics/line-chart.js +3 -3
- package/dist/web/analytics/metric-card.d.ts +6 -6
- package/dist/web/analytics/metric-card.js +5 -5
- package/dist/web/analytics/multi-line-chart.d.ts +23 -23
- package/dist/web/analytics/multi-line-chart.js +33 -33
- package/dist/web/atom/avatar.d.ts +1 -1
- package/dist/web/atom/checkbox.d.ts +6 -6
- package/dist/web/atom/checkbox.js +2 -2
- package/dist/web/atom/colored-value.d.ts +4 -4
- package/dist/web/atom/colored-value.js +4 -4
- package/dist/web/atom/help.d.ts +1 -1
- package/dist/web/atom/segmented-control.d.ts +13 -14
- package/dist/web/atom/segmented-control.js +6 -7
- package/dist/web/atom/select.d.ts +7 -7
- package/dist/web/atom/select.js +5 -5
- package/dist/web/atom/slider.d.ts +3 -3
- package/dist/web/atom/slider.js +2 -2
- package/dist/web/atom/switch.d.ts +3 -3
- package/dist/web/atom/text-area.d.ts +9 -8
- package/dist/web/atom/text-area.js +9 -8
- package/dist/web/atom/text-field.d.ts +5 -4
- package/dist/web/atom/text-field.js +5 -4
- package/dist/web/atom/toggle-chip.d.ts +6 -6
- package/dist/web/atom/toggle-chip.js +4 -4
- package/dist/web/atom/tooltip.d.ts +6 -6
- package/dist/web/atom/tooltip.js +2 -2
- package/dist/web/base/accordion.js +1 -1
- package/dist/web/base/breadcrumb.d.ts +1 -1
- package/dist/web/base/breadcrumb.js +1 -1
- package/dist/web/base/card.d.ts +3 -3
- package/dist/web/base/card.js +2 -2
- package/dist/web/base/dialog.d.ts +1 -1
- package/dist/web/base/dialog.js +1 -1
- package/dist/web/base/form.d.ts +7 -7
- package/dist/web/base/form.js +5 -5
- package/dist/web/base/pagination.d.ts +5 -5
- package/dist/web/base/pagination.js +1 -1
- package/dist/web/base/sheet.d.ts +1 -1
- package/dist/web/base/sheet.js +1 -1
- package/dist/web/base/slider.d.ts +1 -1
- package/dist/web/base/sonner.d.ts +2 -2
- package/dist/web/base/sonner.js +2 -2
- package/dist/web/base/spinner.js +1 -1
- package/dist/web/form/checkbox.d.ts +8 -8
- package/dist/web/form/checkbox.js +3 -3
- package/dist/web/form/radio-group.js +3 -3
- package/dist/web/form/select.js +1 -1
- package/dist/web/form/slider.d.ts +3 -3
- package/dist/web/form/slider.js +3 -3
- package/dist/web/form/switch.d.ts +3 -3
- package/dist/web/form/switch.js +4 -4
- package/dist/web/form/text-area.js +1 -1
- package/dist/web/form/text-input.d.ts +1 -1
- package/dist/web/form/text-input.js +1 -1
- package/dist/web/layout/accordion.d.ts +5 -5
- package/dist/web/layout/accordion.js +2 -2
- package/dist/web/layout/alert-modal.d.ts +11 -11
- package/dist/web/layout/alert-modal.js +7 -7
- package/dist/web/layout/card.d.ts +1 -1
- package/dist/web/layout/information.d.ts +9 -9
- package/dist/web/layout/information.js +7 -7
- package/dist/web/layout/modal.d.ts +1 -1
- package/dist/web/layout/page-frame.d.ts +14 -14
- package/dist/web/layout/page-frame.js +7 -7
- package/dist/web/layout/scroll-area.d.ts +1 -1
- package/dist/web/layout/sheet.d.ts +4 -4
- package/dist/web/layout/simple-table.d.ts +18 -18
- package/dist/web/layout/simple-table.js +2 -2
- package/dist/web/layout/tabs.d.ts +4 -4
- package/dist/web/layout/titled-modal.d.ts +10 -11
- package/dist/web/layout/titled-modal.js +7 -8
- package/dist/web/lib/css-vars.d.ts +6 -6
- package/dist/web/lib/css-vars.js +5 -5
- package/dist/web/lib/dialog.d.ts +4 -4
- package/dist/web/lib/labels.d.ts +8 -8
- package/dist/web/lib/labels.js +8 -8
- package/dist/web/lib/modal-open-focus.d.ts +7 -7
- package/dist/web/lib/modal-open-focus.js +9 -9
- package/dist/web/lib/restore-focus.d.ts +4 -4
- package/dist/web/lib/restore-focus.js +4 -4
- package/dist/web/styles.css +33 -33
- package/package.json +2 -2
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
//#region src/native/atom/image.d.ts
|
|
2
2
|
export type ImageWithLoaderProps = {
|
|
3
3
|
src: string;
|
|
4
|
-
/**
|
|
4
|
+
/** Description for screen readers. Corresponds to the web `alt`. */
|
|
5
5
|
alt: string;
|
|
6
|
-
/**
|
|
6
|
+
/** Opens a full-screen view on tap (default true). */
|
|
7
7
|
expandable?: boolean;
|
|
8
|
-
/**
|
|
8
|
+
/** Text shown when loading fails. This is a shared package, so consumers own the wording. */
|
|
9
9
|
errorText?: string;
|
|
10
|
-
/**
|
|
10
|
+
/** Screen reader name of the expand button. */
|
|
11
11
|
expandLabel?: string;
|
|
12
|
-
/**
|
|
12
|
+
/** Screen reader name of the button that closes the expanded view. */
|
|
13
13
|
closeLabel?: string;
|
|
14
14
|
className?: string;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* An image that shows a skeleton while loading and a placeholder on failure.
|
|
18
|
+
* Mirrors the web atom/image (ImageWithLoader).
|
|
19
19
|
*/
|
|
20
20
|
export declare function ImageWithLoader({ src, alt, expandable, errorText, expandLabel, closeLabel, className }: ImageWithLoaderProps): import("react").JSX.Element;
|
|
21
21
|
//#endregion
|
|
@@ -8,8 +8,8 @@ import { Image } from "expo-image";
|
|
|
8
8
|
|
|
9
9
|
//#region src/native/atom/image.tsx
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* An image that shows a skeleton while loading and a placeholder on failure.
|
|
12
|
+
* Mirrors the web atom/image (ImageWithLoader).
|
|
13
13
|
*/
|
|
14
14
|
function ImageWithLoader({ src, alt, expandable = true, errorText = "画像の読み込みに失敗しました", expandLabel = "画像を拡大する", closeLabel = "閉じる", className }) {
|
|
15
15
|
const [status, setStatus] = useState("loading");
|
|
@@ -2,17 +2,17 @@ import { ReactNode } from "react";
|
|
|
2
2
|
//#region src/native/atom/label.d.ts
|
|
3
3
|
export type LabelProps = {
|
|
4
4
|
children: ReactNode;
|
|
5
|
-
/**
|
|
5
|
+
/** Adds the required mark (`*`). */
|
|
6
6
|
required?: boolean;
|
|
7
|
-
/**
|
|
7
|
+
/** Supplementary text placed to the right of the label. */
|
|
8
8
|
helpText?: ReactNode;
|
|
9
9
|
className?: string;
|
|
10
|
-
/**
|
|
10
|
+
/** The `id` of the text part. Point to it from the input's `aria-labelledby` (the required `*` and the supplementary text are not part of the name). */
|
|
11
11
|
id?: string;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
* web
|
|
14
|
+
* A label that looks the same as the web base/label.
|
|
15
|
+
* RN has no equivalent of the web's `htmlFor`, so tapping the label does not move focus to the input.
|
|
16
16
|
*/
|
|
17
17
|
export declare function Label({ children, required, helpText, className, id }: LabelProps): import("react").JSX.Element;
|
|
18
18
|
//#endregion
|
|
@@ -5,8 +5,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
|
|
6
6
|
//#region src/native/atom/label.tsx
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* web
|
|
8
|
+
* A label that looks the same as the web base/label.
|
|
9
|
+
* RN has no equivalent of the web's `htmlFor`, so tapping the label does not move focus to the input.
|
|
10
10
|
*/
|
|
11
11
|
function Label({ children, required, helpText, className, id }) {
|
|
12
12
|
return /* @__PURE__ */ jsxs(View, {
|
|
@@ -6,13 +6,13 @@ export type LinkProps = ComponentProps<typeof Link$1> & {
|
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
|
-
* expo-router
|
|
10
|
-
*
|
|
9
|
+
* A styled expo-router `Link`. Mirrors the web atom/link
|
|
10
|
+
* (which wraps TanStack Router's `Link`). The `href` type stays the router's own.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* The text color is `text-foreground` (without a color of its own, the link would stay black on a dark background unless the parent passed one). It can be overridden via className.
|
|
13
13
|
*
|
|
14
|
-
* expo-router
|
|
15
|
-
*
|
|
14
|
+
* It can only render inside an expo-router navigation tree, so it has no story on a device
|
|
15
|
+
* (the same reason `base/` is excluded from Storybook). Previews and vitest render it by substituting `<a href>` (`web/expo-router.tsx`).
|
|
16
16
|
*/
|
|
17
17
|
export declare function Link({ disabled, className, children, ...props }: LinkProps): import("react").JSX.Element;
|
|
18
18
|
//#endregion
|
package/dist/native/atom/link.js
CHANGED
|
@@ -4,13 +4,13 @@ import { Link as Link$1 } from "expo-router";
|
|
|
4
4
|
|
|
5
5
|
//#region src/native/atom/link.tsx
|
|
6
6
|
/**
|
|
7
|
-
* expo-router
|
|
8
|
-
*
|
|
7
|
+
* A styled expo-router `Link`. Mirrors the web atom/link
|
|
8
|
+
* (which wraps TanStack Router's `Link`). The `href` type stays the router's own.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* The text color is `text-foreground` (without a color of its own, the link would stay black on a dark background unless the parent passed one). It can be overridden via className.
|
|
11
11
|
*
|
|
12
|
-
* expo-router
|
|
13
|
-
*
|
|
12
|
+
* It can only render inside an expo-router navigation tree, so it has no story on a device
|
|
13
|
+
* (the same reason `base/` is excluded from Storybook). Previews and vitest render it by substituting `<a href>` (`web/expo-router.tsx`).
|
|
14
14
|
*/
|
|
15
15
|
function Link({ disabled, className, children, ...props }) {
|
|
16
16
|
return /* @__PURE__ */ jsx(Link$1, {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
//#region src/native/atom/readout.d.ts
|
|
2
2
|
export type ReadoutProps = {
|
|
3
|
-
/**
|
|
3
|
+
/** Metric name in all caps (e.g. NET PROFIT). */
|
|
4
4
|
label: string;
|
|
5
5
|
value: string;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* The value color. Reserved for callers passing a **theme-independent color with a fixed meaning**,
|
|
8
|
+
* such as gain/loss. Defaults to `text-foreground`.
|
|
9
9
|
*/
|
|
10
10
|
valueColor?: string;
|
|
11
11
|
sub?: string;
|
|
12
|
-
/**
|
|
12
|
+
/** Large (for detail headers) or regular. */
|
|
13
13
|
size?: "md" | "lg";
|
|
14
14
|
className?: string;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* An instrument-style readout, matching the inside of the web MetricCard:
|
|
18
|
+
* three tiers of an all-caps muted label, a large bold number and secondary text.
|
|
19
|
+
* The number is monospaced (Geist Mono + tabular) so the digits line up.
|
|
20
20
|
*/
|
|
21
21
|
export declare function Readout({ label, value, valueColor, sub, size, className }: ReadoutProps): import("react").JSX.Element;
|
|
22
22
|
//#endregion
|
|
@@ -6,9 +6,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
|
|
7
7
|
//#region src/native/atom/readout.tsx
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* An instrument-style readout, matching the inside of the web MetricCard:
|
|
10
|
+
* three tiers of an all-caps muted label, a large bold number and secondary text.
|
|
11
|
+
* The number is monospaced (Geist Mono + tabular) so the digits line up.
|
|
12
12
|
*/
|
|
13
13
|
function Readout({ label, value, valueColor, sub, size = "md", className }) {
|
|
14
14
|
return /* @__PURE__ */ jsxs(View, {
|
|
@@ -5,8 +5,8 @@ export type SearchInputProps = {
|
|
|
5
5
|
placeholder: string;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* A search input. Matches the web SearchInput with the same structure: control corner radius, a soft surface,
|
|
9
|
+
* and a leading search icon (no Liquid Glass capsule).
|
|
10
10
|
*/
|
|
11
11
|
export declare function SearchInput({ value, onChangeText, placeholder }: SearchInputProps): import("react").JSX.Element;
|
|
12
12
|
//#endregion
|
|
@@ -5,8 +5,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
|
|
6
6
|
//#region src/native/atom/search-input.tsx
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* A search input. Matches the web SearchInput with the same structure: control corner radius, a soft surface,
|
|
9
|
+
* and a leading search icon (no Liquid Glass capsule).
|
|
10
10
|
*/
|
|
11
11
|
function SearchInput({ value, onChangeText, placeholder }) {
|
|
12
12
|
const mutedInk = useTokenColor("--ink-500");
|
|
@@ -19,36 +19,36 @@ export type SelectProps = ControlA11yProps & {
|
|
|
19
19
|
description?: ReactNode;
|
|
20
20
|
helpText?: ReactNode;
|
|
21
21
|
disabled?: boolean;
|
|
22
|
-
/**
|
|
22
|
+
/** Error state. The trigger's border becomes destructive and `aria-invalid` is set (inside a form, the `aria-invalid` passed by `FormControl` has the same effect). */
|
|
23
23
|
invalid?: boolean;
|
|
24
24
|
size?: "xs" | "sm" | "default";
|
|
25
|
-
/**
|
|
25
|
+
/** Controls open/closed (internal state when omitted). */
|
|
26
26
|
open?: boolean;
|
|
27
27
|
onOpenChange?: (open: boolean) => void;
|
|
28
|
-
/**
|
|
28
|
+
/** The picker heading (falls back to `label`, then `placeholder`). It becomes the dialog's name. */
|
|
29
29
|
sheetTitle?: ReactNode;
|
|
30
|
-
/**
|
|
30
|
+
/** Screen reader name of the picker's close button (the default is the Japanese "close" label). */
|
|
31
31
|
closeLabel?: string;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
33
|
+
* The trigger's name (when there is no visible label; a string `label` is the default). It is read as "name, current value"
|
|
34
|
+
* (the trigger is a button that opens a sheet, so the value is included in the name).
|
|
35
35
|
*/
|
|
36
36
|
accessibilityLabel?: string;
|
|
37
|
-
/** form
|
|
37
|
+
/** Slot for the form to insert an error. */
|
|
38
38
|
errorSlot?: ReactNode;
|
|
39
39
|
className?: string;
|
|
40
40
|
wrapperClassName?: string;
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
43
|
+
* A controlled-only Select. It has the same API as the web atom/select (flat / grouped options,
|
|
44
|
+
* label, description, error slot, `open` / `onOpenChange`). There is no search, just like on the web.
|
|
45
45
|
*
|
|
46
|
-
* web
|
|
47
|
-
*
|
|
46
|
+
* The web uses a Radix popover, but native lets the user choose in a bottom sheet (`Modal`).
|
|
47
|
+
* The trigger looks the same as the web input frame (control corner radius, 1px line-strong border, raised surface).
|
|
48
48
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
49
|
+
* Accessibility: the trigger is a `button` (`aria-expanded`), not the web's `combobox` (pressing it opens a **dialog**).
|
|
50
|
+
* Its name is "label, current value". The sheet is a dialog whose name is the heading (`sheetTitle`). The options are `radio`s in a `radiogroup`
|
|
51
|
+
* (`aria-checked`; each group is a radiogroup named by its heading).
|
|
52
52
|
*/
|
|
53
53
|
export declare function Select({ value, onValueChange, options, placeholder, label, required, description, helpText, disabled, invalid, size, open, onOpenChange, sheetTitle, closeLabel, accessibilityLabel, errorSlot, className, wrapperClassName, id, accessibilityHint, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid }: SelectProps): import("react").JSX.Element;
|
|
54
54
|
//#endregion
|
|
@@ -22,7 +22,7 @@ function isOptionGroup(option) {
|
|
|
22
22
|
function flatten(options) {
|
|
23
23
|
return options.flatMap((option) => isOptionGroup(option) ? option.options : [option]);
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
25
|
+
/** Groups consecutive non-group options into one segment (so that each becomes a single radiogroup). */
|
|
26
26
|
function toSegments(options) {
|
|
27
27
|
const segments = [];
|
|
28
28
|
for (const option of options) {
|
|
@@ -43,15 +43,15 @@ function toSegments(options) {
|
|
|
43
43
|
return segments;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
46
|
+
* A controlled-only Select. It has the same API as the web atom/select (flat / grouped options,
|
|
47
|
+
* label, description, error slot, `open` / `onOpenChange`). There is no search, just like on the web.
|
|
48
48
|
*
|
|
49
|
-
* web
|
|
50
|
-
*
|
|
49
|
+
* The web uses a Radix popover, but native lets the user choose in a bottom sheet (`Modal`).
|
|
50
|
+
* The trigger looks the same as the web input frame (control corner radius, 1px line-strong border, raised surface).
|
|
51
51
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
52
|
+
* Accessibility: the trigger is a `button` (`aria-expanded`), not the web's `combobox` (pressing it opens a **dialog**).
|
|
53
|
+
* Its name is "label, current value". The sheet is a dialog whose name is the heading (`sheetTitle`). The options are `radio`s in a `radiogroup`
|
|
54
|
+
* (`aria-checked`; each group is a radiogroup named by its heading).
|
|
55
55
|
*/
|
|
56
56
|
function Select({ value, onValueChange, options, placeholder, label, required, description, helpText, disabled, invalid, size = "default", open, onOpenChange, sheetTitle, closeLabel, accessibilityLabel, errorSlot, className, wrapperClassName, id, accessibilityHint, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid }) {
|
|
57
57
|
const [internalOpen, setInternalOpen] = useState(false);
|
|
@@ -4,10 +4,9 @@ export type SeparatorProps = {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
* 1px
|
|
7
|
+
* A 1px divider line. Same role as the web base/separator.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* `.claude/rules/packages/ts/index.md` 参照)。
|
|
9
|
+
* Use `bg-line` rather than `bg-border` for the color (`--border` can fail to follow dark mode after its value is folded).
|
|
11
10
|
*/
|
|
12
11
|
export declare function Separator({ orientation, className }: SeparatorProps): import("react").JSX.Element;
|
|
13
12
|
//#endregion
|
|
@@ -4,10 +4,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
|
|
5
5
|
//#region src/native/atom/separator.tsx
|
|
6
6
|
/**
|
|
7
|
-
* 1px
|
|
7
|
+
* A 1px divider line. Same role as the web base/separator.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* `.claude/rules/packages/ts/index.md` 参照)。
|
|
9
|
+
* Use `bg-line` rather than `bg-border` for the color (`--border` can fail to follow dark mode after its value is folded).
|
|
11
10
|
*/
|
|
12
11
|
function Separator({ orientation = "horizontal", className }) {
|
|
13
12
|
return /* @__PURE__ */ jsx(View, { className: cn("bg-line shrink-0", orientation === "horizontal" ? "h-px w-full" : "h-full w-px", className) });
|
|
@@ -3,10 +3,10 @@ export type SkeletonProps = {
|
|
|
3
3
|
className?: string;
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* A loading placeholder. The same pale surface + pulse as the web base/skeleton.
|
|
7
7
|
*
|
|
8
|
-
* web
|
|
9
|
-
*
|
|
8
|
+
* The web uses `animate-pulse` (a CSS animation), but native should not depend on
|
|
9
|
+
* CSS animation support, so `Animated` produces the same 2-second pulse.
|
|
10
10
|
*/
|
|
11
11
|
export declare function Skeleton({ className }: SkeletonProps): import("react").JSX.Element;
|
|
12
12
|
//#endregion
|
|
@@ -5,10 +5,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
|
|
6
6
|
//#region src/native/atom/skeleton.tsx
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* A loading placeholder. The same pale surface + pulse as the web base/skeleton.
|
|
9
9
|
*
|
|
10
|
-
* web
|
|
11
|
-
*
|
|
10
|
+
* The web uses `animate-pulse` (a CSS animation), but native should not depend on
|
|
11
|
+
* CSS animation support, so `Animated` produces the same 2-second pulse.
|
|
12
12
|
*/
|
|
13
13
|
function Skeleton({ className }) {
|
|
14
14
|
const opacity = useRef(new Animated.Value(1)).current;
|
|
@@ -12,21 +12,21 @@ export type SliderProps = NamedControlA11yProps & {
|
|
|
12
12
|
description?: ReactNode;
|
|
13
13
|
helpText?: ReactNode;
|
|
14
14
|
disabled?: boolean;
|
|
15
|
-
/**
|
|
15
|
+
/** Formatted string shown to the right of the value. Defaults to the raw number. */
|
|
16
16
|
formattedValue?: string;
|
|
17
|
-
/**
|
|
17
|
+
/** Name for screen readers. A string `label` is used as-is, so pass this only when `label` is not a string. */
|
|
18
18
|
accessibilityLabel?: string;
|
|
19
19
|
className?: string;
|
|
20
|
-
/**
|
|
20
|
+
/** Class for the label text (made destructive when the form has an error). */
|
|
21
21
|
labelClassName?: string;
|
|
22
22
|
wrapperClassName?: string;
|
|
23
23
|
errorSlot?: ReactNode;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* A controlled-only Slider. Same layout as the web atom/slider: a label row with the current value at the right end.
|
|
27
27
|
*
|
|
28
|
-
* web
|
|
29
|
-
* `@react-native-community/slider`
|
|
28
|
+
* The web also accepts a range (`number[]`) to match Radix's internal representation,
|
|
29
|
+
* but `@react-native-community/slider` has a single thumb only, so native handles a single value only.
|
|
30
30
|
*/
|
|
31
31
|
export declare function Slider({ value, onValueChange, min, max, step, label, required, description, helpText, disabled, formattedValue, accessibilityLabel, accessibilityHint, className, labelClassName, wrapperClassName, errorSlot, id, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid }: SliderProps): import("react").JSX.Element;
|
|
32
32
|
//#endregion
|
|
@@ -9,10 +9,10 @@ import SliderPrimitive from "@react-native-community/slider";
|
|
|
9
9
|
|
|
10
10
|
//#region src/native/atom/slider.tsx
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* A controlled-only Slider. Same layout as the web atom/slider: a label row with the current value at the right end.
|
|
13
13
|
*
|
|
14
|
-
* web
|
|
15
|
-
* `@react-native-community/slider`
|
|
14
|
+
* The web also accepts a range (`number[]`) to match Radix's internal representation,
|
|
15
|
+
* but `@react-native-community/slider` has a single thumb only, so native handles a single value only.
|
|
16
16
|
*/
|
|
17
17
|
function Slider({ value, onValueChange, min = 0, max, step, label, required, description, helpText, disabled, formattedValue, accessibilityLabel, accessibilityHint, className, labelClassName, wrapperClassName, errorSlot, id, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid }) {
|
|
18
18
|
const action = useTokenColor("--action");
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
//#region src/native/atom/spinner.d.ts
|
|
2
2
|
export type SpinnerProps = {
|
|
3
|
-
/**
|
|
3
|
+
/** Fills the parent and centers the spinner. */
|
|
4
4
|
full?: boolean;
|
|
5
5
|
size?: "small" | "large";
|
|
6
|
-
/**
|
|
6
|
+
/** Name for screen readers. Defaults to the "loading" label. */
|
|
7
7
|
label?: string;
|
|
8
8
|
className?: string;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Loading indicator. Its `full` behavior is the same as the web atom/spinner.
|
|
12
|
+
* It looks like the OS-standard spinner (the native counterpart of the web's rotating lucide icon).
|
|
13
13
|
*/
|
|
14
14
|
export declare function Spinner({ full, size, label, className }: SpinnerProps): import("react").JSX.Element;
|
|
15
15
|
//#endregion
|
|
@@ -6,8 +6,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
6
6
|
|
|
7
7
|
//#region src/native/atom/spinner.tsx
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Loading indicator. Its `full` behavior is the same as the web atom/spinner.
|
|
10
|
+
* It looks like the OS-standard spinner (the native counterpart of the web's rotating lucide icon).
|
|
11
11
|
*/
|
|
12
12
|
function Spinner({ full, size = "small", label = LOADING_LABEL, className }) {
|
|
13
13
|
const ink = useTokenColor("--ink-1000");
|
|
@@ -4,15 +4,15 @@ export type SwitchProps = ControlA11yProps & {
|
|
|
4
4
|
checked: boolean;
|
|
5
5
|
onCheckedChange: (checked: boolean) => void;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
-
/**
|
|
7
|
+
/** Name for screen readers. The switch itself has no text, so always pass it when a label is placed next to it. */
|
|
8
8
|
accessibilityLabel?: string;
|
|
9
9
|
className?: string;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* A round switch identical to the web base/switch (on is filled indigo, off is a wash surface with a line-control border).
|
|
13
13
|
*
|
|
14
|
-
* OS
|
|
15
|
-
*
|
|
14
|
+
* When the OS-standard switch is needed, use the `@expo/ui` one in `base/`. This is
|
|
15
|
+
* an RN implementation that prioritizes looking the same as the web.
|
|
16
16
|
*/
|
|
17
17
|
export declare function Switch({ checked, onCheckedChange, disabled, accessibilityLabel, accessibilityHint, className, id, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid }: SwitchProps): import("react").JSX.Element;
|
|
18
18
|
//#endregion
|
|
@@ -8,10 +8,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
const TRACK_PADDING = 1;
|
|
9
9
|
const KNOB_TRAVEL = 19;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* A round switch identical to the web base/switch (on is filled indigo, off is a wash surface with a line-control border).
|
|
12
12
|
*
|
|
13
|
-
* OS
|
|
14
|
-
*
|
|
13
|
+
* When the OS-standard switch is needed, use the `@expo/ui` one in `base/`. This is
|
|
14
|
+
* an RN implementation that prioritizes looking the same as the web.
|
|
15
15
|
*/
|
|
16
16
|
function Switch({ checked, onCheckedChange, disabled, accessibilityLabel, accessibilityHint, className, id, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid }) {
|
|
17
17
|
const progress = useRef(new Animated.Value(checked ? 1 : 0)).current;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { SymbolProps } from "./symbol.types.js";
|
|
2
2
|
//#region src/native/atom/symbol.d.ts
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* An icon. Drawn with SF Symbols on iOS and Material Symbols on Android.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* **Passing an SF name to `SymbolView` as a string draws nothing on Android.**
|
|
7
|
+
* No exception or warning is raised, so the icon silently disappears (for example the search magnifier,
|
|
8
|
+
* the settings gear, a row's `>` and empty-state icons all vanish). The Android implementation
|
|
9
|
+
* only runs when the name is passed as `{ ios, android }`, so **apps must always use this component**.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
* `fallback`
|
|
11
|
+
* The mapping table is in `symbol.types.ts`. SF names missing from the table are not drawn on Android,
|
|
12
|
+
* so `fallback` renders an empty box of the icon's size to keep the space where the icon should be (the layout does not collapse).
|
|
13
13
|
*/
|
|
14
14
|
export declare function Symbol({ name, size, tintColor, accessibilityLabel, className, style }: SymbolProps): import("react").JSX.Element;
|
|
15
15
|
//#endregion
|
|
@@ -5,15 +5,15 @@ import { SymbolView } from "expo-symbols";
|
|
|
5
5
|
|
|
6
6
|
//#region src/native/atom/symbol.tsx
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* An icon. Drawn with SF Symbols on iOS and Material Symbols on Android.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* **Passing an SF name to `SymbolView` as a string draws nothing on Android.**
|
|
11
|
+
* No exception or warning is raised, so the icon silently disappears (for example the search magnifier,
|
|
12
|
+
* the settings gear, a row's `>` and empty-state icons all vanish). The Android implementation
|
|
13
|
+
* only runs when the name is passed as `{ ios, android }`, so **apps must always use this component**.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
* `fallback`
|
|
15
|
+
* The mapping table is in `symbol.types.ts`. SF names missing from the table are not drawn on Android,
|
|
16
|
+
* so `fallback` renders an empty box of the icon's size to keep the space where the icon should be (the layout does not collapse).
|
|
17
17
|
*/
|
|
18
18
|
function Symbol({ name, size = 20, tintColor, accessibilityLabel, className, style }) {
|
|
19
19
|
const android = SF_TO_ANDROID[name];
|
|
@@ -2,7 +2,7 @@ import { StyleProp, ViewStyle } from "react-native";
|
|
|
2
2
|
import { AndroidSymbol, SFSymbol } from "expo-symbols";
|
|
3
3
|
//#region src/native/atom/symbol.types.d.ts
|
|
4
4
|
export type SymbolProps = {
|
|
5
|
-
/** SF Symbol
|
|
5
|
+
/** The SF Symbol name. On Android it is mapped to Material Symbols via `SF_TO_ANDROID`. */
|
|
6
6
|
name: SFSymbol;
|
|
7
7
|
size?: number;
|
|
8
8
|
tintColor?: string;
|
|
@@ -11,15 +11,15 @@ export type SymbolProps = {
|
|
|
11
11
|
style?: StyleProp<ViewStyle>;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
* SF Symbol
|
|
14
|
+
* Mapping table from SF Symbol to Material Symbols (Android).
|
|
15
15
|
*
|
|
16
|
-
* **`SymbolView`
|
|
17
|
-
* `{ ios, android }
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* **`SymbolView` draws nothing on Android when `name` is passed as a string.**
|
|
17
|
+
* The Android implementation (the Material Symbols font) only runs when `name` is passed as `{ ios, android }`.
|
|
18
|
+
* Passing SF names as plain strings makes icons such as the search magnifier, the settings gear,
|
|
19
|
+
* a row's `>` and empty-state icons **disappear on Android without any exception or warning**.
|
|
20
20
|
*
|
|
21
|
-
* **fill
|
|
22
|
-
*
|
|
21
|
+
* **Do not collapse the fill distinction.** SF sometimes expresses selected or
|
|
22
|
+
* checked state only through `circle` vs `circle.fill`, so the Android side maps them to different icons.
|
|
23
23
|
*/
|
|
24
24
|
export declare const SF_TO_ANDROID: Record<string, AndroidSymbol>;
|
|
25
25
|
//#endregion
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
//#region src/native/atom/symbol.types.ts
|
|
2
2
|
/**
|
|
3
|
-
* SF Symbol
|
|
3
|
+
* Mapping table from SF Symbol to Material Symbols (Android).
|
|
4
4
|
*
|
|
5
|
-
* **`SymbolView`
|
|
6
|
-
* `{ ios, android }
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* **`SymbolView` draws nothing on Android when `name` is passed as a string.**
|
|
6
|
+
* The Android implementation (the Material Symbols font) only runs when `name` is passed as `{ ios, android }`.
|
|
7
|
+
* Passing SF names as plain strings makes icons such as the search magnifier, the settings gear,
|
|
8
|
+
* a row's `>` and empty-state icons **disappear on Android without any exception or warning**.
|
|
9
9
|
*
|
|
10
|
-
* **fill
|
|
11
|
-
*
|
|
10
|
+
* **Do not collapse the fill distinction.** SF sometimes expresses selected or
|
|
11
|
+
* checked state only through `circle` vs `circle.fill`, so the Android side maps them to different icons.
|
|
12
12
|
*/
|
|
13
13
|
const SF_TO_ANDROID = {
|
|
14
14
|
archivebox: "archive",
|