melta-app 0.1.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/LICENSE +21 -0
- package/README.md +197 -0
- package/THIRD_PARTY_LICENSES.md +198 -0
- package/lib/module/components/ActionSheet.js +87 -0
- package/lib/module/components/ActionSheet.js.map +1 -0
- package/lib/module/components/Alert.js +93 -0
- package/lib/module/components/Alert.js.map +1 -0
- package/lib/module/components/Avatar.js +93 -0
- package/lib/module/components/Avatar.js.map +1 -0
- package/lib/module/components/BottomSheet.js +69 -0
- package/lib/module/components/BottomSheet.js.map +1 -0
- package/lib/module/components/Card.js +93 -0
- package/lib/module/components/Card.js.map +1 -0
- package/lib/module/components/Checkbox.js +115 -0
- package/lib/module/components/Checkbox.js.map +1 -0
- package/lib/module/components/EmptyState.js +70 -0
- package/lib/module/components/EmptyState.js.map +1 -0
- package/lib/module/components/Header.js +53 -0
- package/lib/module/components/Header.js.map +1 -0
- package/lib/module/components/Image.js +67 -0
- package/lib/module/components/Image.js.map +1 -0
- package/lib/module/components/Modal.js +95 -0
- package/lib/module/components/Modal.js.map +1 -0
- package/lib/module/components/Progress.js +113 -0
- package/lib/module/components/Progress.js.map +1 -0
- package/lib/module/components/Radio.js +134 -0
- package/lib/module/components/Radio.js.map +1 -0
- package/lib/module/components/Screen.js +57 -0
- package/lib/module/components/Screen.js.map +1 -0
- package/lib/module/components/Skeleton.js +169 -0
- package/lib/module/components/Skeleton.js.map +1 -0
- package/lib/module/components/Surface.js +49 -0
- package/lib/module/components/Surface.js.map +1 -0
- package/lib/module/components/TextField.js +84 -0
- package/lib/module/components/TextField.js.map +1 -0
- package/lib/module/components/Toast.js +105 -0
- package/lib/module/components/Toast.js.map +1 -0
- package/lib/module/components/Toggle.js +77 -0
- package/lib/module/components/Toggle.js.map +1 -0
- package/lib/module/components/action-sheet.styles.js +70 -0
- package/lib/module/components/action-sheet.styles.js.map +1 -0
- package/lib/module/components/alert.styles.js +80 -0
- package/lib/module/components/alert.styles.js.map +1 -0
- package/lib/module/components/avatar.styles.js +94 -0
- package/lib/module/components/avatar.styles.js.map +1 -0
- package/lib/module/components/bottom-sheet.styles.js +55 -0
- package/lib/module/components/bottom-sheet.styles.js.map +1 -0
- package/lib/module/components/card.styles.js +50 -0
- package/lib/module/components/card.styles.js.map +1 -0
- package/lib/module/components/checkbox.styles.js +55 -0
- package/lib/module/components/checkbox.styles.js.map +1 -0
- package/lib/module/components/empty-state.styles.js +60 -0
- package/lib/module/components/empty-state.styles.js.map +1 -0
- package/lib/module/components/header.styles.js +33 -0
- package/lib/module/components/header.styles.js.map +1 -0
- package/lib/module/components/image.styles.js +37 -0
- package/lib/module/components/image.styles.js.map +1 -0
- package/lib/module/components/index.js +26 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/components/modal.styles.js +68 -0
- package/lib/module/components/modal.styles.js.map +1 -0
- package/lib/module/components/progress.styles.js +55 -0
- package/lib/module/components/progress.styles.js.map +1 -0
- package/lib/module/components/radio.styles.js +96 -0
- package/lib/module/components/radio.styles.js.map +1 -0
- package/lib/module/components/screen.styles.js +38 -0
- package/lib/module/components/screen.styles.js.map +1 -0
- package/lib/module/components/skeleton.styles.js +114 -0
- package/lib/module/components/skeleton.styles.js.map +1 -0
- package/lib/module/components/surface.styles.js +37 -0
- package/lib/module/components/surface.styles.js.map +1 -0
- package/lib/module/components/textfield.styles.js +121 -0
- package/lib/module/components/textfield.styles.js.map +1 -0
- package/lib/module/components/toast.styles.js +81 -0
- package/lib/module/components/toast.styles.js.map +1 -0
- package/lib/module/components/toggle.styles.js +69 -0
- package/lib/module/components/toggle.styles.js.map +1 -0
- package/lib/module/contracts/contract-types.js +192 -0
- package/lib/module/contracts/contract-types.js.map +1 -0
- package/lib/module/icons/Icon.js +57 -0
- package/lib/module/icons/Icon.js.map +1 -0
- package/lib/module/icons/glyphs.js +257 -0
- package/lib/module/icons/glyphs.js.map +1 -0
- package/lib/module/icons/icon.styles.js +28 -0
- package/lib/module/icons/icon.styles.js.map +1 -0
- package/lib/module/icons/index.js +14 -0
- package/lib/module/icons/index.js.map +1 -0
- package/lib/module/index.js +20 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/primitives/Button.js +105 -0
- package/lib/module/primitives/Button.js.map +1 -0
- package/lib/module/primitives/Metric.js +68 -0
- package/lib/module/primitives/Metric.js.map +1 -0
- package/lib/module/primitives/Row.js +43 -0
- package/lib/module/primitives/Row.js.map +1 -0
- package/lib/module/primitives/Stack.js +39 -0
- package/lib/module/primitives/Stack.js.map +1 -0
- package/lib/module/primitives/Tag.js +160 -0
- package/lib/module/primitives/Tag.js.map +1 -0
- package/lib/module/primitives/Text.js +54 -0
- package/lib/module/primitives/Text.js.map +1 -0
- package/lib/module/primitives/_internal/focus-ring.js +57 -0
- package/lib/module/primitives/_internal/focus-ring.js.map +1 -0
- package/lib/module/primitives/button.styles.js +88 -0
- package/lib/module/primitives/button.styles.js.map +1 -0
- package/lib/module/primitives/index.js +11 -0
- package/lib/module/primitives/index.js.map +1 -0
- package/lib/module/primitives/metric.styles.js +54 -0
- package/lib/module/primitives/metric.styles.js.map +1 -0
- package/lib/module/primitives/row.styles.js +53 -0
- package/lib/module/primitives/row.styles.js.map +1 -0
- package/lib/module/primitives/stack.styles.js +37 -0
- package/lib/module/primitives/stack.styles.js.map +1 -0
- package/lib/module/primitives/tag.styles.js +56 -0
- package/lib/module/primitives/tag.styles.js.map +1 -0
- package/lib/module/primitives/text.styles.js +33 -0
- package/lib/module/primitives/text.styles.js.map +1 -0
- package/lib/module/theme/ThemeProvider.js +41 -0
- package/lib/module/theme/ThemeProvider.js.map +1 -0
- package/lib/module/theme/index.js +19 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/native-theme.js +201 -0
- package/lib/module/theme/native-theme.js.map +1 -0
- package/lib/module/theme/types.js +4 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/components/ActionSheet.d.ts +45 -0
- package/lib/typescript/src/components/ActionSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/Alert.d.ts +43 -0
- package/lib/typescript/src/components/Alert.d.ts.map +1 -0
- package/lib/typescript/src/components/Avatar.d.ts +45 -0
- package/lib/typescript/src/components/Avatar.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheet.d.ts +36 -0
- package/lib/typescript/src/components/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/Card.d.ts +46 -0
- package/lib/typescript/src/components/Card.d.ts.map +1 -0
- package/lib/typescript/src/components/Checkbox.d.ts +40 -0
- package/lib/typescript/src/components/Checkbox.d.ts.map +1 -0
- package/lib/typescript/src/components/EmptyState.d.ts +36 -0
- package/lib/typescript/src/components/EmptyState.d.ts.map +1 -0
- package/lib/typescript/src/components/Header.d.ts +34 -0
- package/lib/typescript/src/components/Header.d.ts.map +1 -0
- package/lib/typescript/src/components/Image.d.ts +41 -0
- package/lib/typescript/src/components/Image.d.ts.map +1 -0
- package/lib/typescript/src/components/Modal.d.ts +46 -0
- package/lib/typescript/src/components/Modal.d.ts.map +1 -0
- package/lib/typescript/src/components/Progress.d.ts +39 -0
- package/lib/typescript/src/components/Progress.d.ts.map +1 -0
- package/lib/typescript/src/components/Radio.d.ts +52 -0
- package/lib/typescript/src/components/Radio.d.ts.map +1 -0
- package/lib/typescript/src/components/Screen.d.ts +42 -0
- package/lib/typescript/src/components/Screen.d.ts.map +1 -0
- package/lib/typescript/src/components/Skeleton.d.ts +37 -0
- package/lib/typescript/src/components/Skeleton.d.ts.map +1 -0
- package/lib/typescript/src/components/Surface.d.ts +31 -0
- package/lib/typescript/src/components/Surface.d.ts.map +1 -0
- package/lib/typescript/src/components/TextField.d.ts +45 -0
- package/lib/typescript/src/components/TextField.d.ts.map +1 -0
- package/lib/typescript/src/components/Toast.d.ts +45 -0
- package/lib/typescript/src/components/Toast.d.ts.map +1 -0
- package/lib/typescript/src/components/Toggle.d.ts +39 -0
- package/lib/typescript/src/components/Toggle.d.ts.map +1 -0
- package/lib/typescript/src/components/action-sheet.styles.d.ts +65 -0
- package/lib/typescript/src/components/action-sheet.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/alert.styles.d.ts +61 -0
- package/lib/typescript/src/components/alert.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/avatar.styles.d.ts +60 -0
- package/lib/typescript/src/components/avatar.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/bottom-sheet.styles.d.ts +50 -0
- package/lib/typescript/src/components/bottom-sheet.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/card.styles.d.ts +27 -0
- package/lib/typescript/src/components/card.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/checkbox.styles.d.ts +55 -0
- package/lib/typescript/src/components/checkbox.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/empty-state.styles.d.ts +58 -0
- package/lib/typescript/src/components/empty-state.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/header.styles.d.ts +30 -0
- package/lib/typescript/src/components/header.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/image.styles.d.ts +28 -0
- package/lib/typescript/src/components/image.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +23 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/lib/typescript/src/components/modal.styles.d.ts +66 -0
- package/lib/typescript/src/components/modal.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/progress.styles.d.ts +44 -0
- package/lib/typescript/src/components/progress.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/radio.styles.d.ts +91 -0
- package/lib/typescript/src/components/radio.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/screen.styles.d.ts +34 -0
- package/lib/typescript/src/components/screen.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/skeleton.styles.d.ts +105 -0
- package/lib/typescript/src/components/skeleton.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/surface.styles.d.ts +31 -0
- package/lib/typescript/src/components/surface.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/textfield.styles.d.ts +75 -0
- package/lib/typescript/src/components/textfield.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/toast.styles.d.ts +62 -0
- package/lib/typescript/src/components/toast.styles.d.ts.map +1 -0
- package/lib/typescript/src/components/toggle.styles.d.ts +53 -0
- package/lib/typescript/src/components/toggle.styles.d.ts.map +1 -0
- package/lib/typescript/src/contracts/contract-types.d.ts +193 -0
- package/lib/typescript/src/contracts/contract-types.d.ts.map +1 -0
- package/lib/typescript/src/icons/Icon.d.ts +40 -0
- package/lib/typescript/src/icons/Icon.d.ts.map +1 -0
- package/lib/typescript/src/icons/glyphs.d.ts +259 -0
- package/lib/typescript/src/icons/glyphs.d.ts.map +1 -0
- package/lib/typescript/src/icons/icon.styles.d.ts +20 -0
- package/lib/typescript/src/icons/icon.styles.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +12 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +12 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/primitives/Button.d.ts +48 -0
- package/lib/typescript/src/primitives/Button.d.ts.map +1 -0
- package/lib/typescript/src/primitives/Metric.d.ts +38 -0
- package/lib/typescript/src/primitives/Metric.d.ts.map +1 -0
- package/lib/typescript/src/primitives/Row.d.ts +37 -0
- package/lib/typescript/src/primitives/Row.d.ts.map +1 -0
- package/lib/typescript/src/primitives/Stack.d.ts +33 -0
- package/lib/typescript/src/primitives/Stack.d.ts.map +1 -0
- package/lib/typescript/src/primitives/Tag.d.ts +43 -0
- package/lib/typescript/src/primitives/Tag.d.ts.map +1 -0
- package/lib/typescript/src/primitives/Text.d.ts +45 -0
- package/lib/typescript/src/primitives/Text.d.ts.map +1 -0
- package/lib/typescript/src/primitives/_internal/focus-ring.d.ts +31 -0
- package/lib/typescript/src/primitives/_internal/focus-ring.d.ts.map +1 -0
- package/lib/typescript/src/primitives/button.styles.d.ts +29 -0
- package/lib/typescript/src/primitives/button.styles.d.ts.map +1 -0
- package/lib/typescript/src/primitives/index.d.ts +8 -0
- package/lib/typescript/src/primitives/index.d.ts.map +1 -0
- package/lib/typescript/src/primitives/metric.styles.d.ts +43 -0
- package/lib/typescript/src/primitives/metric.styles.d.ts.map +1 -0
- package/lib/typescript/src/primitives/row.styles.d.ts +50 -0
- package/lib/typescript/src/primitives/row.styles.d.ts.map +1 -0
- package/lib/typescript/src/primitives/stack.styles.d.ts +34 -0
- package/lib/typescript/src/primitives/stack.styles.d.ts.map +1 -0
- package/lib/typescript/src/primitives/tag.styles.d.ts +32 -0
- package/lib/typescript/src/primitives/tag.styles.d.ts.map +1 -0
- package/lib/typescript/src/primitives/text.styles.d.ts +26 -0
- package/lib/typescript/src/primitives/text.styles.d.ts.map +1 -0
- package/lib/typescript/src/theme/ThemeProvider.d.ts +32 -0
- package/lib/typescript/src/theme/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts +15 -0
- package/lib/typescript/src/theme/index.d.ts.map +1 -0
- package/lib/typescript/src/theme/native-theme.d.ts +3 -0
- package/lib/typescript/src/theme/native-theme.d.ts.map +1 -0
- package/lib/typescript/src/theme/types.d.ts +121 -0
- package/lib/typescript/src/theme/types.d.ts.map +1 -0
- package/package.json +120 -0
- package/src/components/ActionSheet.tsx +112 -0
- package/src/components/Alert.tsx +84 -0
- package/src/components/Avatar.tsx +110 -0
- package/src/components/BottomSheet.tsx +81 -0
- package/src/components/Card.tsx +102 -0
- package/src/components/Checkbox.tsx +107 -0
- package/src/components/EmptyState.tsx +64 -0
- package/src/components/Header.tsx +51 -0
- package/src/components/Image.tsx +89 -0
- package/src/components/Modal.tsx +113 -0
- package/src/components/Progress.tsx +124 -0
- package/src/components/Radio.tsx +151 -0
- package/src/components/Screen.tsx +62 -0
- package/src/components/Skeleton.tsx +154 -0
- package/src/components/Surface.tsx +37 -0
- package/src/components/TextField.tsx +102 -0
- package/src/components/Toast.tsx +103 -0
- package/src/components/Toggle.tsx +94 -0
- package/src/components/action-sheet.styles.ts +102 -0
- package/src/components/alert.styles.ts +115 -0
- package/src/components/avatar.styles.ts +110 -0
- package/src/components/bottom-sheet.styles.ts +78 -0
- package/src/components/card.styles.ts +56 -0
- package/src/components/checkbox.styles.ts +83 -0
- package/src/components/empty-state.styles.ts +98 -0
- package/src/components/header.styles.ts +44 -0
- package/src/components/image.styles.ts +36 -0
- package/src/components/index.ts +23 -0
- package/src/components/modal.styles.ts +106 -0
- package/src/components/progress.styles.ts +74 -0
- package/src/components/radio.styles.ts +132 -0
- package/src/components/screen.styles.ts +44 -0
- package/src/components/skeleton.styles.ts +155 -0
- package/src/components/surface.styles.ts +50 -0
- package/src/components/textfield.styles.ts +135 -0
- package/src/components/toast.styles.ts +115 -0
- package/src/components/toggle.styles.ts +73 -0
- package/src/contracts/contract-types.ts +199 -0
- package/src/icons/Icon.tsx +65 -0
- package/src/icons/glyphs.ts +54 -0
- package/src/icons/icon.styles.ts +37 -0
- package/src/icons/index.ts +12 -0
- package/src/index.ts +24 -0
- package/src/primitives/Button.tsx +114 -0
- package/src/primitives/Metric.tsx +67 -0
- package/src/primitives/Row.tsx +54 -0
- package/src/primitives/Stack.tsx +42 -0
- package/src/primitives/Tag.tsx +126 -0
- package/src/primitives/Text.tsx +71 -0
- package/src/primitives/_internal/focus-ring.tsx +59 -0
- package/src/primitives/button.styles.ts +69 -0
- package/src/primitives/index.ts +8 -0
- package/src/primitives/metric.styles.ts +75 -0
- package/src/primitives/row.styles.ts +66 -0
- package/src/primitives/stack.styles.ts +47 -0
- package/src/primitives/tag.styles.ts +65 -0
- package/src/primitives/text.styles.ts +42 -0
- package/src/theme/ThemeProvider.tsx +60 -0
- package/src/theme/index.ts +18 -0
- package/src/theme/native-theme.ts +215 -0
- package/src/theme/types.ts +137 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveTagBase","theme","gap","spacing","paddingHorizontal","paddingVertical","borderRadius","radius","full","resolveTagVariant","mode","variant","selected","c","color","sem","semantic","bg","textColor","font","primary","borderWidth","border"],"sourceRoot":"../../../src","sources":["primitives/tag.styles.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA,OAAO,SAASA,cAAcA,CAACC,KAAkB,EAK/C;EACA,OAAO;IACLC,GAAG,EAAED,KAAK,CAACE,OAAO,CAAC,GAAG,CAAC;IACvBC,iBAAiB,EAAEH,KAAK,CAACE,OAAO,CAAC,GAAG,CAAC;IACrCE,eAAe,EAAEJ,KAAK,CAACE,OAAO,CAAC,GAAG,CAAC;IACnCG,YAAY,EAAEL,KAAK,CAACM,MAAM,CAACC;EAC7B,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAC/BR,KAAkB,EAClBS,IAAe,EACfC,OAAmB,EACnBC,QAAQ,GAAG,KAAK,EAC6E;EAC7F,MAAMC,CAAC,GAAGZ,KAAK,CAACa,KAAK;EACrB,MAAMC,GAAG,GAAGF,CAAC,CAACG,QAAQ,CAACN,IAAI,CAAC;EAC5B,QAAQC,OAAO;IACb,KAAK,OAAO;IACZ,KAAK,WAAW;MACd,OAAO;QAAEM,EAAE,EAAEF,GAAG,CAAC,aAAa,CAAC;QAAEG,SAAS,EAAEH,GAAG,CAAC,cAAc,CAAC;QAAEI,IAAI,EAAE;MAAK,CAAC;IAC/E,KAAK,aAAa;MAChB,OAAOP,QAAQ,GACX;QACEK,EAAE,EAAEJ,CAAC,CAACO,OAAO,CAAC,IAAI,CAAC;QACnBC,WAAW,EAAE,CAAC;QACdC,MAAM,EAAET,CAAC,CAACO,OAAO,CAAC,KAAK,CAAC;QACxBF,SAAS,EAAEL,CAAC,CAACO,OAAO,CAAC,KAAK,CAAC;QAC3BD,IAAI,EAAE;MACR,CAAC,GACD;QACEF,EAAE,EAAEF,GAAG,CAAC,YAAY,CAAC;QACrBM,WAAW,EAAE,CAAC;QACdC,MAAM,EAAEP,GAAG,CAAC,gBAAgB,CAAC;QAC7BG,SAAS,EAAEH,GAAG,CAAC,cAAc,CAAC;QAC9BI,IAAI,EAAE;MACR,CAAC;EACT;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* text.styles — Text の pure style resolver(styleRefs conformance 対応で Text.tsx から分離)。
|
|
5
|
+
*
|
|
6
|
+
* react-native を import しない純粋モジュールにすることで node テスト(tsx --test)から
|
|
7
|
+
* 直接実行できる。recipes/app/text.recipe.json(melta-contracts の styleRefs)との
|
|
8
|
+
* 機械照合は scripts/lib/text-conformance.test.ts が行う。
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** letterSpacing の切替軸(text.recipe description の role prop に対応)。 */
|
|
12
|
+
|
|
13
|
+
/** Text の形状 style(mode 非依存部分。文字色は render 時に semantic colors から取る)。 */
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* variant / role / weight → 形状解決(text.recipe styleRefs の 1:1 写像)。
|
|
17
|
+
* - fontSize token は複合値(px + lineHeight 比率)。theme 生成時に lineHeight は px 化済み。
|
|
18
|
+
* - letterSpacing は em 比率 token のため fontSize × ratio で pt 化する。
|
|
19
|
+
* theme の resolveLetterSpacing と同一式だが、theme index 経由の runtime import は
|
|
20
|
+
* ThemeProvider → react-native を引くため、pure に保つ目的でここでは式を直書きする。
|
|
21
|
+
*/
|
|
22
|
+
export function resolveTextShape(theme, variant, role, weight) {
|
|
23
|
+
const fs = theme.typography.fontSize[variant];
|
|
24
|
+
return {
|
|
25
|
+
fontSize: fs.fontSize,
|
|
26
|
+
lineHeight: fs.lineHeight,
|
|
27
|
+
letterSpacing: fs.fontSize * theme.typography.letterSpacingRatio[role],
|
|
28
|
+
...(weight ? {
|
|
29
|
+
fontWeight: theme.typography.fontWeight[weight]
|
|
30
|
+
} : null)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=text.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveTextShape","theme","variant","role","weight","fs","typography","fontSize","lineHeight","letterSpacing","letterSpacingRatio","fontWeight"],"sourceRoot":"../../../src","sources":["primitives/text.styles.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AAGA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,gBAAgBA,CAC9BC,KAAkB,EAClBC,OAAoB,EACpBC,IAAc,EACdC,MAAsB,EACX;EACX,MAAMC,EAAE,GAAGJ,KAAK,CAACK,UAAU,CAACC,QAAQ,CAACL,OAAO,CAAC;EAC7C,OAAO;IACLK,QAAQ,EAAEF,EAAE,CAACE,QAAQ;IACrBC,UAAU,EAAEH,EAAE,CAACG,UAAU;IACzBC,aAAa,EAAEJ,EAAE,CAACE,QAAQ,GAAGN,KAAK,CAACK,UAAU,CAACI,kBAAkB,CAACP,IAAI,CAAC;IACtE,IAAIC,MAAM,GAAG;MAAEO,UAAU,EAAEV,KAAK,CAACK,UAAU,CAACK,UAAU,CAACP,MAAM;IAAE,CAAC,GAAG,IAAI;EACzE,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ThemeProvider / useTheme — melta-app の theming 適用基盤(設計書 §3, B-3)。
|
|
5
|
+
*
|
|
6
|
+
* B-3: 形状(mode 非依存)は各 component 側で StyleSheet 化、色は theme.color.semantic[mode] から
|
|
7
|
+
* render 時に取る。Provider は「現在の mode と、その mode の semantic 色」を配る役割。
|
|
8
|
+
* useColorScheme() を Provider 内で1回だけ読む(RN コア、追加依存なし)。
|
|
9
|
+
*
|
|
10
|
+
* context value は useMemo 必須(§3): 毎レンダで新オブジェクトを配ると全 consumer が再レンダする。
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { createContext, useContext, useMemo } from "react";
|
|
14
|
+
import { useColorScheme } from "react-native";
|
|
15
|
+
import { nativeTheme } from "./native-theme.js";
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
const ThemeContext = /*#__PURE__*/createContext(null);
|
|
18
|
+
export function ThemeProvider({
|
|
19
|
+
children,
|
|
20
|
+
forcedMode
|
|
21
|
+
}) {
|
|
22
|
+
const system = useColorScheme();
|
|
23
|
+
const mode = forcedMode ?? (system === "dark" ? "dark" : "light");
|
|
24
|
+
const value = useMemo(() => ({
|
|
25
|
+
theme: nativeTheme,
|
|
26
|
+
mode,
|
|
27
|
+
colors: nativeTheme.color.semantic[mode]
|
|
28
|
+
}), [mode]);
|
|
29
|
+
return /*#__PURE__*/_jsx(ThemeContext.Provider, {
|
|
30
|
+
value: value,
|
|
31
|
+
children: children
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export function useTheme() {
|
|
35
|
+
const ctx = useContext(ThemeContext);
|
|
36
|
+
if (!ctx) {
|
|
37
|
+
throw new Error("useTheme は <ThemeProvider> の内側で呼んでください。");
|
|
38
|
+
}
|
|
39
|
+
return ctx;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=ThemeProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useMemo","useColorScheme","nativeTheme","jsx","_jsx","ThemeContext","ThemeProvider","children","forcedMode","system","mode","value","theme","colors","color","semantic","Provider","useTheme","ctx","Error"],"sourceRoot":"../../../src","sources":["theme/ThemeProvider.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,EAAEC,UAAU,EAAEC,OAAO,QAAwB,OAAO;AAC1E,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,WAAW,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAc7C,MAAMC,YAAY,gBAAGP,aAAa,CAA2B,IAAI,CAAC;AAWlE,OAAO,SAASQ,aAAaA,CAAC;EAAEC,QAAQ;EAAEC;AAA+B,CAAC,EAAE;EAC1E,MAAMC,MAAM,GAAGR,cAAc,CAAC,CAAC;EAC/B,MAAMS,IAAe,GAAGF,UAAU,KAAKC,MAAM,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;EAE5E,MAAME,KAAK,GAAGX,OAAO,CACnB,OAAO;IACLY,KAAK,EAAEV,WAAW;IAClBQ,IAAI;IACJG,MAAM,EAAEX,WAAW,CAACY,KAAK,CAACC,QAAQ,CAACL,IAAI;EACzC,CAAC,CAAC,EACF,CAACA,IAAI,CACP,CAAC;EAED,oBAAON,IAAA,CAACC,YAAY,CAACW,QAAQ;IAACL,KAAK,EAAEA,KAAM;IAAAJ,QAAA,EAAEA;EAAQ,CAAwB,CAAC;AAChF;AAEA,OAAO,SAASU,QAAQA,CAAA,EAAsB;EAC5C,MAAMC,GAAG,GAAGnB,UAAU,CAACM,YAAY,CAAC;EACpC,IAAI,CAACa,GAAG,EAAE;IACR,MAAM,IAAIC,KAAK,CAAC,yCAAyC,CAAC;EAC5D;EACA,OAAOD,GAAG;AACZ","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* melta-app theme エントリ。
|
|
5
|
+
* 型は types.ts、値は native-theme.ts(melta-contracts から自動生成)。
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
export { nativeTheme } from "./native-theme.js";
|
|
10
|
+
export { ThemeProvider, useTheme } from "./ThemeProvider.js";
|
|
11
|
+
/**
|
|
12
|
+
* letterSpacingRatio(em 相当の比率)を、適用先の fontSize から RN の letterSpacing(pt) に解決する。
|
|
13
|
+
* 例: resolveLetterSpacing(18, theme.typography.letterSpacingRatio.body)
|
|
14
|
+
* theme.typography.letterSpacingRatio.* をそのまま style.letterSpacing に入れる誤用を避けるための helper。
|
|
15
|
+
*/
|
|
16
|
+
export function resolveLetterSpacing(fontSize, ratio) {
|
|
17
|
+
return fontSize * ratio;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["nativeTheme","ThemeProvider","useTheme","resolveLetterSpacing","fontSize","ratio"],"sourceRoot":"../../../src","sources":["theme/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,cAAc,YAAS;AACvB,SAASA,WAAW,QAAQ,mBAAgB;AAC5C,SAASC,aAAa,EAAEC,QAAQ,QAAQ,oBAAiB;AAGzD;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAACC,QAAgB,EAAEC,KAAa,EAAU;EAC5E,OAAOD,QAAQ,GAAGC,KAAK;AACzB","ignoreList":[]}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// ⚠️ 自動生成ファイル — 手で編集しないこと。
|
|
4
|
+
// 生成元: scripts/generate-native-theme.ts(入力 melta-contracts tokens.json)
|
|
5
|
+
// tokens version: 1.0.0
|
|
6
|
+
|
|
7
|
+
export const nativeTheme = {
|
|
8
|
+
"color": {
|
|
9
|
+
"primary": {
|
|
10
|
+
"50": "#f0f5ff",
|
|
11
|
+
"100": "#dde8ff",
|
|
12
|
+
"200": "#c0d4ff",
|
|
13
|
+
"300": "#95b6ff",
|
|
14
|
+
"400": "#6492ff",
|
|
15
|
+
"500": "#2b70ef",
|
|
16
|
+
"600": "#2250df",
|
|
17
|
+
"700": "#1a40b5",
|
|
18
|
+
"800": "#13318d",
|
|
19
|
+
"900": "#0e266a",
|
|
20
|
+
"950": "#07194e"
|
|
21
|
+
},
|
|
22
|
+
"body": "#3d4b5f",
|
|
23
|
+
"semantic": {
|
|
24
|
+
"light": {
|
|
25
|
+
"bg-page": "#f9fafb",
|
|
26
|
+
"bg-page-alt": "#f3f4f6",
|
|
27
|
+
"bg-surface": "#ffffff",
|
|
28
|
+
"bg-surface-alt": "#f9fafb",
|
|
29
|
+
"text-heading": "#0f172a",
|
|
30
|
+
"text-default": "#3d4b5f",
|
|
31
|
+
"text-muted": "#64748b",
|
|
32
|
+
"border-default": "#e2e8f0",
|
|
33
|
+
"border-strong": "#cbd5e1",
|
|
34
|
+
"input-bg": "#ffffff",
|
|
35
|
+
"input-border": "#cbd5e1",
|
|
36
|
+
"text-on-accent": "#ffffff"
|
|
37
|
+
},
|
|
38
|
+
"dark": {
|
|
39
|
+
"bg-page": "#0f172a",
|
|
40
|
+
"bg-page-alt": "#1e293b",
|
|
41
|
+
"bg-surface": "#1e293b",
|
|
42
|
+
"bg-surface-alt": "#0f172a",
|
|
43
|
+
"text-heading": "#f1f5f9",
|
|
44
|
+
"text-default": "#cbd5e1",
|
|
45
|
+
"text-muted": "#94a3b8",
|
|
46
|
+
"border-default": "#334155",
|
|
47
|
+
"border-strong": "#475569",
|
|
48
|
+
"input-bg": "#0f172a",
|
|
49
|
+
"input-border": "#475569",
|
|
50
|
+
"text-on-accent": "#ffffff"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"status": {
|
|
54
|
+
"success": {
|
|
55
|
+
"base": "#059669",
|
|
56
|
+
"subtleLight": "#ecfdf5",
|
|
57
|
+
"textLight": "#047857",
|
|
58
|
+
"subtleDark": "rgba(5,150,105,0.12)",
|
|
59
|
+
"textDark": "#6ee7b7"
|
|
60
|
+
},
|
|
61
|
+
"warning": {
|
|
62
|
+
"base": "#d97706",
|
|
63
|
+
"subtleLight": "#fffbeb",
|
|
64
|
+
"textLight": "#b45309",
|
|
65
|
+
"subtleDark": "rgba(217,119,6,0.12)",
|
|
66
|
+
"textDark": "#fcd34d"
|
|
67
|
+
},
|
|
68
|
+
"danger": {
|
|
69
|
+
"base": "#ef4444",
|
|
70
|
+
"subtleLight": "#fef2f2",
|
|
71
|
+
"textLight": "#dc2626",
|
|
72
|
+
"subtleDark": "rgba(239,68,68,0.12)",
|
|
73
|
+
"textDark": "#fca5a5"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"typography": {
|
|
78
|
+
"fontFamily": {},
|
|
79
|
+
"fontSize": {
|
|
80
|
+
"xs": {
|
|
81
|
+
"fontSize": 13,
|
|
82
|
+
"lineHeight": 18
|
|
83
|
+
},
|
|
84
|
+
"sm": {
|
|
85
|
+
"fontSize": 15,
|
|
86
|
+
"lineHeight": 26
|
|
87
|
+
},
|
|
88
|
+
"base": {
|
|
89
|
+
"fontSize": 18,
|
|
90
|
+
"lineHeight": 36
|
|
91
|
+
},
|
|
92
|
+
"lg": {
|
|
93
|
+
"fontSize": 20,
|
|
94
|
+
"lineHeight": 30
|
|
95
|
+
},
|
|
96
|
+
"xl": {
|
|
97
|
+
"fontSize": 22,
|
|
98
|
+
"lineHeight": 31
|
|
99
|
+
},
|
|
100
|
+
"2xl": {
|
|
101
|
+
"fontSize": 26,
|
|
102
|
+
"lineHeight": 36
|
|
103
|
+
},
|
|
104
|
+
"3xl": {
|
|
105
|
+
"fontSize": 32,
|
|
106
|
+
"lineHeight": 45
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"fontWeight": {
|
|
110
|
+
"normal": "400",
|
|
111
|
+
"medium": "500",
|
|
112
|
+
"semibold": "600",
|
|
113
|
+
"bold": "700"
|
|
114
|
+
},
|
|
115
|
+
"letterSpacingRatio": {
|
|
116
|
+
"heading": 0.01,
|
|
117
|
+
"body": 0.02
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"spacing": {
|
|
121
|
+
"1": 4,
|
|
122
|
+
"2": 8,
|
|
123
|
+
"3": 12,
|
|
124
|
+
"4": 16,
|
|
125
|
+
"5": 20,
|
|
126
|
+
"6": 24,
|
|
127
|
+
"8": 32,
|
|
128
|
+
"10": 40,
|
|
129
|
+
"12": 48,
|
|
130
|
+
"14": 56,
|
|
131
|
+
"16": 64
|
|
132
|
+
},
|
|
133
|
+
"radius": {
|
|
134
|
+
"sm": 4,
|
|
135
|
+
"md": 8,
|
|
136
|
+
"lg": 12,
|
|
137
|
+
"full": 9999
|
|
138
|
+
},
|
|
139
|
+
"elevation": {
|
|
140
|
+
"none": {
|
|
141
|
+
"shadowColor": "#000000",
|
|
142
|
+
"shadowOffset": {
|
|
143
|
+
"width": 0,
|
|
144
|
+
"height": 0
|
|
145
|
+
},
|
|
146
|
+
"shadowOpacity": 0,
|
|
147
|
+
"shadowRadius": 0,
|
|
148
|
+
"elevation": 0
|
|
149
|
+
},
|
|
150
|
+
"sm": {
|
|
151
|
+
"shadowColor": "rgb(0, 0, 0)",
|
|
152
|
+
"shadowOffset": {
|
|
153
|
+
"width": 0,
|
|
154
|
+
"height": 1
|
|
155
|
+
},
|
|
156
|
+
"shadowOpacity": 0.05,
|
|
157
|
+
"shadowRadius": 2,
|
|
158
|
+
"elevation": 2
|
|
159
|
+
},
|
|
160
|
+
"md": {
|
|
161
|
+
"shadowColor": "rgb(0, 0, 0)",
|
|
162
|
+
"shadowOffset": {
|
|
163
|
+
"width": 0,
|
|
164
|
+
"height": 4
|
|
165
|
+
},
|
|
166
|
+
"shadowOpacity": 0.1,
|
|
167
|
+
"shadowRadius": 6,
|
|
168
|
+
"elevation": 5
|
|
169
|
+
},
|
|
170
|
+
"overlay": {
|
|
171
|
+
"shadowColor": "rgb(0, 0, 0)",
|
|
172
|
+
"shadowOffset": {
|
|
173
|
+
"width": 0,
|
|
174
|
+
"height": 20
|
|
175
|
+
},
|
|
176
|
+
"shadowOpacity": 0.1,
|
|
177
|
+
"shadowRadius": 25,
|
|
178
|
+
"elevation": 10
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"motion": {
|
|
182
|
+
"duration": {
|
|
183
|
+
"fast": 150,
|
|
184
|
+
"normal": 200,
|
|
185
|
+
"slow": 300
|
|
186
|
+
},
|
|
187
|
+
"easing": {
|
|
188
|
+
"default": [0.4, 0, 0.2, 1],
|
|
189
|
+
"in": [0.4, 0, 1, 1],
|
|
190
|
+
"out": [0, 0, 0.2, 1]
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"zIndex": {
|
|
194
|
+
"base": 0,
|
|
195
|
+
"dropdown": 20,
|
|
196
|
+
"sticky": 30,
|
|
197
|
+
"overlay": 40,
|
|
198
|
+
"modal": 50
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
//# sourceMappingURL=native-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["nativeTheme"],"sourceRoot":"../../../src","sources":["theme/native-theme.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["theme/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ActionSheet — 画面下から出るアクション/選択リスト。contract: action-sheet(appFirst、feedback)。
|
|
3
|
+
* RN core Modal(transparent + slide)+ 下端 sheet。web の select / dropdown を APP に
|
|
4
|
+
* adapted 変換する際の受け皿。
|
|
5
|
+
*
|
|
6
|
+
* - actions は縦積み(区切り線 border-default)、cancel は下に分離した独立ブロック
|
|
7
|
+
* (閉じる手段を複数持つ: cancelAction + overlay tap + Android back = contract a11y required)。
|
|
8
|
+
* - destructive アクションは destructiveTextStyle(status.danger.base)で色を差し替える。
|
|
9
|
+
* 色だけでなくラベル文言でも破壊的操作と分かる文言にするのは呼び出し側の責務(contract a11y)。
|
|
10
|
+
* - 先頭 action の borderTop は title が無い場合は消す(title がある時だけ区切りとして意味を持つ)。
|
|
11
|
+
* - action の onPress 後は onClose も呼ぶ(選択 = シートを閉じる)。
|
|
12
|
+
* - sheet 群は SafeAreaView で包み下余白(ホームインジケータ)を確保(recipe description 参照)。
|
|
13
|
+
* - sheet 側は onStartShouldSetResponder で touch を claim し、overlay tap でだけ閉じる。
|
|
14
|
+
* - style の決定は pure resolver(action-sheet.styles.ts)に分離 — recipe との機械照合対象。
|
|
15
|
+
*/
|
|
16
|
+
export interface ActionSheetAction {
|
|
17
|
+
label: string;
|
|
18
|
+
onPress: () => void;
|
|
19
|
+
/** 破壊的操作(色を danger に差し替え。文言でも破壊的と分かるようにすること)。 */
|
|
20
|
+
destructive?: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface ActionSheetProps {
|
|
23
|
+
visible: boolean;
|
|
24
|
+
/** 閉じ要求(cancel / overlay tap / Android back / action 選択後の全経路で呼ばれる)。 */
|
|
25
|
+
onClose: () => void;
|
|
26
|
+
/** シート上部の説明ラベル(任意)。 */
|
|
27
|
+
title?: string;
|
|
28
|
+
/** 縦積みするアクション群。 */
|
|
29
|
+
actions: ActionSheetAction[];
|
|
30
|
+
/** キャンセル行のラベル。default "キャンセル"。 */
|
|
31
|
+
cancelLabel?: string;
|
|
32
|
+
testID?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function ActionSheet({ visible, onClose, title, actions, cancelLabel, testID, }: ActionSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare namespace ActionSheet {
|
|
36
|
+
var __contract: {
|
|
37
|
+
readonly id: "action-sheet";
|
|
38
|
+
readonly version: "0.1.0";
|
|
39
|
+
readonly variants: readonly ["default"];
|
|
40
|
+
readonly sizes: readonly [];
|
|
41
|
+
readonly states: readonly ["default"];
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=ActionSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionSheet.d.ts","sourceRoot":"","sources":["../../../../src/components/ActionSheet.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAcH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,UAAU,gBAAgB;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,uEAAuE;IACvE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,OAAO,EACP,KAAK,EACL,OAAO,EACP,WAAqB,EACrB,MAAM,GACP,EAAE,gBAAgB,2CAsDlB;yBA7De,WAAW"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alert — インラインアラート通知(feedback)。contract: alert。
|
|
3
|
+
* Info / Success / Warning / Error の4タイプ。Text の compose + 任意 icon slot / 閉じるボタン。
|
|
4
|
+
*
|
|
5
|
+
* - RN では border を持たず bg subtle + text 色で表現(status token に border 用の中間色が無い、
|
|
6
|
+
* recipe description)。COLOR_ONLY_FORBIDDEN は title/message のテキストと icon slot で担保する設計。
|
|
7
|
+
* - icon は ReactNode slot(EmptyState 前例。Icon を差すなら melta-app/icons を利用者が opt-in)。
|
|
8
|
+
* - a11y(§2 web→RN mapping): web の role=alert(error/warning) / status(info/success) を、
|
|
9
|
+
* error/warning → accessibilityRole="alert"、info/success → accessibilityLiveRegion="polite"
|
|
10
|
+
* (Android のみ有効。RN に status role が無いための写像)に落とす。
|
|
11
|
+
* - 色・寸法の決定は pure resolver(alert.styles.ts)に分離。dark mode は resolver が
|
|
12
|
+
* status.*.subtleDark / textDark を解決(info のみ primary 固定)。
|
|
13
|
+
* recipes/app/alert.recipe.json との機械照合は scripts/lib/alert-conformance.test.ts が行う。
|
|
14
|
+
*/
|
|
15
|
+
import { type ReactNode } from "react";
|
|
16
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
17
|
+
import { type AlertVariant } from "./alert.styles";
|
|
18
|
+
interface AlertProps {
|
|
19
|
+
/** 通知タイプ(contract variant)。 */
|
|
20
|
+
variant: AlertVariant;
|
|
21
|
+
/** 見出し(任意)。 */
|
|
22
|
+
title?: string;
|
|
23
|
+
/** 本文(必須)。 */
|
|
24
|
+
message: string;
|
|
25
|
+
/** 先頭の icon slot(デフォルト無し)。 */
|
|
26
|
+
icon?: ReactNode;
|
|
27
|
+
/** あれば右端に閉じるボタン(Pressable の ×)を出す。 */
|
|
28
|
+
onClose?: () => void;
|
|
29
|
+
style?: StyleProp<ViewStyle>;
|
|
30
|
+
testID?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function Alert({ variant, title, message, icon, onClose, style, testID }: AlertProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare namespace Alert {
|
|
34
|
+
var __contract: {
|
|
35
|
+
readonly id: "alert";
|
|
36
|
+
readonly version: "2.0.0";
|
|
37
|
+
readonly variants: readonly ["info", "success", "warning", "error"];
|
|
38
|
+
readonly sizes: readonly [];
|
|
39
|
+
readonly states: readonly ["default", "dismissing"];
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=Alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../../src/components/Alert.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI/E,OAAO,EAAkC,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnF,UAAU,UAAU;IAClB,+BAA+B;IAC/B,OAAO,EAAE,YAAY,CAAC;IACtB,eAAe;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,KAAK,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,UAAU,2CA2C1F;yBA3Ce,KAAK"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Avatar — ユーザーアバター(Image / Initials / Status / Group)。
|
|
3
|
+
* contract: avatar(web 契約 v2.0.0 の app 実装)。dogfood 不足-4 の解消。
|
|
4
|
+
*
|
|
5
|
+
* - variant は props から暗黙決定: source があれば image、無ければ initials(name から生成)。
|
|
6
|
+
* contract の group variant は Avatar.Group(重ね表示コンテナ、-spacing.2 相当のオーバーラップ)。
|
|
7
|
+
* - status(online / away / offline)指定時は右下に statusDot(bg-surface の ring 付き)。
|
|
8
|
+
* - a11y: role img + accessibilityLabel=name(contract required)。
|
|
9
|
+
* - 決定ロジックは pure resolver(avatar.styles.ts)に分離 — recipe との機械照合対象。
|
|
10
|
+
*/
|
|
11
|
+
import { type ReactNode } from "react";
|
|
12
|
+
import { type ImageSourcePropType, type StyleProp, type ViewStyle } from "react-native";
|
|
13
|
+
import { type AvatarSize, type AvatarStatus } from "./avatar.styles";
|
|
14
|
+
interface AvatarProps {
|
|
15
|
+
/** 表示名(initials の生成元 + accessibilityLabel。contract a11y required)。 */
|
|
16
|
+
name: string;
|
|
17
|
+
/** プロフィール画像。省略時は initials variant にフォールバック。 */
|
|
18
|
+
source?: ImageSourcePropType;
|
|
19
|
+
/** サイズ(contract sizes)。default "medium"。 */
|
|
20
|
+
size?: AvatarSize;
|
|
21
|
+
/** 在席状態(contract states)。指定時のみ statusDot を表示。 */
|
|
22
|
+
status?: AvatarStatus;
|
|
23
|
+
style?: StyleProp<ViewStyle>;
|
|
24
|
+
testID?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function Avatar({ name, source, size, status, style, testID }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare namespace Avatar {
|
|
28
|
+
var Group: typeof AvatarGroup;
|
|
29
|
+
var __contract: {
|
|
30
|
+
readonly id: "avatar";
|
|
31
|
+
readonly version: "2.0.0";
|
|
32
|
+
readonly variants: readonly ["image", "initials", "group"];
|
|
33
|
+
readonly sizes: readonly ["small", "medium", "large"];
|
|
34
|
+
readonly states: readonly ["default", "online", "away", "offline"];
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
interface AvatarGroupProps {
|
|
38
|
+
style?: StyleProp<ViewStyle>;
|
|
39
|
+
testID?: string;
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
/** 複数アバターの重ね表示(contract の group variant)。2枚目以降を負 margin で重ねる。 */
|
|
43
|
+
declare function AvatarGroup({ style, testID, children }: AvatarGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/Avatar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,YAAY,EAElB,MAAM,iBAAiB,CAAC;AAEzB,UAAU,WAAW;IACnB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,4CAA4C;IAC5C,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,iDAAiD;IACjD,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AASD,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAe,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,WAAW,2CAqC3F;yBArCe,MAAM;;;;;;;;;;AAuCtB,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,iEAAiE;AACjE,iBAAS,WAAW,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CASjE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BottomSheet — 画面下から出る汎用シート container(content は自由 slot)。
|
|
3
|
+
* contract: bottom-sheet(appFirst、feedback)。RN core Modal(transparent + slide)+
|
|
4
|
+
* 下端 sheet(上角のみ radius)。ActionSheet がリスト特化なのに対しこちらは容器。
|
|
5
|
+
*
|
|
6
|
+
* - grabber は装飾バー。a11y ツリーから除外する(importantForAccessibility="no" +
|
|
7
|
+
* accessibilityElementsHidden。recipe description 参照)。
|
|
8
|
+
* - スワイプで閉じるジェスチャは実装しない(overlay tap + Android back で閉じる、Phase 外)。
|
|
9
|
+
* - sheet は下端密着(bg-surface)のため、SafeAreaView を sheet の内側に置いて
|
|
10
|
+
* 下余白(ホームインジケータ)まで sheet 背景で覆いつつ content を安全域に収める。
|
|
11
|
+
* - sheet 側は onStartShouldSetResponder で touch を claim し、overlay tap でだけ閉じる。
|
|
12
|
+
* - style の決定は pure resolver(bottom-sheet.styles.ts)に分離 — recipe との機械照合対象。
|
|
13
|
+
*/
|
|
14
|
+
import { type ReactNode } from "react";
|
|
15
|
+
interface BottomSheetProps {
|
|
16
|
+
visible: boolean;
|
|
17
|
+
/** 閉じ要求(overlay tap / Android back の全経路で呼ばれる)。 */
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
/** シート見出し(任意)。 */
|
|
20
|
+
title?: string;
|
|
21
|
+
testID?: string;
|
|
22
|
+
/** content slot(自由)。 */
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function BottomSheet({ visible, onClose, title, testID, children }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare namespace BottomSheet {
|
|
27
|
+
var __contract: {
|
|
28
|
+
readonly id: "bottom-sheet";
|
|
29
|
+
readonly version: "0.1.0";
|
|
30
|
+
readonly variants: readonly ["default"];
|
|
31
|
+
readonly sizes: readonly [];
|
|
32
|
+
readonly states: readonly ["default"];
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=BottomSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../src/components/BottomSheet.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAYhD,UAAU,gBAAgB;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CAyC1F;yBAzCe,WAAW"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card — コンテンツコンテナ component(設計書 §1)。contract: card。
|
|
3
|
+
*
|
|
4
|
+
* - 土台の解決(bg/radius/elevation/border/padding)は pure resolver(card.styles.ts の
|
|
5
|
+
* resolveCardShape)に一元化し、非インタラクティブ(View)・インタラクティブ(Pressable) の
|
|
6
|
+
* 両分岐で共有する(DRY、形状二重定義を防ぐ)。recipe との機械照合は
|
|
7
|
+
* scripts/lib/card-conformance.test.ts が行う。
|
|
8
|
+
* - variant: basic/media は非インタラクティブ、action/link は Pressable。
|
|
9
|
+
* action/link は pressed 時 elevation.sm→md(§2 hover→pressed mapping)。
|
|
10
|
+
* focus-within は RN 非サポートとして Phase1 明示 drop(§2)。
|
|
11
|
+
* - 型で action/link は onPress 必須を強制(§4 の DU 精神。無言で非対話に落ちる事故を防ぐ)。
|
|
12
|
+
* - Card は Image/Metric に依存しない(§1)。media/header/footer/children に呼び出し側が差し込む。
|
|
13
|
+
* ツー活カードは D2I が slot に Image+Metric を compose する。
|
|
14
|
+
* - media variant は overflow:hidden で角丸に画像をクリップし、body だけにパディング(contract と整合)。
|
|
15
|
+
*/
|
|
16
|
+
import type { ReactNode } from "react";
|
|
17
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
18
|
+
interface CardBase {
|
|
19
|
+
header?: ReactNode;
|
|
20
|
+
footer?: ReactNode;
|
|
21
|
+
media?: ReactNode;
|
|
22
|
+
accessibilityLabel?: string;
|
|
23
|
+
style?: StyleProp<ViewStyle>;
|
|
24
|
+
testID?: string;
|
|
25
|
+
/** body。 */
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
type CardProps = CardBase & ({
|
|
29
|
+
variant?: "basic" | "media";
|
|
30
|
+
onPress?: never;
|
|
31
|
+
} | {
|
|
32
|
+
variant: "action" | "link";
|
|
33
|
+
onPress: () => void;
|
|
34
|
+
});
|
|
35
|
+
export declare function Card({ variant, header, footer, media, onPress, accessibilityLabel, style, testID, children, }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare namespace Card {
|
|
37
|
+
var __contract: {
|
|
38
|
+
readonly id: "card";
|
|
39
|
+
readonly version: "2.0.0";
|
|
40
|
+
readonly variants: readonly ["basic", "media", "action", "link"];
|
|
41
|
+
readonly sizes: readonly [];
|
|
42
|
+
readonly states: readonly ["default", "hover", "focus-within"];
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/components/Card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAM/E,UAAU,QAAQ;IAChB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY;IACZ,QAAQ,EAAE,SAAS,CAAC;CACrB;AAGD,KAAK,SAAS,GAAG,QAAQ,GACvB,CACI;IAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,GAChD;IAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CACtD,CAAC;AAEJ,wBAAgB,IAAI,CAAC,EACnB,OAAiB,EACjB,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,EACP,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,QAAQ,GACT,EAAE,SAAS,2CA+CX;yBAzDe,IAAI"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkbox — 複数選択フォームコントロール(form-input 第1弾)。contract: checkbox。
|
|
3
|
+
*
|
|
4
|
+
* - RN にネイティブ checkbox が無いため Pressable(行全体タップ)+ 描画で実装する。
|
|
5
|
+
* checkmark は rotate した View の L 字 border、indeterminate は横棒
|
|
6
|
+
* (react-native-svg 非依存 = 本体エントリの依存ゼロ維持。recipe description 参照)。
|
|
7
|
+
* - box は 20px(web の 16px より大きいのはタッチ前提)。実タッチ領域は hitSlop 12 で
|
|
8
|
+
* 44pt(20 + 12×2)を確保する。
|
|
9
|
+
* - label 必須(FORM_NO_LABEL_OMIT を props 型で強制)。label は Text primitive
|
|
10
|
+
* (base/text-default = recipe labelStyle と同値)。
|
|
11
|
+
* - states(contract → prop の写像): checked/unchecked → checked:boolean、
|
|
12
|
+
* indeterminate → indeterminate:boolean(variant "indeterminate"。a11y は "mixed")、
|
|
13
|
+
* error → error:boolean(borderColor 差分、checked より優先)、disabled → prop
|
|
14
|
+
* (opacity 0.5 + 非活性)。focus は Phase1 非対応(recipe にも focus 差分なし)。
|
|
15
|
+
* - 色・寸法の決定は pure resolver(checkbox.styles.ts)に分離。
|
|
16
|
+
* recipes/app/checkbox.recipe.json との機械照合は scripts/lib/checkbox-conformance.test.ts が行う。
|
|
17
|
+
*/
|
|
18
|
+
export interface CheckboxProps {
|
|
19
|
+
/** ラベル(必須。FORM_NO_LABEL_OMIT)。 */
|
|
20
|
+
label: string;
|
|
21
|
+
checked: boolean;
|
|
22
|
+
onChange: (checked: boolean) => void;
|
|
23
|
+
/** true で不確定状態(親子関係の一部選択)。mark は横棒、a11y は "mixed"。 */
|
|
24
|
+
indeterminate?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** バリデーションエラー(box の borderColor が danger になる)。 */
|
|
27
|
+
error?: boolean;
|
|
28
|
+
testID?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function Checkbox({ label, checked, onChange, indeterminate, disabled, error, testID, }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare namespace Checkbox {
|
|
32
|
+
var __contract: {
|
|
33
|
+
readonly id: "checkbox";
|
|
34
|
+
readonly version: "2.0.0";
|
|
35
|
+
readonly variants: readonly ["default", "disabled", "indeterminate"];
|
|
36
|
+
readonly sizes: readonly [];
|
|
37
|
+
readonly states: readonly ["default", "checked", "unchecked", "indeterminate", "disabled", "error", "focus"];
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/Checkbox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAaH,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,sDAAsD;IACtD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kDAAkD;IAClD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,OAAO,EACP,QAAQ,EACR,aAAqB,EACrB,QAAgB,EAChB,KAAa,EACb,MAAM,GACP,EAAE,aAAa,2CAqDf;yBA7De,QAAQ"}
|