@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.
- package/CHANGELOG.md +6 -0
- package/lib/module/adjust/axis-adjust.js +1 -1
- package/lib/module/adjust/axis-adjust.js.map +1 -1
- package/lib/module/adjust/axis-dial.js +2 -2
- package/lib/module/adjust/axis-dial.js.map +1 -1
- package/lib/module/adjust/axis-tabs.js +1 -1
- package/lib/module/adjust/axis-tabs.js.map +1 -1
- package/lib/module/adjust/dial-strip.js +6 -4
- package/lib/module/adjust/dial-strip.js.map +1 -1
- package/lib/module/adjust/store-sample.js +1 -1
- package/lib/module/blocks/chat-message/chat-message.js +1 -0
- package/lib/module/blocks/chat-message/chat-message.js.map +1 -1
- package/lib/module/blocks/choice-art/choice-art.js +2 -0
- package/lib/module/blocks/choice-art/choice-art.js.map +1 -1
- package/lib/module/blocks/color-tune/store-sample.js +13 -6
- package/lib/module/blocks/color-tune/store-sample.js.map +1 -1
- package/lib/module/blocks/color-tune/swatch-card.js +1 -1
- package/lib/module/blocks/color-tune/swatch-card.js.map +1 -1
- package/lib/module/blocks/detail-editor/compare-slider.js +1 -0
- package/lib/module/blocks/detail-editor/compare-slider.js.map +1 -1
- package/lib/module/blocks/detail-editor/detail-canvas.js +3 -0
- package/lib/module/blocks/detail-editor/detail-canvas.js.map +1 -1
- package/lib/module/blocks/detail-editor/layout-picker.js +4 -1
- package/lib/module/blocks/detail-editor/layout-picker.js.map +1 -1
- package/lib/module/blocks/detail-studio/action-chips.js +1 -0
- package/lib/module/blocks/detail-studio/action-chips.js.map +1 -1
- package/lib/module/blocks/detail-studio/adjust-tiles.js +1 -0
- package/lib/module/blocks/detail-studio/adjust-tiles.js.map +1 -1
- package/lib/module/blocks/detail-studio/image-prompt.js +1 -0
- package/lib/module/blocks/detail-studio/image-prompt.js.map +1 -1
- package/lib/module/blocks/detail-studio/section-kind-grid.js +2 -0
- package/lib/module/blocks/detail-studio/section-kind-grid.js.map +1 -1
- package/lib/module/blocks/detail-studio/text-format-panel.js +4 -0
- package/lib/module/blocks/detail-studio/text-format-panel.js.map +1 -1
- package/lib/module/blocks/draft-box/draft-box.js +3 -0
- package/lib/module/blocks/draft-box/draft-box.js.map +1 -1
- package/lib/module/blocks/oauth-buttons/oauth-buttons.js +1 -0
- package/lib/module/blocks/oauth-buttons/oauth-buttons.js.map +1 -1
- package/lib/module/blocks/order-block/order-block.js +19 -5
- package/lib/module/blocks/order-block/order-block.js.map +1 -1
- package/lib/module/blocks/product-tile/product-tile.js +4 -1
- package/lib/module/blocks/product-tile/product-tile.js.map +1 -1
- package/lib/module/blocks/question-accordion/question-accordion.js +1 -2
- package/lib/module/blocks/question-accordion/question-accordion.js.map +1 -1
- package/lib/module/blocks/question-pager/question-pager.js +2 -1
- package/lib/module/blocks/question-pager/question-pager.js.map +1 -1
- package/lib/module/blocks/review-card/review-card.js +4 -0
- package/lib/module/blocks/review-card/review-card.js.map +1 -1
- package/lib/module/blocks/send-bar/send-bar.js +1 -0
- package/lib/module/blocks/send-bar/send-bar.js.map +1 -1
- package/lib/module/blocks/stage-bar/stage-bar.js +3 -2
- package/lib/module/blocks/stage-bar/stage-bar.js.map +1 -1
- package/lib/module/blocks/stat-card/stat-card.js +4 -1
- package/lib/module/blocks/stat-card/stat-card.js.map +1 -1
- package/lib/module/blocks/step-screen/step-screen.js +5 -2
- package/lib/module/blocks/step-screen/step-screen.js.map +1 -1
- package/lib/module/blocks/store-top/store-top.js +8 -3
- package/lib/module/blocks/store-top/store-top.js.map +1 -1
- package/lib/module/blocks/summary-cards/summary-cards.js +10 -3
- package/lib/module/blocks/summary-cards/summary-cards.js.map +1 -1
- package/lib/module/blocks/task-tiles/task-tiles.js +3 -2
- package/lib/module/blocks/task-tiles/task-tiles.js.map +1 -1
- package/lib/module/components/amount-summary/amount-summary.js +7 -1
- package/lib/module/components/amount-summary/amount-summary.js.map +1 -1
- package/lib/module/components/button/button.js +6 -0
- package/lib/module/components/button/button.js.map +1 -1
- package/lib/module/components/calendar/calendar.js +7 -4
- package/lib/module/components/calendar/calendar.js.map +1 -1
- package/lib/module/components/chip/chip.js +2 -2
- package/lib/module/components/chip/chip.js.map +1 -1
- package/lib/module/components/circle-grid/circle-grid.js +1 -0
- package/lib/module/components/circle-grid/circle-grid.js.map +1 -1
- package/lib/module/components/credit/credit.js +2 -2
- package/lib/module/components/credit/credit.js.map +1 -1
- package/lib/module/components/dialog/dialog.js +2 -0
- package/lib/module/components/dialog/dialog.js.map +1 -1
- package/lib/module/components/empty-state/empty-state.js +1 -0
- package/lib/module/components/empty-state/empty-state.js.map +1 -1
- package/lib/module/components/fact-list/fact-list.js +1 -0
- package/lib/module/components/fact-list/fact-list.js.map +1 -1
- package/lib/module/components/field/field.js +4 -0
- package/lib/module/components/field/field.js.map +1 -1
- package/lib/module/components/filter-tabs/filter-tabs.js +2 -1
- package/lib/module/components/filter-tabs/filter-tabs.js.map +1 -1
- package/lib/module/components/list-row/list-row.js +23 -6
- package/lib/module/components/list-row/list-row.js.map +1 -1
- package/lib/module/components/page-header/page-header.js +1 -0
- package/lib/module/components/page-header/page-header.js.map +1 -1
- package/lib/module/components/pill/pill.js +1 -0
- package/lib/module/components/pill/pill.js.map +1 -1
- package/lib/module/components/segmented-control/segmented-control.js +2 -0
- package/lib/module/components/segmented-control/segmented-control.js.map +1 -1
- package/lib/module/components/segmented-tabs/segmented-tabs.js +3 -2
- package/lib/module/components/segmented-tabs/segmented-tabs.js.map +1 -1
- package/lib/module/components/status-steps/status-steps.js +2 -0
- package/lib/module/components/status-steps/status-steps.js.map +1 -1
- package/lib/module/components/text/figures.js +82 -0
- package/lib/module/components/text/figures.js.map +1 -0
- package/lib/module/components/text/index.js +1 -0
- package/lib/module/components/text/index.js.map +1 -1
- package/lib/module/components/text/metrics.js +5 -0
- package/lib/module/components/text/metrics.js.map +1 -0
- package/lib/module/components/text/text.js +31 -2
- package/lib/module/components/text/text.js.map +1 -1
- package/lib/module/components/tile-grid/tile-grid.js +3 -2
- package/lib/module/components/tile-grid/tile-grid.js.map +1 -1
- package/lib/module/components/toast/toast.js +4 -1
- package/lib/module/components/toast/toast.js.map +1 -1
- package/lib/module/components/value-rows/value-rows.js +8 -1
- package/lib/module/components/value-rows/value-rows.js.map +1 -1
- package/lib/module/internal/field-label.js +2 -0
- package/lib/module/internal/field-label.js.map +1 -1
- package/lib/module/internal/roll-text.js +10 -2
- package/lib/module/internal/roll-text.js.map +1 -1
- package/lib/module/internal/sample-tiles.js +2 -0
- package/lib/module/internal/sample-tiles.js.map +1 -1
- package/lib/module/sortable/section-board.js +2 -0
- package/lib/module/sortable/section-board.js.map +1 -1
- package/lib/module/templates/design-pick-template.js +1 -0
- package/lib/module/templates/design-pick-template.js.map +1 -1
- package/lib/module/templates/preview-edit-template.js +3 -0
- package/lib/module/templates/preview-edit-template.js.map +1 -1
- package/lib/module/templates/scroll-templates.js +12 -2
- package/lib/module/templates/scroll-templates.js.map +1 -1
- package/lib/module/templates/sheet-form-template.js +4 -0
- package/lib/module/templates/sheet-form-template.js.map +1 -1
- package/lib/module/theme/base.js +16 -9
- package/lib/module/theme/base.js.map +1 -1
- package/lib/module/theme/create-theme.js +6 -2
- package/lib/module/theme/create-theme.js.map +1 -1
- package/lib/module/theme/tokens.js +23 -2
- package/lib/module/theme/tokens.js.map +1 -1
- package/lib/typescript/src/adjust/dial-strip.d.ts.map +1 -1
- package/lib/typescript/src/blocks/chat-message/chat-message.d.ts.map +1 -1
- package/lib/typescript/src/blocks/choice-art/choice-art.d.ts.map +1 -1
- package/lib/typescript/src/blocks/color-tune/store-sample.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/compare-slider.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/detail-canvas.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/action-chips.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/adjust-tiles.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/image-prompt.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/section-kind-grid.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/text-format-panel.d.ts.map +1 -1
- package/lib/typescript/src/blocks/draft-box/draft-box.d.ts.map +1 -1
- package/lib/typescript/src/blocks/oauth-buttons/oauth-buttons.d.ts.map +1 -1
- package/lib/typescript/src/blocks/order-block/order-block.d.ts.map +1 -1
- package/lib/typescript/src/blocks/product-tile/product-tile.d.ts.map +1 -1
- package/lib/typescript/src/blocks/question-accordion/question-accordion.d.ts.map +1 -1
- package/lib/typescript/src/blocks/question-pager/question-pager.d.ts.map +1 -1
- package/lib/typescript/src/blocks/review-card/review-card.d.ts.map +1 -1
- package/lib/typescript/src/blocks/send-bar/send-bar.d.ts.map +1 -1
- package/lib/typescript/src/blocks/stage-bar/stage-bar.d.ts.map +1 -1
- package/lib/typescript/src/blocks/stat-card/stat-card.d.ts.map +1 -1
- package/lib/typescript/src/blocks/step-screen/step-screen.d.ts.map +1 -1
- package/lib/typescript/src/blocks/store-top/store-top.d.ts.map +1 -1
- package/lib/typescript/src/blocks/summary-cards/summary-cards.d.ts.map +1 -1
- package/lib/typescript/src/blocks/task-tiles/task-tiles.d.ts.map +1 -1
- package/lib/typescript/src/components/amount-summary/amount-summary.d.ts.map +1 -1
- package/lib/typescript/src/components/button/button.d.ts.map +1 -1
- package/lib/typescript/src/components/calendar/calendar.d.ts.map +1 -1
- package/lib/typescript/src/components/chip/chip.d.ts.map +1 -1
- package/lib/typescript/src/components/circle-grid/circle-grid.d.ts.map +1 -1
- package/lib/typescript/src/components/dialog/dialog.d.ts.map +1 -1
- package/lib/typescript/src/components/empty-state/empty-state.d.ts.map +1 -1
- package/lib/typescript/src/components/fact-list/fact-list.d.ts.map +1 -1
- package/lib/typescript/src/components/field/field.d.ts.map +1 -1
- package/lib/typescript/src/components/filter-tabs/filter-tabs.d.ts.map +1 -1
- package/lib/typescript/src/components/list-row/list-row.d.ts +3 -1
- package/lib/typescript/src/components/list-row/list-row.d.ts.map +1 -1
- package/lib/typescript/src/components/page-header/page-header.d.ts.map +1 -1
- package/lib/typescript/src/components/pill/pill.d.ts.map +1 -1
- package/lib/typescript/src/components/segmented-control/segmented-control.d.ts.map +1 -1
- package/lib/typescript/src/components/segmented-tabs/segmented-tabs.d.ts.map +1 -1
- package/lib/typescript/src/components/status-steps/status-steps.d.ts.map +1 -1
- package/lib/typescript/src/components/text/figures.d.ts +12 -0
- package/lib/typescript/src/components/text/figures.d.ts.map +1 -0
- package/lib/typescript/src/components/text/index.d.ts +1 -0
- package/lib/typescript/src/components/text/index.d.ts.map +1 -1
- package/lib/typescript/src/components/text/metrics.d.ts +6 -0
- package/lib/typescript/src/components/text/metrics.d.ts.map +1 -0
- package/lib/typescript/src/components/text/text.d.ts +2 -2
- package/lib/typescript/src/components/text/text.d.ts.map +1 -1
- package/lib/typescript/src/components/tile-grid/tile-grid.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/toast.d.ts.map +1 -1
- package/lib/typescript/src/components/value-rows/value-rows.d.ts.map +1 -1
- package/lib/typescript/src/internal/field-label.d.ts.map +1 -1
- package/lib/typescript/src/internal/roll-text.d.ts +3 -2
- package/lib/typescript/src/internal/roll-text.d.ts.map +1 -1
- package/lib/typescript/src/internal/sample-tiles.d.ts +2 -0
- package/lib/typescript/src/internal/sample-tiles.d.ts.map +1 -1
- package/lib/typescript/src/sortable/section-board.d.ts.map +1 -1
- package/lib/typescript/src/templates/design-pick-template.d.ts.map +1 -1
- package/lib/typescript/src/templates/preview-edit-template.d.ts.map +1 -1
- package/lib/typescript/src/templates/scroll-templates.d.ts.map +1 -1
- package/lib/typescript/src/templates/sheet-form-template.d.ts.map +1 -1
- package/lib/typescript/src/theme/base.d.ts +9 -2
- package/lib/typescript/src/theme/base.d.ts.map +1 -1
- package/lib/typescript/src/theme/create-theme.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens.d.ts +3 -1
- package/lib/typescript/src/theme/tokens.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +12 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adjust/axis-adjust.tsx +1 -1
- package/src/adjust/axis-dial.tsx +2 -2
- package/src/adjust/axis-tabs.tsx +1 -1
- package/src/adjust/dial-strip.tsx +5 -3
- package/src/adjust/store-sample.tsx +1 -1
- package/src/blocks/chat-message/chat-message.tsx +1 -0
- package/src/blocks/choice-art/choice-art.tsx +2 -0
- package/src/blocks/color-tune/store-sample.tsx +11 -6
- package/src/blocks/color-tune/swatch-card.tsx +1 -1
- package/src/blocks/detail-editor/compare-slider.tsx +1 -0
- package/src/blocks/detail-editor/detail-canvas.tsx +3 -0
- package/src/blocks/detail-editor/layout-picker.tsx +3 -0
- package/src/blocks/detail-studio/action-chips.tsx +1 -0
- package/src/blocks/detail-studio/adjust-tiles.tsx +1 -0
- package/src/blocks/detail-studio/image-prompt.tsx +1 -0
- package/src/blocks/detail-studio/section-kind-grid.tsx +2 -0
- package/src/blocks/detail-studio/text-format-panel.tsx +4 -0
- package/src/blocks/draft-box/draft-box.tsx +3 -0
- package/src/blocks/oauth-buttons/oauth-buttons.tsx +1 -0
- package/src/blocks/order-block/order-block.tsx +20 -4
- package/src/blocks/product-tile/product-tile.tsx +4 -1
- package/src/blocks/question-accordion/question-accordion.tsx +0 -1
- package/src/blocks/question-pager/question-pager.tsx +2 -1
- package/src/blocks/review-card/review-card.tsx +4 -0
- package/src/blocks/send-bar/send-bar.tsx +1 -0
- package/src/blocks/stage-bar/stage-bar.tsx +3 -2
- package/src/blocks/stat-card/stat-card.tsx +2 -1
- package/src/blocks/step-screen/step-screen.tsx +5 -2
- package/src/blocks/store-top/store-top.tsx +7 -2
- package/src/blocks/summary-cards/summary-cards.tsx +4 -3
- package/src/blocks/task-tiles/task-tiles.tsx +2 -1
- package/src/components/amount-summary/amount-summary.tsx +9 -3
- package/src/components/button/button.tsx +6 -0
- package/src/components/calendar/calendar.tsx +5 -2
- package/src/components/chip/chip.tsx +2 -1
- package/src/components/circle-grid/circle-grid.tsx +5 -1
- package/src/components/credit/credit.tsx +2 -2
- package/src/components/dialog/dialog.tsx +2 -0
- package/src/components/empty-state/empty-state.tsx +1 -0
- package/src/components/fact-list/fact-list.tsx +1 -0
- package/src/components/field/field.tsx +4 -0
- package/src/components/filter-tabs/filter-tabs.tsx +2 -1
- package/src/components/list-row/list-row.tsx +40 -5
- package/src/components/page-header/page-header.tsx +1 -0
- package/src/components/pill/pill.tsx +1 -0
- package/src/components/segmented-control/segmented-control.tsx +2 -0
- package/src/components/segmented-tabs/segmented-tabs.tsx +2 -1
- package/src/components/status-steps/status-steps.tsx +2 -0
- package/src/components/text/figures.tsx +92 -0
- package/src/components/text/index.ts +7 -0
- package/src/components/text/metrics.ts +5 -0
- package/src/components/text/text.tsx +60 -16
- package/src/components/tile-grid/tile-grid.tsx +3 -2
- package/src/components/toast/toast.tsx +7 -1
- package/src/components/value-rows/value-rows.tsx +9 -1
- package/src/internal/field-label.tsx +2 -0
- package/src/internal/roll-text.tsx +12 -2
- package/src/internal/sample-tiles.tsx +2 -0
- package/src/sortable/section-board.tsx +2 -0
- package/src/templates/design-pick-template.tsx +1 -0
- package/src/templates/preview-edit-template.tsx +3 -0
- package/src/templates/scroll-templates.tsx +11 -2
- package/src/templates/sheet-form-template.tsx +4 -0
- package/src/theme/base.ts +9 -2
- package/src/theme/create-theme.ts +9 -2
- package/src/theme/tokens.ts +37 -3
- package/src/types/index.ts +13 -0
|
@@ -64,6 +64,8 @@ const useStyles = makeStyles((t) => ({
|
|
|
64
64
|
flex: 1,
|
|
65
65
|
textAlign: 'center',
|
|
66
66
|
fontSize: t.typography.title.fontSize,
|
|
67
|
+
fontFamily: t.fontFamily,
|
|
68
|
+
letterSpacing: t.typography.title.letterSpacing,
|
|
67
69
|
lineHeight: t.typography.title.lineHeight,
|
|
68
70
|
},
|
|
69
71
|
body: { padding: t.space[3], gap: t.space[3] },
|
|
@@ -82,6 +84,8 @@ const useStyles = makeStyles((t) => ({
|
|
|
82
84
|
lead: { flexDirection: 'row', alignItems: 'center', gap: t.space[1] },
|
|
83
85
|
blockTitle: {
|
|
84
86
|
fontSize: t.typography.title.fontSize,
|
|
87
|
+
fontFamily: t.fontFamily,
|
|
88
|
+
letterSpacing: t.typography.title.letterSpacing,
|
|
85
89
|
lineHeight: t.typography.title.lineHeight,
|
|
86
90
|
},
|
|
87
91
|
}));
|
package/src/theme/base.ts
CHANGED
|
@@ -116,48 +116,55 @@ export const typography = {
|
|
|
116
116
|
fontSize: 12,
|
|
117
117
|
lineHeight: 16,
|
|
118
118
|
fontWeight: '400',
|
|
119
|
+
letterSpacing: 0.12,
|
|
119
120
|
},
|
|
120
121
|
label: {
|
|
121
122
|
fontSize: 14,
|
|
122
123
|
lineHeight: 20,
|
|
123
124
|
fontWeight: '400',
|
|
125
|
+
letterSpacing: -0.06,
|
|
124
126
|
},
|
|
125
127
|
body: {
|
|
126
128
|
fontSize: 15,
|
|
127
129
|
lineHeight: 22,
|
|
128
130
|
fontWeight: '400',
|
|
131
|
+
letterSpacing: -0.06,
|
|
129
132
|
},
|
|
130
133
|
bodyLg: {
|
|
131
134
|
fontSize: 17,
|
|
132
135
|
lineHeight: 24,
|
|
133
136
|
fontWeight: '400',
|
|
137
|
+
letterSpacing: -0.2,
|
|
134
138
|
},
|
|
135
139
|
eyebrow: {
|
|
136
140
|
fontSize: 13,
|
|
137
141
|
lineHeight: 18,
|
|
138
142
|
fontWeight: '500',
|
|
143
|
+
letterSpacing: 0,
|
|
139
144
|
},
|
|
140
145
|
question: {
|
|
141
146
|
fontSize: 18,
|
|
142
147
|
lineHeight: 26,
|
|
143
148
|
fontWeight: '500',
|
|
144
|
-
letterSpacing: -0.
|
|
149
|
+
letterSpacing: -0.22,
|
|
145
150
|
},
|
|
146
151
|
title: {
|
|
147
152
|
fontSize: 20,
|
|
148
153
|
lineHeight: 28,
|
|
149
154
|
fontWeight: '600',
|
|
155
|
+
letterSpacing: -0.44,
|
|
150
156
|
},
|
|
151
157
|
screenTitle: {
|
|
152
158
|
fontSize: 24,
|
|
153
159
|
lineHeight: 32,
|
|
154
160
|
fontWeight: '600',
|
|
155
|
-
letterSpacing: -0.
|
|
161
|
+
letterSpacing: -0.53,
|
|
156
162
|
},
|
|
157
163
|
display: {
|
|
158
164
|
fontSize: 28,
|
|
159
165
|
lineHeight: 34,
|
|
160
166
|
fontWeight: '600',
|
|
167
|
+
letterSpacing: -0.84,
|
|
161
168
|
},
|
|
162
169
|
} as const;
|
|
163
170
|
|
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
Themes,
|
|
7
7
|
} from '../types';
|
|
8
8
|
import { pickForeground } from '../utils/color';
|
|
9
|
-
import { colors, tokens } from './tokens';
|
|
9
|
+
import { colors, tokens, withFontFamily } from './tokens';
|
|
10
10
|
|
|
11
11
|
type Plain = Record<string, unknown>;
|
|
12
12
|
|
|
@@ -44,7 +44,14 @@ function resolveColors(
|
|
|
44
44
|
|
|
45
45
|
export function createTheme(overrides: ThemeOverrides = {}): Themes {
|
|
46
46
|
const { colors: shared = {}, dark = {}, ...rest } = overrides;
|
|
47
|
-
const
|
|
47
|
+
const merged = merge(tokens, rest);
|
|
48
|
+
const base =
|
|
49
|
+
'fontFamily' in rest
|
|
50
|
+
? {
|
|
51
|
+
...merged,
|
|
52
|
+
typography: withFontFamily(merged.typography, merged.fontFamily),
|
|
53
|
+
}
|
|
54
|
+
: merged;
|
|
48
55
|
const build = (
|
|
49
56
|
scheme: ColorScheme,
|
|
50
57
|
override: Partial<ThemeColors>
|
package/src/theme/tokens.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
ColorScheme,
|
|
4
|
+
ThemeColors,
|
|
5
|
+
ThemeTokens,
|
|
6
|
+
TypographyKey,
|
|
7
|
+
TypographyToken,
|
|
8
|
+
} from '../types';
|
|
3
9
|
import {
|
|
4
10
|
controlSize,
|
|
5
11
|
frame,
|
|
@@ -18,11 +24,39 @@ import {
|
|
|
18
24
|
|
|
19
25
|
export const colors: Record<ColorScheme, ThemeColors> = semantic;
|
|
20
26
|
|
|
27
|
+
export const fontFamily = Platform.select({
|
|
28
|
+
ios: 'Wanted Sans',
|
|
29
|
+
android: 'Wanted Sans',
|
|
30
|
+
default: '"Wanted Sans Variable", "Wanted Sans", sans-serif',
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export function withFontFamily(
|
|
34
|
+
scale: Record<TypographyKey, TypographyToken>,
|
|
35
|
+
family: string | undefined
|
|
36
|
+
): Record<TypographyKey, TypographyToken> {
|
|
37
|
+
return Object.fromEntries(
|
|
38
|
+
Object.entries(scale).map(([key, token]) => [
|
|
39
|
+
key,
|
|
40
|
+
{ ...token, fontFamily: family },
|
|
41
|
+
])
|
|
42
|
+
) as Record<TypographyKey, TypographyToken>;
|
|
43
|
+
}
|
|
44
|
+
|
|
21
45
|
export const tokens: ThemeTokens = {
|
|
22
46
|
space,
|
|
23
47
|
radius,
|
|
24
|
-
typography,
|
|
25
|
-
fontFamily
|
|
48
|
+
typography: withFontFamily(typography, fontFamily),
|
|
49
|
+
fontFamily,
|
|
50
|
+
figure: {
|
|
51
|
+
weight: '500',
|
|
52
|
+
unitScale: 0.88,
|
|
53
|
+
unitGap: 0.03,
|
|
54
|
+
unitWeight: '400',
|
|
55
|
+
unitTracking: 0,
|
|
56
|
+
emphasisWeight: '600',
|
|
57
|
+
emphasisTracking: -0.01,
|
|
58
|
+
emphasisMinSize: 15,
|
|
59
|
+
},
|
|
26
60
|
maxFontScale: 1.3,
|
|
27
61
|
shadow,
|
|
28
62
|
motion,
|
package/src/types/index.ts
CHANGED
|
@@ -14,6 +14,18 @@ export type TypographyToken = {
|
|
|
14
14
|
lineHeight: number;
|
|
15
15
|
fontWeight: TextStyle['fontWeight'];
|
|
16
16
|
letterSpacing?: number;
|
|
17
|
+
fontFamily?: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type FigureTokens = {
|
|
21
|
+
weight: TextStyle['fontWeight'];
|
|
22
|
+
unitScale: number;
|
|
23
|
+
unitGap: number;
|
|
24
|
+
unitWeight: TextStyle['fontWeight'];
|
|
25
|
+
unitTracking: number;
|
|
26
|
+
emphasisWeight: TextStyle['fontWeight'];
|
|
27
|
+
emphasisTracking: number;
|
|
28
|
+
emphasisMinSize: number;
|
|
17
29
|
};
|
|
18
30
|
|
|
19
31
|
export type ThemeTokens = {
|
|
@@ -21,6 +33,7 @@ export type ThemeTokens = {
|
|
|
21
33
|
radius: { sm: number; md: number; lg: number; xl: number; full: number };
|
|
22
34
|
typography: Record<TypographyKey, TypographyToken>;
|
|
23
35
|
fontFamily: string | undefined;
|
|
36
|
+
figure: FigureTokens;
|
|
24
37
|
maxFontScale: number;
|
|
25
38
|
shadow: {
|
|
26
39
|
sm: string;
|