@ezpg/app-ui 0.22.0 → 0.23.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.
Files changed (271) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/module/adjust/axis-adjust.js +1 -1
  3. package/lib/module/adjust/axis-adjust.js.map +1 -1
  4. package/lib/module/adjust/axis-dial.js +2 -2
  5. package/lib/module/adjust/axis-dial.js.map +1 -1
  6. package/lib/module/adjust/axis-tabs.js +1 -1
  7. package/lib/module/adjust/axis-tabs.js.map +1 -1
  8. package/lib/module/adjust/dial-strip.js +6 -4
  9. package/lib/module/adjust/dial-strip.js.map +1 -1
  10. package/lib/module/adjust/store-sample.js +1 -1
  11. package/lib/module/blocks/chat-message/chat-message.js +1 -0
  12. package/lib/module/blocks/chat-message/chat-message.js.map +1 -1
  13. package/lib/module/blocks/choice-art/choice-art.js +2 -0
  14. package/lib/module/blocks/choice-art/choice-art.js.map +1 -1
  15. package/lib/module/blocks/color-tune/store-sample.js +13 -6
  16. package/lib/module/blocks/color-tune/store-sample.js.map +1 -1
  17. package/lib/module/blocks/color-tune/swatch-card.js +1 -1
  18. package/lib/module/blocks/color-tune/swatch-card.js.map +1 -1
  19. package/lib/module/blocks/detail-editor/compare-slider.js +1 -0
  20. package/lib/module/blocks/detail-editor/compare-slider.js.map +1 -1
  21. package/lib/module/blocks/detail-editor/detail-canvas.js +3 -0
  22. package/lib/module/blocks/detail-editor/detail-canvas.js.map +1 -1
  23. package/lib/module/blocks/detail-editor/layout-picker.js +4 -1
  24. package/lib/module/blocks/detail-editor/layout-picker.js.map +1 -1
  25. package/lib/module/blocks/detail-studio/action-chips.js +1 -0
  26. package/lib/module/blocks/detail-studio/action-chips.js.map +1 -1
  27. package/lib/module/blocks/detail-studio/adjust-tiles.js +1 -0
  28. package/lib/module/blocks/detail-studio/adjust-tiles.js.map +1 -1
  29. package/lib/module/blocks/detail-studio/image-prompt.js +1 -0
  30. package/lib/module/blocks/detail-studio/image-prompt.js.map +1 -1
  31. package/lib/module/blocks/detail-studio/section-kind-grid.js +2 -0
  32. package/lib/module/blocks/detail-studio/section-kind-grid.js.map +1 -1
  33. package/lib/module/blocks/detail-studio/text-format-panel.js +4 -0
  34. package/lib/module/blocks/detail-studio/text-format-panel.js.map +1 -1
  35. package/lib/module/blocks/draft-box/draft-box.js +3 -0
  36. package/lib/module/blocks/draft-box/draft-box.js.map +1 -1
  37. package/lib/module/blocks/oauth-buttons/oauth-buttons.js +1 -0
  38. package/lib/module/blocks/oauth-buttons/oauth-buttons.js.map +1 -1
  39. package/lib/module/blocks/order-block/order-block.js +19 -5
  40. package/lib/module/blocks/order-block/order-block.js.map +1 -1
  41. package/lib/module/blocks/product-tile/product-tile.js +4 -1
  42. package/lib/module/blocks/product-tile/product-tile.js.map +1 -1
  43. package/lib/module/blocks/question-accordion/question-accordion.js +1 -2
  44. package/lib/module/blocks/question-accordion/question-accordion.js.map +1 -1
  45. package/lib/module/blocks/question-pager/question-pager.js +2 -1
  46. package/lib/module/blocks/question-pager/question-pager.js.map +1 -1
  47. package/lib/module/blocks/review-card/review-card.js +4 -0
  48. package/lib/module/blocks/review-card/review-card.js.map +1 -1
  49. package/lib/module/blocks/send-bar/send-bar.js +1 -0
  50. package/lib/module/blocks/send-bar/send-bar.js.map +1 -1
  51. package/lib/module/blocks/stage-bar/stage-bar.js +3 -2
  52. package/lib/module/blocks/stage-bar/stage-bar.js.map +1 -1
  53. package/lib/module/blocks/stat-card/stat-card.js +4 -1
  54. package/lib/module/blocks/stat-card/stat-card.js.map +1 -1
  55. package/lib/module/blocks/step-screen/step-screen.js +5 -2
  56. package/lib/module/blocks/step-screen/step-screen.js.map +1 -1
  57. package/lib/module/blocks/store-top/store-top.js +8 -3
  58. package/lib/module/blocks/store-top/store-top.js.map +1 -1
  59. package/lib/module/blocks/summary-cards/summary-cards.js +10 -3
  60. package/lib/module/blocks/summary-cards/summary-cards.js.map +1 -1
  61. package/lib/module/blocks/task-tiles/task-tiles.js +3 -2
  62. package/lib/module/blocks/task-tiles/task-tiles.js.map +1 -1
  63. package/lib/module/components/amount-summary/amount-summary.js +7 -1
  64. package/lib/module/components/amount-summary/amount-summary.js.map +1 -1
  65. package/lib/module/components/button/button.js +6 -0
  66. package/lib/module/components/button/button.js.map +1 -1
  67. package/lib/module/components/calendar/calendar.js +7 -4
  68. package/lib/module/components/calendar/calendar.js.map +1 -1
  69. package/lib/module/components/chip/chip.js +2 -2
  70. package/lib/module/components/chip/chip.js.map +1 -1
  71. package/lib/module/components/circle-grid/circle-grid.js +1 -0
  72. package/lib/module/components/circle-grid/circle-grid.js.map +1 -1
  73. package/lib/module/components/credit/credit.js +2 -2
  74. package/lib/module/components/credit/credit.js.map +1 -1
  75. package/lib/module/components/dialog/dialog.js +2 -0
  76. package/lib/module/components/dialog/dialog.js.map +1 -1
  77. package/lib/module/components/empty-state/empty-state.js +1 -0
  78. package/lib/module/components/empty-state/empty-state.js.map +1 -1
  79. package/lib/module/components/fact-list/fact-list.js +1 -0
  80. package/lib/module/components/fact-list/fact-list.js.map +1 -1
  81. package/lib/module/components/field/field.js +4 -0
  82. package/lib/module/components/field/field.js.map +1 -1
  83. package/lib/module/components/filter-tabs/filter-tabs.js +2 -1
  84. package/lib/module/components/filter-tabs/filter-tabs.js.map +1 -1
  85. package/lib/module/components/list-row/list-row.js +23 -6
  86. package/lib/module/components/list-row/list-row.js.map +1 -1
  87. package/lib/module/components/page-header/page-header.js +1 -0
  88. package/lib/module/components/page-header/page-header.js.map +1 -1
  89. package/lib/module/components/pill/pill.js +1 -0
  90. package/lib/module/components/pill/pill.js.map +1 -1
  91. package/lib/module/components/segmented-control/segmented-control.js +2 -0
  92. package/lib/module/components/segmented-control/segmented-control.js.map +1 -1
  93. package/lib/module/components/segmented-tabs/segmented-tabs.js +3 -2
  94. package/lib/module/components/segmented-tabs/segmented-tabs.js.map +1 -1
  95. package/lib/module/components/status-steps/status-steps.js +2 -0
  96. package/lib/module/components/status-steps/status-steps.js.map +1 -1
  97. package/lib/module/components/text/figures.js +82 -0
  98. package/lib/module/components/text/figures.js.map +1 -0
  99. package/lib/module/components/text/index.js +1 -0
  100. package/lib/module/components/text/index.js.map +1 -1
  101. package/lib/module/components/text/metrics.js +5 -0
  102. package/lib/module/components/text/metrics.js.map +1 -0
  103. package/lib/module/components/text/text.js +31 -2
  104. package/lib/module/components/text/text.js.map +1 -1
  105. package/lib/module/components/tile-grid/tile-grid.js +3 -2
  106. package/lib/module/components/tile-grid/tile-grid.js.map +1 -1
  107. package/lib/module/components/toast/toast.js +4 -1
  108. package/lib/module/components/toast/toast.js.map +1 -1
  109. package/lib/module/components/value-rows/value-rows.js +8 -1
  110. package/lib/module/components/value-rows/value-rows.js.map +1 -1
  111. package/lib/module/internal/field-label.js +2 -0
  112. package/lib/module/internal/field-label.js.map +1 -1
  113. package/lib/module/internal/roll-text.js +10 -2
  114. package/lib/module/internal/roll-text.js.map +1 -1
  115. package/lib/module/internal/sample-tiles.js +2 -0
  116. package/lib/module/internal/sample-tiles.js.map +1 -1
  117. package/lib/module/sortable/section-board.js +2 -0
  118. package/lib/module/sortable/section-board.js.map +1 -1
  119. package/lib/module/templates/design-pick-template.js +1 -0
  120. package/lib/module/templates/design-pick-template.js.map +1 -1
  121. package/lib/module/templates/preview-edit-template.js +3 -0
  122. package/lib/module/templates/preview-edit-template.js.map +1 -1
  123. package/lib/module/templates/scroll-templates.js +12 -2
  124. package/lib/module/templates/scroll-templates.js.map +1 -1
  125. package/lib/module/templates/sheet-form-template.js +4 -0
  126. package/lib/module/templates/sheet-form-template.js.map +1 -1
  127. package/lib/module/theme/base.js +16 -9
  128. package/lib/module/theme/base.js.map +1 -1
  129. package/lib/module/theme/create-theme.js +6 -2
  130. package/lib/module/theme/create-theme.js.map +1 -1
  131. package/lib/module/theme/tokens.js +23 -2
  132. package/lib/module/theme/tokens.js.map +1 -1
  133. package/lib/typescript/src/adjust/dial-strip.d.ts.map +1 -1
  134. package/lib/typescript/src/blocks/chat-message/chat-message.d.ts.map +1 -1
  135. package/lib/typescript/src/blocks/choice-art/choice-art.d.ts.map +1 -1
  136. package/lib/typescript/src/blocks/color-tune/store-sample.d.ts.map +1 -1
  137. package/lib/typescript/src/blocks/detail-editor/compare-slider.d.ts.map +1 -1
  138. package/lib/typescript/src/blocks/detail-editor/detail-canvas.d.ts.map +1 -1
  139. package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts.map +1 -1
  140. package/lib/typescript/src/blocks/detail-studio/action-chips.d.ts.map +1 -1
  141. package/lib/typescript/src/blocks/detail-studio/adjust-tiles.d.ts.map +1 -1
  142. package/lib/typescript/src/blocks/detail-studio/image-prompt.d.ts.map +1 -1
  143. package/lib/typescript/src/blocks/detail-studio/section-kind-grid.d.ts.map +1 -1
  144. package/lib/typescript/src/blocks/detail-studio/text-format-panel.d.ts.map +1 -1
  145. package/lib/typescript/src/blocks/draft-box/draft-box.d.ts.map +1 -1
  146. package/lib/typescript/src/blocks/oauth-buttons/oauth-buttons.d.ts.map +1 -1
  147. package/lib/typescript/src/blocks/order-block/order-block.d.ts.map +1 -1
  148. package/lib/typescript/src/blocks/product-tile/product-tile.d.ts.map +1 -1
  149. package/lib/typescript/src/blocks/question-accordion/question-accordion.d.ts.map +1 -1
  150. package/lib/typescript/src/blocks/question-pager/question-pager.d.ts.map +1 -1
  151. package/lib/typescript/src/blocks/review-card/review-card.d.ts.map +1 -1
  152. package/lib/typescript/src/blocks/send-bar/send-bar.d.ts.map +1 -1
  153. package/lib/typescript/src/blocks/stage-bar/stage-bar.d.ts.map +1 -1
  154. package/lib/typescript/src/blocks/stat-card/stat-card.d.ts.map +1 -1
  155. package/lib/typescript/src/blocks/step-screen/step-screen.d.ts.map +1 -1
  156. package/lib/typescript/src/blocks/store-top/store-top.d.ts.map +1 -1
  157. package/lib/typescript/src/blocks/summary-cards/summary-cards.d.ts.map +1 -1
  158. package/lib/typescript/src/blocks/task-tiles/task-tiles.d.ts.map +1 -1
  159. package/lib/typescript/src/components/amount-summary/amount-summary.d.ts.map +1 -1
  160. package/lib/typescript/src/components/button/button.d.ts.map +1 -1
  161. package/lib/typescript/src/components/calendar/calendar.d.ts.map +1 -1
  162. package/lib/typescript/src/components/chip/chip.d.ts.map +1 -1
  163. package/lib/typescript/src/components/circle-grid/circle-grid.d.ts.map +1 -1
  164. package/lib/typescript/src/components/dialog/dialog.d.ts.map +1 -1
  165. package/lib/typescript/src/components/empty-state/empty-state.d.ts.map +1 -1
  166. package/lib/typescript/src/components/fact-list/fact-list.d.ts.map +1 -1
  167. package/lib/typescript/src/components/field/field.d.ts.map +1 -1
  168. package/lib/typescript/src/components/filter-tabs/filter-tabs.d.ts.map +1 -1
  169. package/lib/typescript/src/components/list-row/list-row.d.ts +3 -1
  170. package/lib/typescript/src/components/list-row/list-row.d.ts.map +1 -1
  171. package/lib/typescript/src/components/page-header/page-header.d.ts.map +1 -1
  172. package/lib/typescript/src/components/pill/pill.d.ts.map +1 -1
  173. package/lib/typescript/src/components/segmented-control/segmented-control.d.ts.map +1 -1
  174. package/lib/typescript/src/components/segmented-tabs/segmented-tabs.d.ts.map +1 -1
  175. package/lib/typescript/src/components/status-steps/status-steps.d.ts.map +1 -1
  176. package/lib/typescript/src/components/text/figures.d.ts +12 -0
  177. package/lib/typescript/src/components/text/figures.d.ts.map +1 -0
  178. package/lib/typescript/src/components/text/index.d.ts +1 -0
  179. package/lib/typescript/src/components/text/index.d.ts.map +1 -1
  180. package/lib/typescript/src/components/text/metrics.d.ts +6 -0
  181. package/lib/typescript/src/components/text/metrics.d.ts.map +1 -0
  182. package/lib/typescript/src/components/text/text.d.ts +2 -2
  183. package/lib/typescript/src/components/text/text.d.ts.map +1 -1
  184. package/lib/typescript/src/components/tile-grid/tile-grid.d.ts.map +1 -1
  185. package/lib/typescript/src/components/toast/toast.d.ts.map +1 -1
  186. package/lib/typescript/src/components/value-rows/value-rows.d.ts.map +1 -1
  187. package/lib/typescript/src/internal/field-label.d.ts.map +1 -1
  188. package/lib/typescript/src/internal/roll-text.d.ts +3 -2
  189. package/lib/typescript/src/internal/roll-text.d.ts.map +1 -1
  190. package/lib/typescript/src/internal/sample-tiles.d.ts +2 -0
  191. package/lib/typescript/src/internal/sample-tiles.d.ts.map +1 -1
  192. package/lib/typescript/src/sortable/section-board.d.ts.map +1 -1
  193. package/lib/typescript/src/templates/design-pick-template.d.ts.map +1 -1
  194. package/lib/typescript/src/templates/preview-edit-template.d.ts.map +1 -1
  195. package/lib/typescript/src/templates/scroll-templates.d.ts.map +1 -1
  196. package/lib/typescript/src/templates/sheet-form-template.d.ts.map +1 -1
  197. package/lib/typescript/src/theme/base.d.ts +9 -2
  198. package/lib/typescript/src/theme/base.d.ts.map +1 -1
  199. package/lib/typescript/src/theme/create-theme.d.ts.map +1 -1
  200. package/lib/typescript/src/theme/tokens.d.ts +3 -1
  201. package/lib/typescript/src/theme/tokens.d.ts.map +1 -1
  202. package/lib/typescript/src/types/index.d.ts +12 -0
  203. package/lib/typescript/src/types/index.d.ts.map +1 -1
  204. package/package.json +1 -1
  205. package/src/adjust/axis-adjust.tsx +1 -1
  206. package/src/adjust/axis-dial.tsx +2 -2
  207. package/src/adjust/axis-tabs.tsx +1 -1
  208. package/src/adjust/dial-strip.tsx +5 -3
  209. package/src/adjust/store-sample.tsx +1 -1
  210. package/src/blocks/chat-message/chat-message.tsx +1 -0
  211. package/src/blocks/choice-art/choice-art.tsx +2 -0
  212. package/src/blocks/color-tune/store-sample.tsx +11 -6
  213. package/src/blocks/color-tune/swatch-card.tsx +1 -1
  214. package/src/blocks/detail-editor/compare-slider.tsx +1 -0
  215. package/src/blocks/detail-editor/detail-canvas.tsx +3 -0
  216. package/src/blocks/detail-editor/layout-picker.tsx +3 -0
  217. package/src/blocks/detail-studio/action-chips.tsx +1 -0
  218. package/src/blocks/detail-studio/adjust-tiles.tsx +1 -0
  219. package/src/blocks/detail-studio/image-prompt.tsx +1 -0
  220. package/src/blocks/detail-studio/section-kind-grid.tsx +2 -0
  221. package/src/blocks/detail-studio/text-format-panel.tsx +4 -0
  222. package/src/blocks/draft-box/draft-box.tsx +3 -0
  223. package/src/blocks/oauth-buttons/oauth-buttons.tsx +1 -0
  224. package/src/blocks/order-block/order-block.tsx +20 -4
  225. package/src/blocks/product-tile/product-tile.tsx +4 -1
  226. package/src/blocks/question-accordion/question-accordion.tsx +0 -1
  227. package/src/blocks/question-pager/question-pager.tsx +2 -1
  228. package/src/blocks/review-card/review-card.tsx +4 -0
  229. package/src/blocks/send-bar/send-bar.tsx +1 -0
  230. package/src/blocks/stage-bar/stage-bar.tsx +3 -2
  231. package/src/blocks/stat-card/stat-card.tsx +2 -1
  232. package/src/blocks/step-screen/step-screen.tsx +5 -2
  233. package/src/blocks/store-top/store-top.tsx +7 -2
  234. package/src/blocks/summary-cards/summary-cards.tsx +4 -3
  235. package/src/blocks/task-tiles/task-tiles.tsx +2 -1
  236. package/src/components/amount-summary/amount-summary.tsx +9 -3
  237. package/src/components/button/button.tsx +6 -0
  238. package/src/components/calendar/calendar.tsx +5 -2
  239. package/src/components/chip/chip.tsx +2 -1
  240. package/src/components/circle-grid/circle-grid.tsx +5 -1
  241. package/src/components/credit/credit.tsx +2 -2
  242. package/src/components/dialog/dialog.tsx +2 -0
  243. package/src/components/empty-state/empty-state.tsx +1 -0
  244. package/src/components/fact-list/fact-list.tsx +1 -0
  245. package/src/components/field/field.tsx +4 -0
  246. package/src/components/filter-tabs/filter-tabs.tsx +2 -1
  247. package/src/components/list-row/list-row.tsx +40 -5
  248. package/src/components/page-header/page-header.tsx +1 -0
  249. package/src/components/pill/pill.tsx +1 -0
  250. package/src/components/segmented-control/segmented-control.tsx +2 -0
  251. package/src/components/segmented-tabs/segmented-tabs.tsx +2 -1
  252. package/src/components/status-steps/status-steps.tsx +2 -0
  253. package/src/components/text/figures.tsx +92 -0
  254. package/src/components/text/index.ts +7 -0
  255. package/src/components/text/metrics.ts +5 -0
  256. package/src/components/text/text.tsx +60 -16
  257. package/src/components/tile-grid/tile-grid.tsx +3 -2
  258. package/src/components/toast/toast.tsx +7 -1
  259. package/src/components/value-rows/value-rows.tsx +9 -1
  260. package/src/internal/field-label.tsx +2 -0
  261. package/src/internal/roll-text.tsx +12 -2
  262. package/src/internal/sample-tiles.tsx +2 -0
  263. package/src/sortable/section-board.tsx +2 -0
  264. package/src/templates/design-pick-template.tsx +1 -0
  265. package/src/templates/preview-edit-template.tsx +3 -0
  266. package/src/templates/scroll-templates.tsx +11 -2
  267. package/src/templates/sheet-form-template.tsx +4 -0
  268. package/src/theme/base.ts +9 -2
  269. package/src/theme/create-theme.ts +9 -2
  270. package/src/theme/tokens.ts +37 -3
  271. package/src/types/index.ts +13 -0
@@ -13,6 +13,7 @@ const useStyles = makeStyles((t) => ({
13
13
  line: {
14
14
  fontFamily: t.fontFamily,
15
15
  fontSize: t.typography.label.fontSize,
16
+ letterSpacing: t.typography.label.letterSpacing,
16
17
  lineHeight: t.typography.label.lineHeight,
17
18
  color: t.colors.mutedForeground,
18
19
  },
@@ -104,11 +104,13 @@ const useStyles = makeStyles((t) => ({
104
104
  paddingVertical: 0,
105
105
  fontFamily: t.fontFamily,
106
106
  fontSize: t.typography.bodyLg.fontSize,
107
+ letterSpacing: t.typography.bodyLg.letterSpacing,
107
108
  color: t.colors.foreground,
108
109
  },
109
110
  error: {
110
111
  fontFamily: t.fontFamily,
111
112
  fontSize: t.typography.label.fontSize,
113
+ letterSpacing: t.typography.label.letterSpacing,
112
114
  lineHeight: t.typography.label.lineHeight,
113
115
  paddingLeft: t.space[1],
114
116
  color: t.colors.danger,
@@ -124,6 +126,7 @@ const useStyles = makeStyles((t) => ({
124
126
  hint: {
125
127
  fontFamily: t.fontFamily,
126
128
  fontSize: t.typography.label.fontSize,
129
+ letterSpacing: t.typography.label.letterSpacing,
127
130
  lineHeight: t.typography.label.lineHeight,
128
131
  paddingLeft: t.space[1],
129
132
  color: t.colors.mutedForeground,
@@ -131,6 +134,7 @@ const useStyles = makeStyles((t) => ({
131
134
  warning: {
132
135
  fontFamily: t.fontFamily,
133
136
  fontSize: t.typography.label.fontSize,
137
+ letterSpacing: t.typography.label.letterSpacing,
134
138
  lineHeight: t.typography.label.lineHeight,
135
139
  paddingLeft: t.space[1],
136
140
  color: t.colors.foreground,
@@ -51,11 +51,12 @@ const useStyles = makeStyles((t) => ({
51
51
  label: {
52
52
  fontFamily: t.fontFamily,
53
53
  fontSize: t.typography.label.fontSize,
54
+ letterSpacing: t.typography.label.letterSpacing,
54
55
  lineHeight: t.typography.label.lineHeight,
55
56
  fontWeight: '500',
56
57
  color: t.colors.faint,
57
58
  },
58
- strong: { fontWeight: '700' },
59
+ strong: { fontWeight: '600' },
59
60
  line: {
60
61
  position: 'absolute',
61
62
  left: 0,
@@ -14,6 +14,7 @@ import { makeStyles } from '../../utils/styles';
14
14
  import { Photo } from '../photo/photo';
15
15
  import { FlushRowContext } from '../../internal/flush-row';
16
16
  import { haptic } from '../../internal/haptics';
17
+ import { Figures, Won, isFigureText, type FiguresScope } from '../text/figures';
17
18
 
18
19
  export type ListRowTone = 'muted' | 'warning' | 'danger';
19
20
 
@@ -36,6 +37,7 @@ export type ListRowProps = Omit<
36
37
  strong?: boolean;
37
38
  titleSize?: 'md' | 'lg';
38
39
  titleLines?: number;
40
+ titleFigures?: FiguresScope;
39
41
  selection?: 'check' | 'radio';
40
42
  selected?: boolean;
41
43
  };
@@ -65,7 +67,6 @@ const useStyles = makeStyles((t) => ({
65
67
  ...t.typography.bodyLg,
66
68
  fontFamily: t.fontFamily,
67
69
  color: t.colors.foreground,
68
- fontVariant: ['tabular-nums'],
69
70
  },
70
71
  meta: {
71
72
  ...t.typography.label,
@@ -107,6 +108,7 @@ const useStyles = makeStyles((t) => ({
107
108
  checkOn: { borderColor: t.colors.primary, backgroundColor: t.colors.primary },
108
109
  radioOn: { borderWidth: 6, borderColor: t.colors.primary },
109
110
  strong: { color: t.colors.title, fontWeight: '600' },
111
+ strongFigure: { fontWeight: '500' },
110
112
  titleLg: {
111
113
  ...t.typography.bodyLg,
112
114
  color: t.colors.title,
@@ -130,6 +132,7 @@ export function ListRow({
130
132
  strong = false,
131
133
  titleSize = 'md',
132
134
  titleLines = 1,
135
+ titleFigures,
133
136
  selection,
134
137
  selected = false,
135
138
  onPress,
@@ -194,9 +197,31 @@ export function ListRow({
194
197
  <Text
195
198
  numberOfLines={titleLines}
196
199
  maxFontSizeMultiplier={t.maxFontScale}
197
- style={[s.title, strong && s.strong, titleSize === 'lg' && s.titleLg]}
200
+ style={[
201
+ s.title,
202
+ strong && s.strong,
203
+ titleSize === 'lg' && s.titleLg,
204
+ (strong || titleSize === 'lg') &&
205
+ isFigureText(title) &&
206
+ s.strongFigure,
207
+ ]}
198
208
  >
199
- {title}
209
+ {titleFigures ? (
210
+ <Figures
211
+ size={t.typography.bodyLg.fontSize}
212
+ tracking={t.typography.bodyLg.letterSpacing}
213
+ scope={titleFigures}
214
+ >
215
+ {title}
216
+ </Figures>
217
+ ) : (
218
+ <Won
219
+ size={t.typography.bodyLg.fontSize}
220
+ tracking={t.typography.bodyLg.letterSpacing}
221
+ >
222
+ {title}
223
+ </Won>
224
+ )}
200
225
  </Text>
201
226
  {description ? (
202
227
  <Text
@@ -218,9 +243,19 @@ export function ListRow({
218
243
  {value ? (
219
244
  <Text
220
245
  maxFontSizeMultiplier={t.maxFontScale}
221
- style={[s.value, strong && s.strong, strong && s.money]}
246
+ style={[
247
+ s.value,
248
+ strong && s.strong,
249
+ strong && s.money,
250
+ strong && isFigureText(value) && s.strongFigure,
251
+ ]}
222
252
  >
223
- {value}
253
+ <Won
254
+ size={t.typography.bodyLg.fontSize}
255
+ tracking={t.typography.bodyLg.letterSpacing}
256
+ >
257
+ {value}
258
+ </Won>
224
259
  </Text>
225
260
  ) : null}
226
261
  {trailing ? renderIcon(trailing, icon) : null}
@@ -33,6 +33,7 @@ const useStyles = makeStyles((t) => ({
33
33
  },
34
34
  title: {
35
35
  fontSize: t.typography.screenTitle.fontSize,
36
+ fontFamily: t.fontFamily,
36
37
  lineHeight: t.typography.screenTitle.lineHeight,
37
38
  fontWeight: t.typography.screenTitle.fontWeight,
38
39
  letterSpacing: t.typography.screenTitle.letterSpacing,
@@ -39,6 +39,7 @@ const useStyles = makeStyles((t) => ({
39
39
  label: {
40
40
  fontFamily: t.fontFamily,
41
41
  fontSize: t.typography.caption.fontSize,
42
+ letterSpacing: t.typography.caption.letterSpacing,
42
43
  lineHeight: t.typography.caption.lineHeight,
43
44
  fontWeight: '500',
44
45
  color: t.colors.mutedForeground,
@@ -35,6 +35,8 @@ const useStyles = makeStyles((t) => ({
35
35
  on: { backgroundColor: t.colors.surface, boxShadow: t.shadow.sm },
36
36
  label: {
37
37
  fontSize: t.typography.eyebrow.fontSize,
38
+ fontFamily: t.fontFamily,
39
+ letterSpacing: t.typography.eyebrow.letterSpacing,
38
40
  lineHeight: t.typography.eyebrow.lineHeight,
39
41
  color: t.colors.mutedForeground,
40
42
  },
@@ -53,15 +53,16 @@ const useStyles = makeStyles((t) => ({
53
53
  label: {
54
54
  fontFamily: t.fontFamily,
55
55
  fontSize: t.typography.body.fontSize,
56
+ letterSpacing: t.typography.body.letterSpacing,
56
57
  lineHeight: t.typography.body.lineHeight,
57
58
  color: t.colors.mutedForeground,
58
59
  },
59
60
  count: {
60
61
  fontFamily: t.fontFamily,
61
62
  fontSize: t.typography.eyebrow.fontSize,
63
+ letterSpacing: t.typography.eyebrow.letterSpacing,
62
64
  lineHeight: t.typography.eyebrow.lineHeight,
63
65
  color: t.colors.mutedForeground,
64
- fontVariant: ['tabular-nums'],
65
66
  },
66
67
  strong: { fontWeight: '600' },
67
68
  bar: {
@@ -120,6 +120,8 @@ const useStyles = makeStyles((t) => ({
120
120
  due: { color: t.colors.warningText },
121
121
  small: {
122
122
  fontSize: t.typography.eyebrow.fontSize,
123
+ fontFamily: t.fontFamily,
124
+ letterSpacing: t.typography.eyebrow.letterSpacing,
123
125
  lineHeight: t.typography.eyebrow.lineHeight,
124
126
  },
125
127
  }));
@@ -0,0 +1,92 @@
1
+ import { useContext } from 'react';
2
+ import { Text as RNText } from 'react-native';
3
+ import { useTheme } from '../../theme/theme-provider';
4
+ import { TextMetricsContext } from './metrics';
5
+
6
+ const MONEY = /^([+\-−]?\d[\d,]*(?:\.\d+)?)(만원|원)$/;
7
+ const FIGURE =
8
+ /^[₩$]?[+\-−]?\d[\d,.:\-–~/\s]*(원|%|개|명|박|인|점|건|회|일|분|시간|만원|P)?$/;
9
+ const RUN = /(\d[\d,.:]*)/;
10
+ const MORE = /^(.*\s외\s)(\d[\d,]*)(건|개)$/;
11
+
12
+ export type FigureProps = {
13
+ children: string;
14
+ size?: number;
15
+ tracking?: number;
16
+ };
17
+
18
+ export type FiguresScope = 'all' | 'more';
19
+
20
+ function px(value: number) {
21
+ return Math.round(value * 100) / 100;
22
+ }
23
+
24
+ function useMetrics(size?: number, tracking?: number) {
25
+ const t = useTheme();
26
+ const context = useContext(TextMetricsContext);
27
+ return {
28
+ t,
29
+ size: size ?? context?.size ?? t.typography.body.fontSize,
30
+ tracking: tracking ?? context?.tracking ?? 0,
31
+ };
32
+ }
33
+
34
+ export function isFigureText(text: string | undefined | null): boolean {
35
+ return !!text && FIGURE.test(text.trim());
36
+ }
37
+
38
+ export function Won({ children, size, tracking }: FigureProps) {
39
+ const m = useMetrics(size, tracking);
40
+ const match = MONEY.exec(children.trim());
41
+ if (!match) return <>{children}</>;
42
+ const [, amount = '', unit = ''] = match;
43
+ const f = m.t.figure;
44
+ return (
45
+ <>
46
+ {amount.slice(0, -1)}
47
+ <RNText style={{ letterSpacing: px(m.tracking + f.unitGap * m.size) }}>
48
+ {amount.slice(-1)}
49
+ </RNText>
50
+ <RNText
51
+ style={{
52
+ fontSize: px(m.size * f.unitScale),
53
+ fontWeight: f.unitWeight,
54
+ letterSpacing: f.unitTracking,
55
+ }}
56
+ >
57
+ {unit}
58
+ </RNText>
59
+ </>
60
+ );
61
+ }
62
+
63
+ export function Figures({
64
+ children,
65
+ size,
66
+ tracking,
67
+ scope = 'all',
68
+ }: FigureProps & { scope?: FiguresScope }) {
69
+ const m = useMetrics(size, tracking);
70
+ const f = m.t.figure;
71
+ if (m.size < f.emphasisMinSize) return <>{children}</>;
72
+ const style = {
73
+ fontWeight: f.emphasisWeight,
74
+ letterSpacing: px(f.emphasisTracking * m.size),
75
+ };
76
+ const more = scope === 'more' ? MORE.exec(children) : null;
77
+ if (scope === 'more' && !more) return <>{children}</>;
78
+ const parts = more ? more.slice(1) : children.split(RUN);
79
+ return (
80
+ <>
81
+ {parts.map((part, i) =>
82
+ i % 2 === 1 ? (
83
+ <RNText key={i} style={style}>
84
+ {part}
85
+ </RNText>
86
+ ) : (
87
+ part
88
+ )
89
+ )}
90
+ </>
91
+ );
92
+ }
@@ -1 +1,8 @@
1
1
  export { Text, type TextProps, type TextTone, type TextWeight } from './text';
2
+ export {
3
+ Figures,
4
+ Won,
5
+ isFigureText,
6
+ type FigureProps,
7
+ type FiguresScope,
8
+ } from './figures';
@@ -0,0 +1,5 @@
1
+ import { createContext } from 'react';
2
+
3
+ export type TextMetrics = { size: number; tracking: number };
4
+
5
+ export const TextMetricsContext = createContext<TextMetrics | null>(null);
@@ -1,8 +1,21 @@
1
- import type { ComponentRef, Ref } from 'react';
2
- import { Text as RNText, type TextProps as RNTextProps } from 'react-native';
1
+ import {
2
+ isValidElement,
3
+ useMemo,
4
+ type ComponentRef,
5
+ type ReactNode,
6
+ type Ref,
7
+ } from 'react';
8
+ import {
9
+ StyleSheet,
10
+ Text as RNText,
11
+ type TextProps as RNTextProps,
12
+ type TextStyle,
13
+ } from 'react-native';
3
14
  import type { TypographyVariant } from '../../types';
4
15
  import { useTheme } from '../../theme/theme-provider';
5
16
  import { makeStyles } from '../../utils/styles';
17
+ import { TextMetricsContext } from './metrics';
18
+ import { Won, isFigureText } from './figures';
6
19
 
7
20
  export type TextTone =
8
21
  'default' | 'muted' | 'primary' | 'point' | 'warning' | 'danger' | 'success';
@@ -36,34 +49,65 @@ const useStyles = makeStyles((t) => ({
36
49
  regular: { fontWeight: '400' },
37
50
  medium: { fontWeight: '500' },
38
51
  semibold: { fontWeight: '600' },
52
+ figure: { fontWeight: t.figure.weight },
39
53
  }));
40
54
 
55
+ const HEAVY = new Set(['600', '700', '800', '900', 'bold', 600, 700, 800, 900]);
56
+
57
+ function figureOf(children: ReactNode): string | null {
58
+ if (typeof children === 'string') return children;
59
+ if (typeof children === 'number') return String(children);
60
+ if (isValidElement<{ children?: unknown }>(children) && children.type === Won)
61
+ return typeof children.props.children === 'string'
62
+ ? children.props.children
63
+ : null;
64
+ return null;
65
+ }
66
+
41
67
  export function Text({
42
68
  variant = 'body',
43
69
  tone = 'default',
44
70
  weight,
45
71
  style,
72
+ children,
46
73
  ...rest
47
74
  }: TextProps) {
48
75
  const t = useTheme();
49
76
  const s = useStyles();
77
+ const styles = [
78
+ s.font,
79
+ s[variant],
80
+ s[tone],
81
+ tone === 'default' &&
82
+ (variant === 'screenTitle' ||
83
+ variant === 'title' ||
84
+ variant === 'display' ||
85
+ weight === 'semibold') &&
86
+ s.heading,
87
+ weight && s[weight],
88
+ style,
89
+ ];
90
+ const flat: TextStyle = StyleSheet.flatten(styles as TextStyle[]) ?? {};
91
+ const shown = figureOf(children);
92
+ const capped =
93
+ shown !== null && isFigureText(shown) && HEAVY.has(flat.fontWeight ?? '');
94
+ const size = flat.fontSize ?? t.typography[variant].fontSize;
95
+ const tracking = flat.letterSpacing ?? 0;
96
+ const metrics = useMemo(() => ({ size, tracking }), [size, tracking]);
50
97
  return (
51
98
  <RNText
52
99
  maxFontSizeMultiplier={t.maxFontScale}
100
+ lineBreakStrategyIOS="hangul-word"
53
101
  {...rest}
54
- style={[
55
- s.font,
56
- s[variant],
57
- s[tone],
58
- tone === 'default' &&
59
- (variant === 'screenTitle' ||
60
- variant === 'title' ||
61
- variant === 'display' ||
62
- weight === 'semibold') &&
63
- s.heading,
64
- weight && s[weight],
65
- style,
66
- ]}
67
- />
102
+ style={capped ? [...styles, s.figure] : styles}
103
+ >
104
+ {typeof children === 'string' || typeof children === 'number' ? (
105
+ children
106
+ ) : (
107
+ <TextMetricsContext.Provider value={metrics}>
108
+ {children}
109
+ </TextMetricsContext.Provider>
110
+ )}
111
+ </RNText>
68
112
  );
69
113
  }
@@ -49,7 +49,7 @@ const NAME_TOP = 32;
49
49
  const NAME_WIDTH = 88;
50
50
  const NAME_SIZE = 16;
51
51
  const NAME_LEADING = 21;
52
- const NAME_TRACKING = -0.3;
52
+ const NAME_TRACKING = -0.19;
53
53
  const CHECK = 22;
54
54
  const CHECK_INSET = 12;
55
55
 
@@ -106,6 +106,7 @@ const useStyles = makeStyles((t) => ({
106
106
  right: INSET_X,
107
107
  fontFamily: t.fontFamily,
108
108
  fontSize: t.typography.eyebrow.fontSize,
109
+ letterSpacing: t.typography.eyebrow.letterSpacing,
109
110
  lineHeight: t.typography.eyebrow.lineHeight,
110
111
  fontWeight: '400',
111
112
  color: t.colors.faint,
@@ -122,7 +123,7 @@ const useStyles = makeStyles((t) => ({
122
123
  fontWeight: '600',
123
124
  color: t.colors.title,
124
125
  },
125
- strong: { fontWeight: '700' },
126
+ strong: { fontWeight: '600' },
126
127
  check: {
127
128
  position: 'absolute',
128
129
  left: CHECK_INSET,
@@ -143,12 +143,18 @@ const useStyles = makeStyles((t) => ({
143
143
  paddingRight: t.space[2],
144
144
  },
145
145
  message: { ...t.typography.body, flexShrink: 1, fontFamily: t.fontFamily },
146
- messageFill: { flex: 1, fontSize: t.typography.label.fontSize },
146
+ messageFill: {
147
+ flex: 1,
148
+ fontSize: t.typography.label.fontSize,
149
+ fontFamily: t.fontFamily,
150
+ letterSpacing: t.typography.label.letterSpacing,
151
+ },
147
152
  action: { paddingHorizontal: t.space[3], justifyContent: 'center' },
148
153
  mark: { marginRight: t.space[2] },
149
154
  actionLabel: {
150
155
  fontFamily: t.fontFamily,
151
156
  fontSize: t.typography.label.fontSize,
157
+ letterSpacing: t.typography.label.letterSpacing,
152
158
  lineHeight: t.typography.label.lineHeight,
153
159
  fontWeight: '600',
154
160
  },
@@ -3,6 +3,7 @@ import { ChevronGlyph } from '../../internal/glyphs';
3
3
  import { PressableBase } from '../../internal/pressable-base';
4
4
  import { useTheme } from '../../theme/theme-provider';
5
5
  import { makeStyles } from '../../utils/styles';
6
+ import { Won } from '../text/figures';
6
7
 
7
8
  export type ValueTone = 'default' | 'warning' | 'success';
8
9
 
@@ -30,6 +31,7 @@ const useStyles = makeStyles((t) => ({
30
31
  label: {
31
32
  fontFamily: t.fontFamily,
32
33
  fontSize: t.typography.label.fontSize,
34
+ letterSpacing: t.typography.label.letterSpacing,
33
35
  lineHeight: t.typography.label.lineHeight,
34
36
  color: t.colors.mutedForeground,
35
37
  },
@@ -38,6 +40,7 @@ const useStyles = makeStyles((t) => ({
38
40
  textAlign: 'right',
39
41
  fontFamily: t.fontFamily,
40
42
  fontSize: t.typography.label.fontSize,
43
+ letterSpacing: t.typography.label.letterSpacing,
41
44
  lineHeight: t.typography.label.lineHeight,
42
45
  color: t.colors.foreground,
43
46
  },
@@ -72,7 +75,12 @@ export function ValueRows({ rows, style }: ValueRowsProps) {
72
75
  {row.note ? (
73
76
  <Text style={tone(row.note.tone)}>{`${row.note.text} `}</Text>
74
77
  ) : null}
75
- {row.value}
78
+ <Won
79
+ size={t.typography.label.fontSize}
80
+ tracking={t.typography.label.letterSpacing}
81
+ >
82
+ {row.value}
83
+ </Won>
76
84
  </Text>
77
85
  {row.onPress ? (
78
86
  <ChevronGlyph color={t.colors.ring} size={t.iconSize.sm} />
@@ -13,6 +13,7 @@ const useStyles = makeStyles((t) => ({
13
13
  flexShrink: 1,
14
14
  fontFamily: t.fontFamily,
15
15
  fontSize: t.typography.body.fontSize,
16
+ letterSpacing: t.typography.body.letterSpacing,
16
17
  lineHeight: t.typography.body.lineHeight,
17
18
  fontWeight: '500',
18
19
  color: t.colors.foreground,
@@ -22,6 +23,7 @@ const useStyles = makeStyles((t) => ({
22
23
  marginLeft: 'auto',
23
24
  fontFamily: t.fontFamily,
24
25
  fontSize: t.typography.caption.fontSize,
26
+ letterSpacing: t.typography.caption.letterSpacing,
25
27
  lineHeight: t.typography.caption.lineHeight,
26
28
  color: t.colors.mutedForeground,
27
29
  fontVariant: ['tabular-nums'],
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useRef } from 'react';
2
- import type { StyleProp, TextStyle } from 'react-native';
2
+ import { StyleSheet, type StyleProp, type TextStyle } from 'react-native';
3
3
  import Animated, {
4
4
  interpolateColor,
5
5
  type AnimatedStyle,
@@ -8,6 +8,7 @@ import Animated, {
8
8
  withSequence,
9
9
  withTiming,
10
10
  } from 'react-native-reanimated';
11
+ import { Won } from '../components/text/figures';
11
12
  import { useTheme } from '../theme/theme-provider';
12
13
  import { timing } from './motion';
13
14
 
@@ -19,11 +20,13 @@ export function RollText({
19
20
  style,
20
21
  animatedStyle,
21
22
  flash = false,
23
+ money = false,
22
24
  }: {
23
25
  children: string | number;
24
26
  style?: StyleProp<TextStyle>;
25
27
  animatedStyle?: StyleProp<AnimatedStyle<TextStyle>>;
26
28
  flash?: boolean;
29
+ money?: boolean;
27
30
  }) {
28
31
  const t = useTheme();
29
32
  const roll = useSharedValue(0);
@@ -54,6 +57,7 @@ export function RollText({
54
57
  ['transparent', tint]
55
58
  ),
56
59
  }));
60
+ const flat = StyleSheet.flatten(style) ?? {};
57
61
  return (
58
62
  <Animated.Text
59
63
  maxFontSizeMultiplier={t.maxFontScale}
@@ -64,7 +68,13 @@ export function RollText({
64
68
  move,
65
69
  ]}
66
70
  >
67
- {children}
71
+ {money ? (
72
+ <Won size={flat.fontSize} tracking={flat.letterSpacing}>
73
+ {String(children)}
74
+ </Won>
75
+ ) : (
76
+ children
77
+ )}
68
78
  </Animated.Text>
69
79
  );
70
80
  }
@@ -87,6 +87,8 @@ export function useSampleStyle() {
87
87
  const t = useTheme();
88
88
  return {
89
89
  fontSize: t.typography.screenTitle.fontSize,
90
+ fontFamily: t.fontFamily,
91
+ letterSpacing: t.typography.screenTitle.letterSpacing,
90
92
  lineHeight: t.typography.screenTitle.lineHeight,
91
93
  color: t.colors.title,
92
94
  };
@@ -106,6 +106,8 @@ const useStyles = makeStyles((t) => ({
106
106
  snippet: {
107
107
  marginTop: t.space[1],
108
108
  fontSize: t.typography.eyebrow.fontSize,
109
+ fontFamily: t.fontFamily,
110
+ letterSpacing: t.typography.eyebrow.letterSpacing,
109
111
  lineHeight: t.typography.eyebrow.lineHeight,
110
112
  },
111
113
  faded: { opacity: t.opacity.disabled },
@@ -94,6 +94,7 @@ const useStyles = makeStyles((t) => ({
94
94
  label: {
95
95
  fontFamily: t.fontFamily,
96
96
  fontSize: t.typography.label.fontSize,
97
+ letterSpacing: t.typography.label.letterSpacing,
97
98
  lineHeight: t.typography.label.lineHeight,
98
99
  fontWeight: '500',
99
100
  color: t.colors.mutedForeground,
@@ -112,6 +112,7 @@ const useStyles = makeStyles((t) => ({
112
112
  optionLabel: {
113
113
  fontFamily: t.fontFamily,
114
114
  fontSize: t.typography.eyebrow.fontSize,
115
+ letterSpacing: t.typography.eyebrow.letterSpacing,
115
116
  lineHeight: t.typography.eyebrow.lineHeight,
116
117
  fontWeight: '500',
117
118
  color: t.colors.mutedForeground,
@@ -120,6 +121,7 @@ const useStyles = makeStyles((t) => ({
120
121
  note: {
121
122
  fontFamily: t.fontFamily,
122
123
  fontSize: t.typography.eyebrow.fontSize,
124
+ letterSpacing: t.typography.eyebrow.letterSpacing,
123
125
  lineHeight: t.typography.eyebrow.lineHeight,
124
126
  fontWeight: '500',
125
127
  color: t.colors.faint,
@@ -180,6 +182,7 @@ const useStyles = makeStyles((t) => ({
180
182
  tileLabel: {
181
183
  fontFamily: t.fontFamily,
182
184
  fontSize: t.typography.eyebrow.fontSize,
185
+ letterSpacing: t.typography.eyebrow.letterSpacing,
183
186
  lineHeight: t.typography.eyebrow.lineHeight,
184
187
  fontWeight: '400',
185
188
  color: t.colors.title,
@@ -7,6 +7,7 @@ import {
7
7
  } from 'react-native';
8
8
  import { Photo } from '../components/photo/photo';
9
9
  import { Text } from '../components/text/text';
10
+ import { Won, isFigureText } from '../components/text/figures';
10
11
  import { CopyGlyph } from '../internal/glyphs';
11
12
  import { PressableBase } from '../internal/pressable-base';
12
13
  import { useTheme } from '../theme/theme-provider';
@@ -83,6 +84,7 @@ const useStyles = makeStyles((t) => ({
83
84
  flex: 1,
84
85
  fontFamily: t.fontFamily,
85
86
  fontSize: t.typography.screenTitle.fontSize,
87
+ letterSpacing: t.typography.screenTitle.letterSpacing,
86
88
  lineHeight: t.typography.screenTitle.lineHeight,
87
89
  fontWeight: '600',
88
90
  color: t.colors.title,
@@ -95,13 +97,17 @@ const useStyles = makeStyles((t) => ({
95
97
  heroCaptionText: {
96
98
  fontFamily: t.fontFamily,
97
99
  fontSize: t.typography.eyebrow.fontSize,
100
+ letterSpacing: t.typography.eyebrow.letterSpacing,
98
101
  lineHeight: t.typography.eyebrow.lineHeight,
99
102
  color: t.colors.mutedForeground,
100
103
  },
101
104
  heroBody: { marginTop: t.space[4] },
102
105
  heroWarn: { color: t.colors.warningText, fontWeight: '500' },
106
+ heroFigure: { fontWeight: '500' },
103
107
  heroSuffix: {
104
108
  fontSize: t.typography.label.fontSize,
109
+ fontFamily: t.fontFamily,
110
+ letterSpacing: t.typography.label.letterSpacing,
105
111
  fontWeight: '400',
106
112
  color: t.colors.mutedForeground,
107
113
  },
@@ -146,8 +152,11 @@ function ScrollTemplate({
146
152
  <View style={s.hero}>
147
153
  {hero.overline}
148
154
  <View style={s.heroHead}>
149
- <Text accessibilityRole="header" style={s.heroTitle}>
150
- {hero.title}
155
+ <Text
156
+ accessibilityRole="header"
157
+ style={[s.heroTitle, isFigureText(hero.title) && s.heroFigure]}
158
+ >
159
+ <Won>{hero.title}</Won>
151
160
  {hero.titleSuffix ? (
152
161
  <Text style={s.heroSuffix}>{` ${hero.titleSuffix}`}</Text>
153
162
  ) : null}