@maccesar/titools 2.0.7 → 2.2.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/{AGENTS-TEMPLATE.md → AGENTS-VERCEL-RESEARCH.md} +16 -18
- package/README.md +250 -168
- package/agents/{ti-researcher.md → ti-pro.md} +10 -10
- package/bin/titools.js +16 -12
- package/lib/cleanup.js +95 -0
- package/lib/commands/agents.js +146 -70
- package/lib/commands/skills.js +349 -0
- package/lib/commands/uninstall.js +189 -154
- package/lib/commands/update.js +104 -21
- package/lib/config.js +26 -20
- package/lib/downloader.js +1 -1
- package/lib/installer.js +37 -97
- package/lib/platform.js +9 -5
- package/lib/prompts/checkboxCancel.js +264 -0
- package/lib/prompts/selectCancel.js +204 -0
- package/lib/symlink.js +19 -7
- package/lib/utils.js +17 -17
- package/package.json +10 -10
- package/skills/alloy-guides/SKILL.md +8 -30
- package/skills/alloy-guides/references/CLI_TASKS.md +14 -24
- package/skills/alloy-guides/references/CONCEPTS.md +5 -25
- package/skills/alloy-guides/references/CONTROLLERS.md +2 -19
- package/skills/alloy-guides/references/MODELS.md +40 -10
- package/skills/alloy-guides/references/PURGETSS.md +1 -11
- package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +8 -14
- package/skills/alloy-guides/references/VIEWS_STYLES.md +14 -25
- package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +2 -8
- package/skills/alloy-guides/references/VIEWS_XML.md +29 -40
- package/skills/alloy-guides/references/WIDGETS.md +1 -17
- package/skills/alloy-howtos/SKILL.md +1 -22
- package/skills/alloy-howtos/references/best_practices.md +0 -17
- package/skills/alloy-howtos/references/cli_reference.md +1 -23
- package/skills/alloy-howtos/references/config_files.md +86 -15
- package/skills/alloy-howtos/references/custom_tags.md +14 -13
- package/skills/alloy-howtos/references/debugging_troubleshooting.md +3 -22
- package/skills/alloy-howtos/references/samples.md +4 -14
- package/skills/purgetss/SKILL.md +11 -37
- package/skills/purgetss/references/EXAMPLES.md +106 -17
- package/skills/purgetss/references/animation-system.md +0 -67
- package/skills/purgetss/references/apply-directive.md +0 -18
- package/skills/purgetss/references/arbitrary-values.md +0 -25
- package/skills/purgetss/references/class-index.md +0 -46
- package/skills/purgetss/references/cli-commands.md +0 -41
- package/skills/purgetss/references/configurable-properties.md +0 -55
- package/skills/purgetss/references/custom-rules.md +0 -14
- package/skills/purgetss/references/customization-deep-dive.md +0 -49
- package/skills/purgetss/references/dynamic-component-creation.md +56 -37
- package/skills/purgetss/references/grid-layout.md +0 -32
- package/skills/purgetss/references/icon-fonts.md +0 -50
- package/skills/purgetss/references/installation-setup.md +61 -32
- package/skills/purgetss/references/migration-guide.md +127 -0
- package/skills/purgetss/references/opacity-modifier.md +0 -34
- package/skills/purgetss/references/performance-tips.md +261 -0
- package/skills/purgetss/references/platform-modifiers.md +0 -46
- package/skills/purgetss/references/smart-mappings.md +0 -12
- package/skills/purgetss/references/tikit-components.md +393 -0
- package/skills/purgetss/references/titanium-resets.md +1 -27
- package/skills/purgetss/references/ui-ux-design.md +467 -117
- package/skills/{alloy-expert → ti-expert}/SKILL.md +45 -54
- package/skills/ti-expert/references/alloy-builtins.md +387 -0
- package/skills/{alloy-expert → ti-expert}/references/alloy-structure.md +147 -40
- package/skills/ti-expert/references/anti-patterns.md +90 -0
- package/skills/ti-expert/references/cli-expert.md +109 -0
- package/skills/{alloy-expert → ti-expert}/references/code-conventions.md +182 -49
- package/skills/{alloy-expert → ti-expert}/references/controller-patterns.md +103 -93
- package/skills/{alloy-expert → ti-expert}/references/error-handling.md +12 -12
- package/skills/{alloy-expert → ti-expert}/references/examples.md +144 -85
- package/skills/{alloy-expert → ti-expert}/references/migration-patterns.md +38 -36
- package/skills/{alloy-expert → ti-expert}/references/patterns.md +8 -8
- package/skills/ti-expert/references/performance-listview.md +251 -0
- package/skills/{alloy-expert/references/performance-patterns.md → ti-expert/references/performance-optimization.md} +67 -283
- package/skills/{alloy-expert/references/security-patterns.md → ti-expert/references/security-device.md} +12 -295
- package/skills/ti-expert/references/security-fundamentals.md +284 -0
- package/skills/{alloy-expert → ti-expert}/references/state-management.md +10 -10
- package/skills/ti-expert/references/testing-e2e-ci.md +432 -0
- package/skills/ti-expert/references/testing-unit.md +433 -0
- package/skills/ti-expert/references/theming.md +394 -0
- package/skills/ti-guides/SKILL.md +1 -14
- package/skills/ti-guides/references/advanced-data-and-images.md +126 -10
- package/skills/ti-guides/references/app-distribution.md +48 -10
- package/skills/ti-guides/references/application-frameworks.md +9 -2
- package/skills/ti-guides/references/cli-reference.md +338 -82
- package/skills/ti-guides/references/coding-best-practices.md +14 -4
- package/skills/ti-guides/references/commonjs-advanced.md +103 -6
- package/skills/ti-guides/references/hello-world.md +5 -2
- package/skills/ti-guides/references/hyperloop-native-access.md +439 -46
- package/skills/ti-guides/references/javascript-primer.md +4 -3
- package/skills/ti-guides/references/resources.md +0 -1
- package/skills/ti-guides/references/style-and-conventions.md +57 -9
- package/skills/ti-guides/references/tiapp-config.md +48 -6
- package/skills/ti-howtos/SKILL.md +2 -27
- package/skills/ti-howtos/references/android-platform-deep-dives.md +41 -90
- package/skills/ti-howtos/references/automation-fastlane-appium.md +15 -14
- package/skills/ti-howtos/references/buffer-codec-streams.md +22 -22
- package/skills/ti-howtos/references/cross-platform-development.md +68 -37
- package/skills/ti-howtos/references/debugging-profiling.md +8 -53
- package/skills/ti-howtos/references/extending-titanium.md +12 -51
- package/skills/ti-howtos/references/google-maps-v2.md +30 -29
- package/skills/ti-howtos/references/ios-map-kit.md +19 -25
- package/skills/ti-howtos/references/ios-platform-deep-dives.md +95 -283
- package/skills/ti-howtos/references/local-data-sources.md +45 -37
- package/skills/ti-howtos/references/location-and-maps.md +47 -28
- package/skills/ti-howtos/references/media-apis.md +84 -27
- package/skills/ti-howtos/references/notification-services.md +40 -89
- package/skills/ti-howtos/references/remote-data-sources.md +21 -36
- package/skills/ti-howtos/references/tutorials.md +79 -39
- package/skills/ti-howtos/references/using-modules.md +4 -30
- package/skills/ti-howtos/references/web-content-integration.md +28 -45
- package/skills/ti-howtos/references/webpack-build-pipeline.md +54 -18
- package/skills/ti-ui/SKILL.md +1 -21
- package/skills/ti-ui/references/accessibility-deep-dive.md +71 -25
- package/skills/ti-ui/references/animation-and-matrices.md +0 -47
- package/skills/ti-ui/references/application-structures.md +0 -46
- package/skills/ti-ui/references/custom-fonts-styling.md +9 -57
- package/skills/ti-ui/references/event-handling.md +32 -40
- package/skills/ti-ui/references/gestures.md +0 -40
- package/skills/ti-ui/references/icons-and-splash-screens.md +21 -44
- package/skills/ti-ui/references/layouts-and-positioning.md +47 -39
- package/skills/ti-ui/references/listviews-and-performance.md +187 -73
- package/skills/ti-ui/references/orientation.md +57 -71
- package/skills/ti-ui/references/platform-ui-android.md +114 -48
- package/skills/ti-ui/references/platform-ui-ios.md +63 -38
- package/skills/ti-ui/references/scrolling-views.md +14 -23
- package/skills/ti-ui/references/tableviews.md +6 -56
- package/lib/commands/install.js +0 -188
- package/skills/alloy-expert/references/anti-patterns.md +0 -133
- package/skills/alloy-expert/references/testing.md +0 -872
- package/skills/ti-guides/references/alloy-cli-advanced.md +0 -84
- package/skills/ti-guides/references/alloy-data-mastery.md +0 -29
- package/skills/ti-guides/references/alloy-widgets-and-themes.md +0 -19
- /package/skills/{alloy-expert → ti-expert}/assets/ControllerAutoCleanup.js +0 -0
- /package/skills/{alloy-expert → ti-expert}/references/contracts.md +0 -0
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
# TiKit UI Components
|
|
2
|
+
|
|
3
|
+
TiKit is a collection of ready-to-use UI components built with Alloy and PurgeTSS for creating polished mobile interfaces quickly.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install TiKit CLI globally
|
|
9
|
+
npm install -g tikit
|
|
10
|
+
|
|
11
|
+
# Make sure PurgeTSS is also installed
|
|
12
|
+
npm install -g purgetss
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Setting Up a Project
|
|
16
|
+
|
|
17
|
+
1. Create a PurgeTSS project (if not already):
|
|
18
|
+
```bash
|
|
19
|
+
purgetss create myApp
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
2. Install TiKit components:
|
|
23
|
+
```bash
|
|
24
|
+
cd myApp
|
|
25
|
+
tikit install
|
|
26
|
+
# Choose: all components, alerts, avatars, buttons, cards
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Component Defaults
|
|
30
|
+
|
|
31
|
+
TiKit components work out of the box with sensible defaults — you only need to provide what's unique:
|
|
32
|
+
|
|
33
|
+
| Component | Property | Default Value | Description |
|
|
34
|
+
| ----------- | --------- | ------------------------------------------------------------------------------ | ---------------------------- |
|
|
35
|
+
| **Alerts** | `color` | `"dark"` | The alert's color scheme |
|
|
36
|
+
| | `variant` | `"pop"` (with text) or `"solid"` (without text) | The alert's visual style |
|
|
37
|
+
| **Avatars** | `size` | `"base"` | The avatar's size |
|
|
38
|
+
| | `variant` | `"chip"` (with name) or `"square"` (without name) | The avatar's shape and style |
|
|
39
|
+
| **Buttons** | `size` | `"base"` | The button's size |
|
|
40
|
+
| | `variant` | `"icon-left"` (with icon) or `"filled"` (without icon) | The button's visual style |
|
|
41
|
+
| **Cards** | `color` | `"dark"` | The card's color scheme |
|
|
42
|
+
| | `variant` | `"showcase"` (with image) or `"content"` (with subtitle) or `"code"` (default) | The card's layout style |
|
|
43
|
+
|
|
44
|
+
```xml
|
|
45
|
+
<!-- Uses variant="pop", color="dark" by default -->
|
|
46
|
+
<Alert module="tikit.ui" title="Simple Alert" text="With default values" />
|
|
47
|
+
|
|
48
|
+
<!-- Uses variant="square", size="base" by default -->
|
|
49
|
+
<Avatar module="tikit.ui" image="path/to/image.jpg" />
|
|
50
|
+
|
|
51
|
+
<!-- Uses variant="filled", size="base" by default -->
|
|
52
|
+
<Button module="tikit.ui" title="Default Button" />
|
|
53
|
+
|
|
54
|
+
<!-- Uses variant="code", color="dark" by default -->
|
|
55
|
+
<Card module="tikit.ui" title="Simple Card" text="Using defaults" />
|
|
56
|
+
|
|
57
|
+
<!-- Uses variant="content" when subtitle is provided -->
|
|
58
|
+
<Card module="tikit.ui" title="Card" subtitle="Important info" text="Details" />
|
|
59
|
+
|
|
60
|
+
<!-- Uses variant="showcase" when image is provided -->
|
|
61
|
+
<Card module="tikit.ui" title="Image Card" text="Description" image="path/to/image.jpg" />
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Alerts
|
|
67
|
+
|
|
68
|
+
> **Common Properties:** `variant`, `color`, `classes`, `title`, `text`
|
|
69
|
+
|
|
70
|
+
Short, important messages without interrupting the user.
|
|
71
|
+
|
|
72
|
+
### Variants
|
|
73
|
+
|
|
74
|
+
- `callout` — Simple message with title and text
|
|
75
|
+
- `pop` — Includes an icon alongside the title and text
|
|
76
|
+
- `solid` — Full-width banner style, usually with just a title and icon
|
|
77
|
+
|
|
78
|
+
### Colors
|
|
79
|
+
|
|
80
|
+
`success`, `danger`, `warning`, `info`, `dark`, `light`
|
|
81
|
+
|
|
82
|
+
You can also define `primary` and `secondary` custom colors:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
purgetss shades '#yourHexCode1' primary
|
|
86
|
+
purgetss shades '#yourHexCode2' secondary
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Extra Controls
|
|
90
|
+
|
|
91
|
+
- `delay` (milliseconds) — Wait before showing the alert
|
|
92
|
+
- `duration` (milliseconds) — Control animation speed
|
|
93
|
+
- `dismissible` (boolean) — Let users tap to close
|
|
94
|
+
|
|
95
|
+
### Examples
|
|
96
|
+
|
|
97
|
+
```xml
|
|
98
|
+
<!-- Callout -->
|
|
99
|
+
<Alert module="tikit.ui" variant="callout" color="success" title="Success!" text="Your changes have been saved." />
|
|
100
|
+
|
|
101
|
+
<!-- Pop with custom icon -->
|
|
102
|
+
<Alert module="tikit.ui" variant="pop" color="primary" title="Action Required" text="Please review." icon="mi mi-pending_actions text-3xl" />
|
|
103
|
+
|
|
104
|
+
<!-- Solid banner -->
|
|
105
|
+
<Alert module="tikit.ui" variant="solid" color="warning" title="Maintenance Soon" icon="mi mi-warning text-2xl" />
|
|
106
|
+
|
|
107
|
+
<!-- Dismissible -->
|
|
108
|
+
<Alert module="tikit.ui" variant="pop" color="info" delay="500" dismissible="true" title="FYI" text="Tap to close." />
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Avatars
|
|
114
|
+
|
|
115
|
+
> **Common Properties:** `variant`, `size`, `classes`, `image`
|
|
116
|
+
|
|
117
|
+
Visual representations of users or objects.
|
|
118
|
+
|
|
119
|
+
### Variants
|
|
120
|
+
|
|
121
|
+
- `chip` — Image with a name label next to it
|
|
122
|
+
- `circular` — Standard round avatar
|
|
123
|
+
- `landscape` — Rectangular, wider than tall
|
|
124
|
+
- `portrait` — Rectangular, taller than wide
|
|
125
|
+
- `square` — Simple square avatar
|
|
126
|
+
- `stacked` — Designed to overlap in a horizontal group
|
|
127
|
+
|
|
128
|
+
### Sizes
|
|
129
|
+
|
|
130
|
+
`xs`, `sm`, `base`, `lg`, `xl`, `2xl`
|
|
131
|
+
|
|
132
|
+
### Examples
|
|
133
|
+
|
|
134
|
+
```xml
|
|
135
|
+
<!-- Chip with custom colors -->
|
|
136
|
+
<Avatar module="tikit.ui" variant="chip" size="base" name="Jane Doe"
|
|
137
|
+
image="https://randomuser.me/api/portraits/women/86.jpg"
|
|
138
|
+
classes="bg-blue-100 text-blue-800" />
|
|
139
|
+
|
|
140
|
+
<!-- Circular with border -->
|
|
141
|
+
<Avatar module="tikit.ui" variant="circular" size="base" border="true"
|
|
142
|
+
image="https://randomuser.me/api/portraits/men/86.jpg"
|
|
143
|
+
classes="border-gray-300" />
|
|
144
|
+
|
|
145
|
+
<!-- Portrait with custom border color -->
|
|
146
|
+
<Avatar module="tikit.ui" variant="portrait" size="base"
|
|
147
|
+
image="https://randomuser.me/api/portraits/men/87.jpg"
|
|
148
|
+
classes="border-green-500" />
|
|
149
|
+
|
|
150
|
+
<!-- Stacked avatars (use last="true" on the final one) -->
|
|
151
|
+
<View class="horizontal">
|
|
152
|
+
<Avatar module="tikit.ui" variant="stacked" size="base" image="img1.jpg" />
|
|
153
|
+
<Avatar module="tikit.ui" variant="stacked" size="base" image="img2.jpg" />
|
|
154
|
+
<Avatar module="tikit.ui" variant="stacked" size="base" last="true" image="img3.jpg" />
|
|
155
|
+
</View>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Variant-Specific Properties
|
|
159
|
+
|
|
160
|
+
| Variant | Properties | Notes |
|
|
161
|
+
| ----------- | ------------------------------------ | ------------------------------------------- |
|
|
162
|
+
| `chip` | `name`, `image` | Default gray bg/text, override with classes |
|
|
163
|
+
| `circular` | `name` (optional), `image`, `border` | `border="true"` adds white border |
|
|
164
|
+
| `square` | `name` (optional), `image`, `border` | Same as circular but square |
|
|
165
|
+
| `portrait` | `name` (optional), `image` | Default gray border, override with classes |
|
|
166
|
+
| `landscape` | `name` (optional), `image` | Default gray border, override with classes |
|
|
167
|
+
| `stacked` | `image`, `last` | Use inside `horizontal` View |
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Buttons
|
|
172
|
+
|
|
173
|
+
> **Common Properties:** `variant`, `size`, `classes`, `title`
|
|
174
|
+
|
|
175
|
+
### Variants
|
|
176
|
+
|
|
177
|
+
- `border` — Text with an outline border
|
|
178
|
+
- `border-rounded` — Like `border` with rounded corners
|
|
179
|
+
- `filled` — Solid background color with text
|
|
180
|
+
- `filled-rounded` — Like `filled` with rounded corners
|
|
181
|
+
- `icon-left` — Icon on the left, text on the right
|
|
182
|
+
- `icon-right` — Text on the left, icon on the right
|
|
183
|
+
|
|
184
|
+
### Sizes
|
|
185
|
+
|
|
186
|
+
`xs`, `sm`, `base`, `lg`, `xl`, `2xl`
|
|
187
|
+
|
|
188
|
+
### Examples
|
|
189
|
+
|
|
190
|
+
```xml
|
|
191
|
+
<!-- Border button -->
|
|
192
|
+
<Button module="tikit.ui" variant="border" size="base" title="Cancel"
|
|
193
|
+
classes="border-red-500 text-red-500" />
|
|
194
|
+
|
|
195
|
+
<!-- Filled rounded -->
|
|
196
|
+
<Button module="tikit.ui" variant="filled-rounded" size="base" title="Confirm"
|
|
197
|
+
classes="bg-green-600 text-white" />
|
|
198
|
+
|
|
199
|
+
<!-- Icon left -->
|
|
200
|
+
<Button module="tikit.ui" variant="icon-left" size="base" title="Save"
|
|
201
|
+
icon="fa fa-save text-white" classes="bg-blue-500 text-white" />
|
|
202
|
+
|
|
203
|
+
<!-- Icon right with Material Icon -->
|
|
204
|
+
<Button module="tikit.ui" variant="icon-right" size="lg" title="Settings"
|
|
205
|
+
icon="mi mi-settings text-lg text-gray-100"
|
|
206
|
+
classes="bg-gray-700 text-gray-100" />
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Cards
|
|
212
|
+
|
|
213
|
+
> **Common Properties:** `variant`, `color`, `classes`
|
|
214
|
+
|
|
215
|
+
### Variants
|
|
216
|
+
|
|
217
|
+
- `code` — Display code snippets with optional copy button
|
|
218
|
+
- `content` — Text with title, subtitle, and body
|
|
219
|
+
- `quote` — Quotation with attribution
|
|
220
|
+
- `showcase` — Image with title and description
|
|
221
|
+
|
|
222
|
+
### Colors
|
|
223
|
+
|
|
224
|
+
`black`, `dark`, `light`, `white`
|
|
225
|
+
|
|
226
|
+
### Examples
|
|
227
|
+
|
|
228
|
+
```xml
|
|
229
|
+
<!-- Code card with copy button -->
|
|
230
|
+
<Card module="tikit.ui" variant="code" color="dark" copy="true"
|
|
231
|
+
title="Example" text="function hello() { console.log('Hi!'); }" />
|
|
232
|
+
|
|
233
|
+
<!-- Showcase card -->
|
|
234
|
+
<Card module="tikit.ui" variant="showcase" color="black"
|
|
235
|
+
title="Project X" text="Mobile app design concept."
|
|
236
|
+
image="images/showcase/project-x.jpg" />
|
|
237
|
+
|
|
238
|
+
<!-- Quote card -->
|
|
239
|
+
<Card module="tikit.ui" variant="quote" color="white"
|
|
240
|
+
name="Jane Austen" text="There is no charm equal to tenderness of heart." />
|
|
241
|
+
|
|
242
|
+
<!-- Content card -->
|
|
243
|
+
<Card module="tikit.ui" variant="content" color="light"
|
|
244
|
+
title="About TiKit" subtitle="Making UI Easier"
|
|
245
|
+
text="TiKit provides useful components..." />
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Variant-Specific Properties
|
|
249
|
+
|
|
250
|
+
| Variant | Properties | Notes |
|
|
251
|
+
| ---------- | ----------------------------------------- | -------------------------------------------------------- |
|
|
252
|
+
| `code` | `title`, `text`, `copy` (boolean) | Install monospaced font for best results |
|
|
253
|
+
| `showcase` | `title`, `text`, `image`, `rounded` (int) | `rounded=0` for sharp, higher values for rounded corners |
|
|
254
|
+
| `quote` | `name`, `text` | Name is the attribution |
|
|
255
|
+
| `content` | `title`, `subtitle`, `text` | Clear hierarchy: large title, highlighted subtitle, body |
|
|
256
|
+
|
|
257
|
+
:::tip Code Card Localization
|
|
258
|
+
The copy button uses `L('copy', 'Copy')` for its title and `L('code_copied', 'Code copied!')` for confirmation. Add these keys to `strings.xml` for translation.
|
|
259
|
+
:::
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Tabs
|
|
264
|
+
|
|
265
|
+
> **Properties:** `title`, `icon`, `activeIcon` (iOS only) + standard `Titanium.UI.Tab` properties
|
|
266
|
+
|
|
267
|
+
TiKit tabs make it easy to add icon-based tabs using any loaded font library.
|
|
268
|
+
|
|
269
|
+
```xml
|
|
270
|
+
<Tab module="tikit.ui" title="Home" icon="fa fa-home" activeIcon="fas fa-home">
|
|
271
|
+
<Require src="home_window" />
|
|
272
|
+
</Tab>
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Styling Tabs
|
|
276
|
+
|
|
277
|
+
Since these are `Titanium.UI.Tab` objects, use standard properties and PurgeTSS classes:
|
|
278
|
+
|
|
279
|
+
```xml
|
|
280
|
+
<Tab module="tikit.ui"
|
|
281
|
+
class="active-tint-indigo-600 active-title-indigo-600"
|
|
282
|
+
title="Profile"
|
|
283
|
+
icon="mi mi-person_outline text-3xl"
|
|
284
|
+
activeIcon="mi mi-person text-3xl">
|
|
285
|
+
<Require src="profile_window" />
|
|
286
|
+
</Tab>
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Updating Components Dynamically
|
|
292
|
+
|
|
293
|
+
TiKit components with an `id` can be updated without destroying and recreating them.
|
|
294
|
+
|
|
295
|
+
### Available Update Methods
|
|
296
|
+
|
|
297
|
+
| Method | Description |
|
|
298
|
+
| ------------------------ | ---------------------------------- |
|
|
299
|
+
| `updateTitle(newTitle)` | Changes the main title |
|
|
300
|
+
| `updateSubtitle(newSub)` | Changes the subtitle (Cards) |
|
|
301
|
+
| `updateText(newText)` | Changes the main text content |
|
|
302
|
+
| `updateName(newName)` | Changes the name (Avatar `chip`) |
|
|
303
|
+
| `updateImage(newImage)` | Changes the image (path or blob) |
|
|
304
|
+
| `updateIcon(newIcon)` | Changes the icon class string |
|
|
305
|
+
| `update(args)` | Update multiple properties at once |
|
|
306
|
+
|
|
307
|
+
The `update()` method accepts an object with keys: `title`, `subtitle`, `text`, `name`, `image`, `icon`.
|
|
308
|
+
|
|
309
|
+
### Which Components Support Which Updates
|
|
310
|
+
|
|
311
|
+
| Component | Updatable Properties |
|
|
312
|
+
| ----------- | ---------------------------------------------------------- |
|
|
313
|
+
| **Cards** | `title`, `subtitle`, `text`, `image` |
|
|
314
|
+
| **Avatars** | `image`, `name` (mostly for `chip`) |
|
|
315
|
+
| **Alerts** | `title`, `text`, `icon` (`text` not applicable to `solid`) |
|
|
316
|
+
| **Buttons** | `title`, `icon` (`icon` for `icon-left`/`icon-right`) |
|
|
317
|
+
|
|
318
|
+
### Example
|
|
319
|
+
|
|
320
|
+
```xml
|
|
321
|
+
<!-- View -->
|
|
322
|
+
<Card id="statusCard" module="tikit.ui" variant="content" color="light"
|
|
323
|
+
title="Status" subtitle="Current" text="Waiting for update..." />
|
|
324
|
+
|
|
325
|
+
<Button module="tikit.ui" variant="filled" size="base"
|
|
326
|
+
title="Fetch Status" onClick="fetchStatus"
|
|
327
|
+
classes="mt-4 bg-blue-500 text-white" />
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
```javascript
|
|
331
|
+
// Controller
|
|
332
|
+
function fetchStatus() {
|
|
333
|
+
// Update multiple properties at once
|
|
334
|
+
$.statusCard.update({
|
|
335
|
+
title: 'Status Updated!',
|
|
336
|
+
subtitle: 'Just Now',
|
|
337
|
+
text: 'Everything looks good. System operational.'
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
// Or update individually
|
|
341
|
+
// $.statusCard.updateTitle('Status Updated!');
|
|
342
|
+
// $.statusCard.updateSubtitle('Just Now');
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Using Icon Fonts with TiKit
|
|
349
|
+
|
|
350
|
+
TiKit components accept icon fonts via the `icon` property. Use any font loaded through PurgeTSS.
|
|
351
|
+
|
|
352
|
+
### Official Icon Fonts
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
purgetss icon-library --vendor=fa,mi,ms,f7
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### Custom Icon Fonts
|
|
359
|
+
|
|
360
|
+
1. Place font (`.ttf`/`.otf`) and CSS in `purgetss/fonts/your-font-name/`
|
|
361
|
+
2. Run `purgetss build-fonts`
|
|
362
|
+
3. Use in TiKit components:
|
|
363
|
+
|
|
364
|
+
```xml
|
|
365
|
+
<Button module="tikit.ui" variant="icon-left" title="Launch"
|
|
366
|
+
icon="myicon myicon-rocket text-lg"
|
|
367
|
+
classes="bg-purple-600 text-white" />
|
|
368
|
+
|
|
369
|
+
<Alert module="tikit.ui" variant="pop" color="info"
|
|
370
|
+
title="Update Available"
|
|
371
|
+
icon="myicon myicon-download text-2xl" />
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
## Quick Reference
|
|
375
|
+
|
|
376
|
+
### All Component Variants
|
|
377
|
+
|
|
378
|
+
| Component | Variants |
|
|
379
|
+
| --------- | --------------------------------------------------------------------------------- |
|
|
380
|
+
| Alert | `callout`, `pop`, `solid` |
|
|
381
|
+
| Avatar | `chip`, `circular`, `landscape`, `portrait`, `square`, `stacked` |
|
|
382
|
+
| Button | `border`, `border-rounded`, `filled`, `filled-rounded`, `icon-left`, `icon-right` |
|
|
383
|
+
| Card | `code`, `content`, `quote`, `showcase` |
|
|
384
|
+
| Tab | (single variant, uses standard Tab properties) |
|
|
385
|
+
|
|
386
|
+
### Size Scale (Avatars & Buttons)
|
|
387
|
+
|
|
388
|
+
`xs` → `sm` → `base` → `lg` → `xl` → `2xl`
|
|
389
|
+
|
|
390
|
+
### Color Schemes
|
|
391
|
+
|
|
392
|
+
- **Alerts**: `success`, `danger`, `warning`, `info`, `dark`, `light` (+ custom `primary`, `secondary`)
|
|
393
|
+
- **Cards**: `black`, `dark`, `light`, `white`
|
|
@@ -2,32 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
PurgeTSS automatically resets certain Titanium elements to facilitate UI layout. Understanding these resets is critical for effective PurgeTSS usage.
|
|
4
4
|
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
- [Titanium Element Resets](#titanium-element-resets)
|
|
8
|
-
- [Table of Contents](#table-of-contents)
|
|
9
|
-
- [The Three Default Resets](#the-three-default-resets)
|
|
10
|
-
- [View Reset: `Ti.UI.SIZE`](#view-reset-tiuisize)
|
|
11
|
-
- [What `Ti.UI.SIZE` Means](#what-tiuisize-means)
|
|
12
|
-
- [Practical Examples](#practical-examples)
|
|
13
|
-
- [View in Different Layouts](#view-in-different-layouts)
|
|
14
|
-
- [ImageView Reset: iOS Hi-Res](#imageview-reset-ios-hi-res)
|
|
15
|
-
- [Window Reset: White Background](#window-reset-white-background)
|
|
16
|
-
- [Width/Height Inheritance](#widthheight-inheritance)
|
|
17
|
-
- [Shared Spacing Scale](#shared-spacing-scale)
|
|
18
|
-
- [Combined Utilities (`wh-`)](#combined-utilities-wh-)
|
|
19
|
-
- [Color Inheritance](#color-inheritance)
|
|
20
|
-
- [Common Pitfalls](#common-pitfalls)
|
|
21
|
-
- [1. Assuming View fills parent](#1-assuming-view-fills-parent)
|
|
22
|
-
- [2. Padding on View/Window](#2-padding-on-viewwindow)
|
|
23
|
-
- [3. Not using w-screen for percentage calculations](#3-not-using-w-screen-for-percentage-calculations)
|
|
24
|
-
- [4. Confusion about h-screen](#4-confusion-about-h-screen)
|
|
25
|
-
- [Reset Behavior in Generated app.tss](#reset-behavior-in-generated-apptss)
|
|
26
|
-
- [Overriding Resets](#overriding-resets)
|
|
27
|
-
- [Summary Table](#summary-table)
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
5
|
## The Three Default Resets
|
|
32
6
|
|
|
33
7
|
```tss
|
|
@@ -57,7 +31,7 @@ The most important reset is for the `View` element. By default, `View` is set to
|
|
|
57
31
|
- Expand to fill margins (`m-4`, `mx-2`, `mt-6 mb-4`, etc.)
|
|
58
32
|
|
|
59
33
|
:::tip EXPLICIT SIZE VS NATIVE UNDEFINED
|
|
60
|
-
In Titanium, most elements like `Label` and `Button` default to `SIZE` behavior, but their property values are `undefined`.
|
|
34
|
+
In Titanium, most elements like `Label` and `Button` default to `SIZE` behavior, but their property values are `undefined`.
|
|
61
35
|
|
|
62
36
|
According to the **UI Composite Layout Behavior Spec**, if a dimension is `undefined` and you apply two opposite pins (e.g., `left` and `right` via `m-xx`), the motor will **compute the dimension based on the pins**, causing the element to stretch.
|
|
63
37
|
|