@monimesl/dot-cli 1.0.0-beta.11 → 1.0.0-beta.13

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.
@@ -60,21 +60,36 @@ export default defineDot({
60
60
  // shape: 'rounded',
61
61
  // density: 'compact',
62
62
  // elevation: 'raised',
63
- // components: { Button: { size: 'large' }, View: { variants: { card: { border: 'none' } } } },
64
63
  // The showcase's own colours, used by name on the Styles page, and the Page colours swatches.
65
64
  colors: {
66
65
  custom: {
67
66
  gold: { light: '#f5c542', dark: '#d4a72c' },
67
+ // The outline of what isn't chosen, on the Styles page.
68
+ line: { light: '#d9d9de', dark: '#3a3a3c' },
69
+ // Gold's text colour, which reads on the page where gold wouldn't.
70
+ bronze: { light: '#8a6100', dark: '#d4a72c' },
68
71
  // Dark text that reads on gold in both light and dark.
69
72
  ink: { light: '#1c1c1e', dark: '#1c1c1e' },
73
+ // Light text that reads on ink in both light and dark.
74
+ paper: { light: '#ffffff', dark: '#ffffff' },
70
75
  amber: { light: '#e8952a', dark: '#f0a63a' },
71
76
  ...swatchColors(),
72
77
  },
73
78
  },
74
79
  // The showcase's own icon, an SVG in statics/, used by name like Dot's icons.
75
80
  icons: { 'ticket-stub': 'statics/icons/ticket-stub.svg' },
76
- // A gradient between two of the theme's colours, for a View's background.
77
- gradients: { goldenHour: { from: 'gold', to: 'amber', direction: 'diagonal' } },
81
+ // Gradients between two of the theme's colours, for a View's background.
82
+ gradients: {
83
+ goldenHour: { from: 'gold', to: 'amber', direction: 'diagonal' },
84
+ shade: { from: 'transparent', to: 'ink' },
85
+ },
86
+ // Default props for components, and the showcase's own variants, used on the Theme page.
87
+ components: {
88
+ // Button: { size: 'large' },
89
+ Button: { variants: { quiet: { variant: 'ghost', size: 'small' } } },
90
+ Text: { variants: { label: { variant: 'caption', weight: 'bold', tone: 'muted' } } },
91
+ View: { variants: { ticket: { variant: 'card', borderTone: 'gold', elevation: 'low' } } },
92
+ },
78
93
  },
79
94
  // logger() writes each page load, event, navigation and state change to the console.
80
95
  plugins: [logger()],
@@ -34,11 +34,17 @@
34
34
  <View gap="small">
35
35
  <Text variant="subtitle">components</Text>
36
36
  <Text variant="caption" tone="muted">Default props for every use of a component, or for one of its variants, so a dot sets its look once. Button: { size: "large" } makes every Button large. View: { variants: { card: { elevation: "low" } } } gives only cards a shadow. A prop in the markup still wins.</Text>
37
+ <Text variant="caption" tone="muted">View, Text and Button can have variants of the dot's own too, such as ticket, label and quiet here. Set variant in one to start from a variant the component has, as ticket starts from card.</Text>
38
+ <View variant="ticket" gap="small">
39
+ <Text variant="label" caps>Your seat</Text>
40
+ <Text weight="medium">Salone Sounds Live, Freetown</Text>
41
+ <Button variant="quiet">Change seat</Button>
42
+ </View>
37
43
  </View>
38
44
 
39
45
  <View gap="small">
40
46
  <Text variant="subtitle">icons and gradients</Text>
41
- <Text variant="caption" tone="muted">icons names SVGs in statics/, such as ticket-stub here. They work wherever Dot's icons do, and take the icon's tone. The build refuses an SVG with scripts or links, so export it from your design tool as plain shapes. gradients names a gradient between two of the theme's colours, for a View's background, such as goldenHour.</Text>
47
+ <Text variant="caption" tone="muted">icons names SVGs in statics/, such as ticket-stub here. They work wherever Dot's icons do, and take the icon's tone. The build refuses an SVG with scripts or links, so export it from your design tool as plain shapes. gradients names a gradient between two of the theme's colours, for a View's background, such as goldenHour. An end can be transparent, so it fades out behind words on a picture, as shade does here.</Text>
42
48
  <View background="goldenHour" radius="large" padding="large" gap="small">
43
49
  <View direction="row" align="center" gap="small">
44
50
  <Icon name="ticket-stub" tone="ink" />
@@ -46,5 +52,11 @@
46
52
  </View>
47
53
  <Text variant="title" tone="ink">2 tickets</Text>
48
54
  </View>
55
+ <Stack radius="large" aspect="16:9">
56
+ <View background="goldenHour" />
57
+ <View background="shade" justify="end" padding="large">
58
+ <Text variant="subtitle" tone="paper">Bureh Beach at sunset</Text>
59
+ </View>
60
+ </Stack>
49
61
  </View>
50
62
  </View>
@@ -3,4 +3,8 @@ import state from './state';
3
3
  export default definePage({
4
4
  initialState: state,
5
5
  configs: { navigationBar: { title: 'Styles' } },
6
+ mutations: {
7
+ chooseSeat: (_state, event: DataEvent<{ seat: string }>) => ({ seat: event.data.seat }),
8
+ toggleAppeared: (state) => ({ appeared: !state.appeared }),
9
+ },
6
10
  });
@@ -1,3 +1,5 @@
1
1
  export default {
2
2
  balance: 'SLE 1,250.00',
3
+ seat: 'regular',
4
+ appeared: false,
3
5
  };
@@ -40,12 +40,12 @@
40
40
 
41
41
  <View gap="small">
42
42
  <Text variant="subtitle">The dot's own colours</Text>
43
- <Text variant="caption" tone="muted">The theme in dot.ts can name its own colours, such as gold and ink here. Use them as a background or a text tone. The Theme page has the rest of the theme.</Text>
43
+ <Text variant="caption" tone="muted">The theme in dot.ts can name its own colours, such as gold, ink and bronze here. Use them as a background or a text tone. The Theme page has the rest of the theme.</Text>
44
44
  <View direction="row" gap="small" align="center">
45
45
  <View background="gold" radius="full" paddingTop="small" paddingBottom="small" paddingStart="medium" paddingEnd="medium">
46
46
  <Text weight="medium" tone="ink">Gold member</Text>
47
47
  </View>
48
- <Text tone="gold" weight="bold">Since 2024</Text>
48
+ <Text tone="bronze" weight="bold">Since 2024</Text>
49
49
  </View>
50
50
  </View>
51
51
 
@@ -63,6 +63,67 @@
63
63
  </View>
64
64
  </View>
65
65
 
66
+ <View gap="small">
67
+ <Text variant="subtitle">borderTone</Text>
68
+ <Text variant="caption" tone="muted">Colours the outline with a colour of the theme or one of the dot's own, such as to mark what's chosen.</Text>
69
+ <View direction="row" gap="small">
70
+ <View grow variant="card" align="center" borderTone="{{ seat === 'regular' ? 'primary' : 'line' }}" data-seat="regular" onTap="chooseSeat">
71
+ <Text weight="medium">Regular</Text>
72
+ <Text variant="caption" tone="muted" numeric>SLE 120</Text>
73
+ </View>
74
+ <View grow variant="card" align="center" borderTone="{{ seat === 'front' ? 'primary' : 'line' }}" data-seat="front" onTap="chooseSeat">
75
+ <Text weight="medium">Front row</Text>
76
+ <Text variant="caption" tone="muted" numeric>SLE 300</Text>
77
+ </View>
78
+ </View>
79
+ </View>
80
+
81
+ <View gap="small">
82
+ <Text variant="subtitle">corners</Text>
83
+ <Text variant="caption" tone="muted">Rounds only the top or the bottom of a box, so two boxes can join into one.</Text>
84
+ <View gap="none">
85
+ <View background="primary" radius="large" corners="top" padding="medium">
86
+ <Text tone="onPrimary" weight="bold">Freetown to Bo</Text>
87
+ </View>
88
+ <View background="muted" radius="large" corners="bottom" padding="medium">
89
+ <Text>Leaves Cotton Tree at 7 am</Text>
90
+ </View>
91
+ </View>
92
+ </View>
93
+
94
+ <View gap="small">
95
+ <Text variant="subtitle">opacity</Text>
96
+ <Text variant="caption" tone="muted">Lets what's behind a View show through it: full, soft or faint.</Text>
97
+ <Stack radius="large" height="88">
98
+ <View background="goldenHour" />
99
+ <View direction="row" gap="small" padding="medium">
100
+ <View grow background="surface" radius="medium" opacity="full" justify="center" align="center">
101
+ <Text>full</Text>
102
+ </View>
103
+ <View grow background="surface" radius="medium" opacity="soft" justify="center" align="center">
104
+ <Text>soft</Text>
105
+ </View>
106
+ <View grow background="surface" radius="medium" opacity="faint" justify="center" align="center">
107
+ <Text>faint</Text>
108
+ </View>
109
+ </View>
110
+ </Stack>
111
+ </View>
112
+
113
+ <View gap="small">
114
+ <Text variant="subtitle">enter</Text>
115
+ <Text variant="caption" tone="muted">How a View comes in when it appears, such as inside an If or when hidden turns off: fade or rise. Phones set to reduce motion skip it.</Text>
116
+ <Button variant="secondary" onClick="toggleAppeared">{{ appeared ? 'Hide them' : 'Show them' }}</Button>
117
+ <If condition="{{ appeared }}">
118
+ <View variant="card" enter="fade">
119
+ <Text>enter="fade", inside an If</Text>
120
+ </View>
121
+ </If>
122
+ <View variant="card" enter="rise" hidden="{{ !appeared }}">
123
+ <Text>enter="rise", with hidden</Text>
124
+ </View>
125
+ </View>
126
+
66
127
  <View gap="small">
67
128
  <Text variant="subtitle">elevation</Text>
68
129
  <Text variant="caption" tone="muted">A shadow lifts a box off the page. low suits a card, and high something that floats over others.</Text>
@@ -78,7 +139,7 @@
78
139
 
79
140
  <View gap="small">
80
141
  <Text variant="subtitle">Buttons</Text>
81
- <Text variant="caption" tone="muted">variant is primary, secondary, outline or ghost. tone colours a button, such as danger for one that deletes. size is small, medium or large.</Text>
142
+ <Text variant="caption" tone="muted">variant is primary, secondary, outline or ghost. tone colours a button, such as danger for one that deletes. size is small, medium or large. Anything that can be tapped dims under the finger by itself.</Text>
82
143
  <View direction="row" gap="small" wrap>
83
144
  <Button>Primary</Button>
84
145
  <Button variant="secondary">Secondary</Button>
@@ -27,13 +27,14 @@
27
27
  </View>
28
28
 
29
29
  <View gap="small">
30
- <Text variant="subtitle">weight, italic and decoration</Text>
30
+ <Text variant="subtitle">weight, italic, caps and decoration</Text>
31
31
  <View variant="card" gap="small">
32
32
  <View direction="row" wrap gap="medium">
33
33
  <Text weight="regular">regular</Text>
34
34
  <Text weight="medium">medium</Text>
35
35
  <Text weight="bold">bold</Text>
36
36
  <Text italic>italic</Text>
37
+ <Text caps>caps</Text>
37
38
  </View>
38
39
  <View direction="row" wrap gap="medium">
39
40
  <Text decoration="underline">underline</Text>
@@ -70,7 +70,7 @@ export default {
70
70
  {
71
71
  page: 'basics/theme',
72
72
  title: 'Theme',
73
- covers: 'colors, shape, density, elevation, fonts, components, icons, gradients',
73
+ covers: 'colors, shape, density, elevation, fonts, own variants, icons, gradients',
74
74
  icon: 'eye',
75
75
  },
76
76
  {
@@ -94,7 +94,7 @@ export default {
94
94
  {
95
95
  page: 'components/styles',
96
96
  title: 'Styles',
97
- covers: 'background, border, radius, sizes, elevation, buttons, own colours',
97
+ covers: 'background, border, corners, opacity, enter, sizes, elevation, buttons',
98
98
  icon: 'star',
99
99
  },
100
100
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monimesl/dot-cli",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.13",
4
4
  "description": "The dotctl command: build mini apps and run them in the simulator",
5
5
  "type": "module",
6
6
  "repository": {
@@ -24,11 +24,11 @@
24
24
  "dependencies": {
25
25
  "typescript": "^5.9.3",
26
26
  "uqr": "^0.1.3",
27
- "@monimesl/dot-compiler": "1.0.0-beta.11",
28
- "@monimesl/dot-core": "1.0.0-beta.11",
29
- "@monimesl/dot-dml-parser": "1.0.0-beta.11",
30
- "@monimesl/dot-script-parser": "1.0.0-beta.11",
31
- "@monimesl/dot-simulator": "1.0.0-beta.11"
27
+ "@monimesl/dot-compiler": "1.0.0-beta.13",
28
+ "@monimesl/dot-core": "1.0.0-beta.13",
29
+ "@monimesl/dot-dml-parser": "1.0.0-beta.13",
30
+ "@monimesl/dot-script-parser": "1.0.0-beta.13",
31
+ "@monimesl/dot-simulator": "1.0.0-beta.13"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^22.20.4",