@maccesar/titools 2.2.3 → 2.2.8
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/README.md +28 -27
- package/lib/commands/update.js +80 -101
- package/package.json +1 -1
- package/skills/alloy-guides/SKILL.md +31 -31
- package/skills/alloy-guides/references/CONCEPTS.md +3 -3
- package/skills/alloy-guides/references/CONTROLLERS.md +1 -1
- package/skills/alloy-guides/references/MODELS.md +6 -6
- package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +1 -1
- package/skills/alloy-guides/references/VIEWS_XML.md +1 -1
- package/skills/alloy-guides/references/WIDGETS.md +1 -1
- package/skills/alloy-howtos/SKILL.md +27 -27
- package/skills/alloy-howtos/references/best_practices.md +9 -9
- package/skills/alloy-howtos/references/cli_reference.md +14 -14
- package/skills/alloy-howtos/references/config_files.md +16 -16
- package/skills/alloy-howtos/references/custom_tags.md +16 -16
- package/skills/alloy-howtos/references/debugging_troubleshooting.md +11 -15
- package/skills/alloy-howtos/references/samples.md +19 -19
- package/skills/purgetss/SKILL.md +11 -1
- package/skills/purgetss/references/animation-system.md +1 -1
- package/skills/purgetss/references/cli-commands.md +3 -3
- package/skills/purgetss/references/customization-deep-dive.md +1 -1
- package/skills/purgetss/references/dynamic-component-creation.md +1 -1
- package/skills/purgetss/references/icon-fonts.md +4 -0
- package/skills/purgetss/references/installation-setup.md +8 -1
- package/skills/purgetss/references/migration-guide.md +4 -0
- package/skills/purgetss/references/tikit-components.md +193 -204
- package/skills/purgetss/references/ui-ux-design.md +1 -1
- package/skills/ti-expert/SKILL.md +78 -118
- package/skills/ti-expert/references/alloy-builtins.md +18 -18
- package/skills/ti-expert/references/alloy-structure.md +21 -21
- package/skills/ti-expert/references/anti-patterns.md +15 -15
- package/skills/ti-expert/references/cli-expert.md +15 -15
- package/skills/ti-expert/references/code-conventions.md +38 -38
- package/skills/ti-expert/references/contracts.md +8 -8
- package/skills/ti-expert/references/controller-patterns.md +14 -14
- package/skills/ti-expert/references/error-handling.md +11 -11
- package/skills/ti-expert/references/examples.md +12 -12
- package/skills/ti-expert/references/migration-patterns.md +24 -24
- package/skills/ti-expert/references/patterns.md +10 -10
- package/skills/ti-expert/references/performance-listview.md +16 -16
- package/skills/ti-expert/references/performance-optimization.md +41 -41
- package/skills/ti-expert/references/security-device.md +22 -22
- package/skills/ti-expert/references/security-fundamentals.md +19 -19
- package/skills/ti-expert/references/state-management.md +33 -33
- package/skills/ti-expert/references/testing-e2e-ci.md +25 -25
- package/skills/ti-expert/references/testing-unit.md +24 -24
- package/skills/ti-expert/references/theming.md +15 -15
- package/skills/ti-guides/SKILL.md +58 -60
- package/skills/ti-guides/references/advanced-data-and-images.md +33 -33
- package/skills/ti-guides/references/android-manifest.md +15 -15
- package/skills/ti-guides/references/app-distribution.md +70 -166
- package/skills/ti-guides/references/application-frameworks.md +96 -114
- package/skills/ti-guides/references/cli-reference.md +294 -294
- package/skills/ti-guides/references/coding-best-practices.md +42 -33
- package/skills/ti-guides/references/commonjs-advanced.md +57 -51
- package/skills/ti-guides/references/hello-world.md +36 -36
- package/skills/ti-guides/references/hyperloop-native-access.md +66 -66
- package/skills/ti-guides/references/javascript-primer.md +83 -101
- package/skills/ti-guides/references/reserved-words.md +9 -9
- package/skills/ti-guides/references/resources.md +75 -83
- package/skills/ti-guides/references/style-and-conventions.md +35 -28
- package/skills/ti-guides/references/tiapp-config.md +110 -74
- package/skills/ti-howtos/SKILL.md +88 -92
- package/skills/ti-howtos/references/android-platform-deep-dives.md +104 -104
- package/skills/ti-howtos/references/automation-fastlane-appium.md +39 -39
- package/skills/ti-howtos/references/buffer-codec-streams.md +60 -60
- package/skills/ti-howtos/references/cross-platform-development.md +115 -136
- package/skills/ti-howtos/references/debugging-profiling.md +167 -181
- package/skills/ti-howtos/references/extending-titanium.md +121 -121
- package/skills/ti-howtos/references/google-maps-v2.md +84 -82
- package/skills/ti-howtos/references/ios-map-kit.md +65 -60
- package/skills/ti-howtos/references/ios-platform-deep-dives.md +123 -123
- package/skills/ti-howtos/references/local-data-sources.md +79 -78
- package/skills/ti-howtos/references/location-and-maps.md +116 -120
- package/skills/ti-howtos/references/media-apis.md +87 -86
- package/skills/ti-howtos/references/notification-services.md +250 -260
- package/skills/ti-howtos/references/remote-data-sources.md +98 -93
- package/skills/ti-howtos/references/tutorials.md +226 -216
- package/skills/ti-howtos/references/using-modules.md +73 -102
- package/skills/ti-howtos/references/web-content-integration.md +101 -103
- package/skills/ti-howtos/references/webpack-build-pipeline.md +52 -44
- package/skills/ti-ui/SKILL.md +85 -85
- package/skills/ti-ui/references/accessibility-deep-dive.md +57 -57
- package/skills/ti-ui/references/animation-and-matrices.md +79 -79
- package/skills/ti-ui/references/application-structures.md +96 -99
- package/skills/ti-ui/references/custom-fonts-styling.md +99 -99
- package/skills/ti-ui/references/event-handling.md +58 -58
- package/skills/ti-ui/references/gestures.md +62 -64
- package/skills/ti-ui/references/icons-and-splash-screens.md +88 -88
- package/skills/ti-ui/references/layouts-and-positioning.md +87 -97
- package/skills/ti-ui/references/listviews-and-performance.md +107 -107
- package/skills/ti-ui/references/orientation.md +87 -88
- package/skills/ti-ui/references/platform-ui-android.md +87 -81
- package/skills/ti-ui/references/platform-ui-ios.md +63 -61
- package/skills/ti-ui/references/scrolling-views.md +29 -29
- package/skills/ti-ui/references/tableviews.md +56 -56
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# PurgeTSS CLI Commands Guide
|
|
2
2
|
|
|
3
|
-
PurgeTSS provides a
|
|
3
|
+
PurgeTSS provides a full set of CLI commands for project setup, asset management, and development workflow automation.
|
|
4
4
|
|
|
5
5
|
:::info What's New in v7.2.x
|
|
6
|
-
**FontAwesome 7 &
|
|
6
|
+
**FontAwesome 7 & Performance Updates**: PurgeTSS v7.2 adds full support for **FontAwesome 7**, including the new CSS custom properties format. It also reduces installation size and refactors internals for performance and maintainability.
|
|
7
7
|
|
|
8
8
|
**Key Changes:**
|
|
9
9
|
- **Node.js 20+** required (due to "inquirer" v13 upgrade)
|
|
@@ -149,7 +149,7 @@ purgetss w -o
|
|
|
149
149
|
|
|
150
150
|
**Default behavior:** Activates auto-purge (runs on every compile)
|
|
151
151
|
|
|
152
|
-
This
|
|
152
|
+
This is especially useful with LiveView: it auto-purges on changes, gives fast feedback, and speeds up prototyping.
|
|
153
153
|
|
|
154
154
|
**What it installs in `alloy.jmk`:**
|
|
155
155
|
```javascript
|
|
@@ -62,7 +62,7 @@ purge: {
|
|
|
62
62
|
**`mode: 'all'` (default)**
|
|
63
63
|
- Scans EVERYWHERE in XML files (comments, attributes, classes, IDs, Ti Elements)
|
|
64
64
|
- **REQUIRED** if you want PurgeTSS to parse any Ti Elements styled in `config.cjs`
|
|
65
|
-
- Most
|
|
65
|
+
- Most complete but a bit slower
|
|
66
66
|
|
|
67
67
|
**`mode: 'class'`**
|
|
68
68
|
- Searches only in `class` and ID attributes in XML files
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
When creating components dynamically in Controllers (not declaratively in XML), PurgeTSS provides two
|
|
5
|
+
When creating components dynamically in Controllers (not declaratively in XML), PurgeTSS provides two methods to apply utility classes:
|
|
6
6
|
|
|
7
7
|
1. **`$.UI.create()`** - Create components with PurgeTSS classes (Recommended)
|
|
8
8
|
2. **`Alloy.createStyle()` + `applyProperties()`** - Apply PurgeTSS styles to existing components
|
|
@@ -84,6 +84,10 @@ Font Awesome 7 uses different style prefixes:
|
|
|
84
84
|
<Label class="fab fa-twitter fa-facebook fa-github" />
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
+
:::tip
|
|
88
|
+
PurgeTSS handles Font Awesome 7 CSS custom properties automatically (the `--fa:` format), so you do not need to edit icon CSS by hand.
|
|
89
|
+
:::
|
|
90
|
+
|
|
87
91
|
### Material Icons
|
|
88
92
|
|
|
89
93
|
```xml
|
|
@@ -8,6 +8,13 @@ PurgeTSS must be installed globally and initialized within each Titanium Alloy p
|
|
|
8
8
|
PurgeTSS has been thoroughly tested and proven to be compatible with Node 20.0.0 or higher.
|
|
9
9
|
:::
|
|
10
10
|
|
|
11
|
+
## Upgrade Notes (v7.3.x)
|
|
12
|
+
|
|
13
|
+
- `tailwind.tss` was renamed to `utilities.tss`. Update any scripts or paths that reference the old filename.
|
|
14
|
+
- PurgeTSS validates XML syntax before processing and reports line-level errors (for example, missing `<`).
|
|
15
|
+
- `deviceInfo()` now works in both Alloy and Classic projects (no `Alloy.isTablet`/`Alloy.isHandheld` dependency).
|
|
16
|
+
- If you hit issues after upgrading, try a clean reinstall: `npm uninstall -g purgetss && npm install -g purgetss`.
|
|
17
|
+
|
|
11
18
|
## Global Installation
|
|
12
19
|
|
|
13
20
|
Install PurgeTSS globally on your machine using NPM:
|
|
@@ -69,7 +76,7 @@ PurgeTSS creates a `purgetss` folder at the root of your project:
|
|
|
69
76
|
**File descriptions:**
|
|
70
77
|
|
|
71
78
|
- **`config.cjs`**: Where you customize colors, spacing, fonts, border radius, and add custom rules for Ti Elements
|
|
72
|
-
- **`styles/utilities.tss`**: All
|
|
79
|
+
- **`styles/utilities.tss`**: All utility classes + any custom classes from `config.cjs`
|
|
73
80
|
- **`styles/definitions.css`**: Special CSS file incorporating ALL classes from `utilities.tss`, `_app.tss`, remaining `.tss` files, and `fonts.tss`. Used by VS Code extension for IntelliSense
|
|
74
81
|
- **`fonts/`**: Directory for custom fonts (Icon, Serif, Sans-Serif, Cursive, Fantasy, Monospace). Use `purgetss build-fonts` after adding fonts
|
|
75
82
|
|
|
@@ -14,6 +14,10 @@ Before migrating, evaluate styling in the current codebase:
|
|
|
14
14
|
| Manual 2D Matrix animations | PurgeTSS Animation component |
|
|
15
15
|
| Platform conditionals in controllers | PurgeTSS platform modifiers (`ios:mt-10`) |
|
|
16
16
|
|
|
17
|
+
:::info v7.3 Upgrade Note
|
|
18
|
+
If your project or scripts reference `tailwind.tss`, update them to `utilities.tss` (the file was renamed in v7.3).
|
|
19
|
+
:::
|
|
20
|
+
|
|
17
21
|
## Step 1: Initialize PurgeTSS
|
|
18
22
|
|
|
19
23
|
```bash
|
|
@@ -1,45 +1,57 @@
|
|
|
1
|
-
# TiKit UI Components
|
|
1
|
+
# Welcome to TiKit UI Components
|
|
2
2
|
|
|
3
|
-
TiKit is a
|
|
3
|
+
TiKit is a set of UI components built with Alloy and PurgeTSS. It gives you reusable blocks for common UI patterns and keeps styling consistent across screens.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Why TiKit
|
|
6
|
+
|
|
7
|
+
- Ready-to-use components: Alerts, Avatars, Buttons, Cards, Tabs with practical defaults.
|
|
8
|
+
- PurgeTSS-first styling: Use utility classes instead of large TSS files.
|
|
9
|
+
- Dynamic updates: Change text, images, and icons without recreating components.
|
|
10
|
+
- Icon support: Works with Font Awesome, Material Icons, and other icon fonts.
|
|
11
|
+
- Consistent UI: Components are designed to work together.
|
|
12
|
+
- Easy to customize: Adjust colors and styles to match your brand.
|
|
13
|
+
- Lightweight: Built to stay fast and avoid extra overhead.
|
|
14
|
+
- Sensible defaults: You only pass what you need.
|
|
15
|
+
|
|
16
|
+
## Getting Started
|
|
17
|
+
|
|
18
|
+
Install the TiKit CLI and make sure PurgeTSS is installed globally:
|
|
6
19
|
|
|
7
20
|
```bash
|
|
8
|
-
# Install TiKit CLI globally
|
|
9
21
|
npm install -g tikit
|
|
10
|
-
|
|
11
|
-
# Make sure PurgeTSS is also installed
|
|
12
22
|
npm install -g purgetss
|
|
13
23
|
```
|
|
14
24
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
1. Create a PurgeTSS project (if not already):
|
|
18
|
-
```bash
|
|
19
|
-
purgetss create myApp
|
|
20
|
-
```
|
|
25
|
+
## Setting Up Your Project
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
cd myApp
|
|
25
|
-
tikit install
|
|
26
|
-
# Choose: all components, alerts, avatars, buttons, cards
|
|
27
|
-
```
|
|
27
|
+
1. Create a PurgeTSS project and configure `app.idprefix` and `app.theme` in `config.json` as required by PurgeTSS.
|
|
28
|
+
1. Run `tikit install` inside your project:
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
```bash
|
|
31
|
+
purgetss create myApp
|
|
32
|
+
cd myApp
|
|
33
|
+
|
|
34
|
+
tikit install
|
|
35
|
+
# ? Choose a component to install ›
|
|
36
|
+
# ❯ all components
|
|
37
|
+
# alerts
|
|
38
|
+
# avatars
|
|
39
|
+
# buttons
|
|
40
|
+
# cards
|
|
41
|
+
```
|
|
30
42
|
|
|
31
|
-
|
|
43
|
+
## Component Default Values
|
|
32
44
|
|
|
33
|
-
| Component
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
45
|
+
| Component | Property | Default Value | Description |
|
|
46
|
+
| --------- | --------- | ------------------------------------------------------------------------------ | ---------------------------- |
|
|
47
|
+
| Alerts | `color` | `"dark"` | The alert's color scheme |
|
|
48
|
+
| Alerts | `variant` | `"pop"` (with text) or `"solid"` (without text) | The alert's visual style |
|
|
49
|
+
| Avatars | `size` | `"base"` | The avatar's size |
|
|
50
|
+
| Avatars | `variant` | `"chip"` (with name) or `"square"` (without name) | The avatar's shape and style |
|
|
51
|
+
| Buttons | `size` | `"base"` | The button's size |
|
|
52
|
+
| Buttons | `variant` | `"icon-left"` (with icon) or `"filled"` (without icon) | The button's visual style |
|
|
53
|
+
| Cards | `color` | `"dark"` | The card's color scheme |
|
|
54
|
+
| Cards | `variant` | `"showcase"` (with image) or `"content"` (with subtitle) or `"code"` (default) | The card's layout style |
|
|
43
55
|
|
|
44
56
|
```xml
|
|
45
57
|
<!-- Uses variant="pop", color="dark" by default -->
|
|
@@ -55,216 +67,229 @@ TiKit components work out of the box with sensible defaults — you only need to
|
|
|
55
67
|
<Card module="tikit.ui" title="Simple Card" text="Using defaults" />
|
|
56
68
|
|
|
57
69
|
<!-- Uses variant="content" when subtitle is provided -->
|
|
58
|
-
<Card module="tikit.ui" title="Card" subtitle="Important info" text="
|
|
70
|
+
<Card module="tikit.ui" title="Card with Subtitle" subtitle="Important info" text="Some details" />
|
|
59
71
|
|
|
60
72
|
<!-- Uses variant="showcase" when image is provided -->
|
|
61
|
-
<Card module="tikit.ui" title="Image Card" text="
|
|
73
|
+
<Card module="tikit.ui" title="Image Card" text="With an image" image="path/to/image.jpg" />
|
|
62
74
|
```
|
|
63
75
|
|
|
64
|
-
---
|
|
65
|
-
|
|
66
76
|
## Alerts
|
|
67
77
|
|
|
68
|
-
|
|
78
|
+
Common properties: `variant`, `color`, `classes`, `title`, `text`
|
|
69
79
|
|
|
70
|
-
|
|
80
|
+
Alerts are for short, important messages that do not block the user.
|
|
71
81
|
|
|
72
|
-
|
|
82
|
+
Variants:
|
|
73
83
|
|
|
74
|
-
- `callout
|
|
75
|
-
- `pop
|
|
76
|
-
- `solid
|
|
84
|
+
- `callout`: Simple message with title and text.
|
|
85
|
+
- `pop`: Includes an icon alongside the title and text.
|
|
86
|
+
- `solid`: Full-width banner style, usually with just a title and icon.
|
|
77
87
|
|
|
78
|
-
|
|
88
|
+
Colors:
|
|
79
89
|
|
|
80
|
-
`success`, `danger`, `warning`, `info`, `dark`, `light
|
|
90
|
+
- `success`, `danger`, `warning`, `info`, `dark`, `light`.
|
|
91
|
+
- Define `primary` and `secondary` with `purgetss shades`.
|
|
81
92
|
|
|
82
|
-
|
|
93
|
+
Extra controls:
|
|
83
94
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
```
|
|
95
|
+
- `delay` (ms): Wait before showing the alert.
|
|
96
|
+
- `duration` (ms): Control animation speed.
|
|
97
|
+
- `dismissible` (boolean): Tap to close.
|
|
88
98
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
- `dismissible` (boolean) — Let users tap to close
|
|
99
|
+
```xml
|
|
100
|
+
<Alert module="tikit.ui" variant="pop" color="info" delay="500" dismissible="true"
|
|
101
|
+
title="Just FYI" text="You can tap this alert to close it." />
|
|
102
|
+
```
|
|
94
103
|
|
|
95
|
-
###
|
|
104
|
+
### `callout`
|
|
96
105
|
|
|
97
106
|
```xml
|
|
98
|
-
|
|
99
|
-
|
|
107
|
+
<Alert module="tikit.ui" variant="callout" color="success"
|
|
108
|
+
title="Success!" text="Your changes have been saved." />
|
|
109
|
+
```
|
|
100
110
|
|
|
101
|
-
|
|
102
|
-
<Alert module="tikit.ui" variant="pop" color="primary" title="Action Required" text="Please review." icon="mi mi-pending_actions text-3xl" />
|
|
111
|
+
### `pop`
|
|
103
112
|
|
|
104
|
-
|
|
105
|
-
<Alert module="tikit.ui" variant="solid" color="warning" title="Maintenance Soon" icon="mi mi-warning text-2xl" />
|
|
113
|
+
Use the `icon` property with PurgeTSS classes for size and color.
|
|
106
114
|
|
|
107
|
-
|
|
108
|
-
<Alert module="tikit.ui" variant="pop" color="
|
|
115
|
+
```xml
|
|
116
|
+
<Alert module="tikit.ui" variant="pop" color="primary"
|
|
117
|
+
title="Action Required" text="Please review the details."
|
|
118
|
+
icon="mi mi-pending_actions text-3xl" />
|
|
109
119
|
```
|
|
110
120
|
|
|
111
|
-
|
|
121
|
+
### `solid`
|
|
112
122
|
|
|
113
|
-
|
|
123
|
+
```xml
|
|
124
|
+
<Alert module="tikit.ui" variant="solid" color="warning"
|
|
125
|
+
title="Maintenance Soon" icon="mi mi-warning text-2xl" />
|
|
126
|
+
```
|
|
114
127
|
|
|
115
|
-
|
|
128
|
+
## Avatars
|
|
116
129
|
|
|
117
|
-
|
|
130
|
+
Common properties: `variant`, `size`, `classes`, `image`
|
|
118
131
|
|
|
119
|
-
|
|
132
|
+
Variants:
|
|
120
133
|
|
|
121
|
-
- `chip
|
|
122
|
-
- `circular
|
|
123
|
-
- `landscape
|
|
124
|
-
- `portrait
|
|
125
|
-
- `square
|
|
126
|
-
- `stacked
|
|
134
|
+
- `chip`: Image with a name label next to it.
|
|
135
|
+
- `circular`: Standard round avatar.
|
|
136
|
+
- `landscape`: Rectangular, wider than tall.
|
|
137
|
+
- `portrait`: Rectangular, taller than wide.
|
|
138
|
+
- `square`: Simple square avatar.
|
|
139
|
+
- `stacked`: Designed to overlap slightly in a horizontal group.
|
|
127
140
|
|
|
128
|
-
|
|
141
|
+
Sizes: `xs`, `sm`, `base`, `lg`, `xl`, `2xl`.
|
|
129
142
|
|
|
130
|
-
|
|
143
|
+
```xml
|
|
144
|
+
<Avatar module="tikit.ui" variant="circular" size="lg" image="path/to/your/image.jpg" />
|
|
145
|
+
```
|
|
131
146
|
|
|
132
|
-
###
|
|
147
|
+
### `chip`
|
|
133
148
|
|
|
134
149
|
```xml
|
|
135
|
-
<!-- Chip with custom colors -->
|
|
136
150
|
<Avatar module="tikit.ui" variant="chip" size="base" name="Jane Doe"
|
|
137
151
|
image="https://randomuser.me/api/portraits/women/86.jpg"
|
|
138
152
|
classes="bg-blue-100 text-blue-800" />
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### `circular` and `square`
|
|
156
|
+
|
|
157
|
+
Set `border="true"` for a default white border. Override border color with `classes`.
|
|
139
158
|
|
|
140
|
-
|
|
159
|
+
```xml
|
|
141
160
|
<Avatar module="tikit.ui" variant="circular" size="base" border="true"
|
|
142
161
|
image="https://randomuser.me/api/portraits/men/86.jpg"
|
|
143
162
|
classes="border-gray-300" />
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### `portrait` and `landscape`
|
|
166
|
+
|
|
167
|
+
Default gray border (`border-gray-500`). Override with `classes`.
|
|
144
168
|
|
|
145
|
-
|
|
169
|
+
```xml
|
|
146
170
|
<Avatar module="tikit.ui" variant="portrait" size="base"
|
|
147
171
|
image="https://randomuser.me/api/portraits/men/87.jpg"
|
|
148
172
|
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
173
|
```
|
|
157
174
|
|
|
158
|
-
###
|
|
175
|
+
### `stacked`
|
|
159
176
|
|
|
160
|
-
|
|
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 |
|
|
177
|
+
Use inside a `<View class="horizontal">` and set `last="true"` on the final avatar.
|
|
168
178
|
|
|
169
|
-
|
|
179
|
+
```xml
|
|
180
|
+
<View class="horizontal">
|
|
181
|
+
<Avatar module="tikit.ui" variant="stacked" size="base"
|
|
182
|
+
image="https://randomuser.me/api/portraits/men/86.jpg" />
|
|
183
|
+
<Avatar module="tikit.ui" variant="stacked" size="base"
|
|
184
|
+
image="https://randomuser.me/api/portraits/women/87.jpg" />
|
|
185
|
+
<Avatar module="tikit.ui" variant="stacked" size="base"
|
|
186
|
+
image="https://randomuser.me/api/portraits/men/62.jpg" />
|
|
187
|
+
<Avatar module="tikit.ui" variant="stacked" size="base" last="true"
|
|
188
|
+
image="https://randomuser.me/api/portraits/women/88.jpg" />
|
|
189
|
+
</View>
|
|
190
|
+
```
|
|
170
191
|
|
|
171
192
|
## Buttons
|
|
172
193
|
|
|
173
|
-
|
|
194
|
+
Common properties: `variant`, `size`, `classes`, `title`
|
|
174
195
|
|
|
175
|
-
|
|
196
|
+
Variants:
|
|
176
197
|
|
|
177
|
-
- `border`
|
|
178
|
-
- `border-rounded`
|
|
179
|
-
- `filled`
|
|
180
|
-
- `filled-rounded`
|
|
181
|
-
- `icon-left`
|
|
182
|
-
- `icon-right`
|
|
198
|
+
- `border`
|
|
199
|
+
- `border-rounded`
|
|
200
|
+
- `filled`
|
|
201
|
+
- `filled-rounded`
|
|
202
|
+
- `icon-left`
|
|
203
|
+
- `icon-right`
|
|
183
204
|
|
|
184
|
-
|
|
205
|
+
Sizes: `xs`, `sm`, `base`, `lg`, `xl`, `2xl`.
|
|
185
206
|
|
|
186
|
-
|
|
207
|
+
```xml
|
|
208
|
+
<Button module="tikit.ui" variant="filled" size="lg" title="Submit"
|
|
209
|
+
classes="bg-blue-500 text-white" />
|
|
210
|
+
```
|
|
187
211
|
|
|
188
|
-
###
|
|
212
|
+
### `border` and `border-rounded`
|
|
189
213
|
|
|
190
214
|
```xml
|
|
191
|
-
<!-- Border button -->
|
|
192
215
|
<Button module="tikit.ui" variant="border" size="base" title="Cancel"
|
|
193
216
|
classes="border-red-500 text-red-500" />
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### `filled` and `filled-rounded`
|
|
194
220
|
|
|
195
|
-
|
|
221
|
+
```xml
|
|
196
222
|
<Button module="tikit.ui" variant="filled-rounded" size="base" title="Confirm"
|
|
197
223
|
classes="bg-green-600 text-white" />
|
|
224
|
+
```
|
|
198
225
|
|
|
199
|
-
|
|
226
|
+
### `icon-left` and `icon-right`
|
|
227
|
+
|
|
228
|
+
Use the `icon` property with the icon class and any PurgeTSS size or color classes.
|
|
229
|
+
|
|
230
|
+
```xml
|
|
200
231
|
<Button module="tikit.ui" variant="icon-left" size="base" title="Save"
|
|
201
232
|
icon="fa fa-save text-white" classes="bg-blue-500 text-white" />
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Using Custom Icons in Buttons
|
|
202
236
|
|
|
203
|
-
|
|
237
|
+
```xml
|
|
204
238
|
<Button module="tikit.ui" variant="icon-right" size="lg" title="Settings"
|
|
205
239
|
icon="mi mi-settings text-lg text-gray-100"
|
|
206
240
|
classes="bg-gray-700 text-gray-100" />
|
|
207
241
|
```
|
|
208
242
|
|
|
209
|
-
---
|
|
210
|
-
|
|
211
243
|
## Cards
|
|
212
244
|
|
|
213
|
-
|
|
245
|
+
Common properties: `variant`, `color`, `classes`
|
|
214
246
|
|
|
215
|
-
|
|
247
|
+
Variants:
|
|
216
248
|
|
|
217
|
-
- `code
|
|
218
|
-
- `content
|
|
219
|
-
- `quote
|
|
220
|
-
- `showcase
|
|
249
|
+
- `code`: Display code snippets, optional copy button.
|
|
250
|
+
- `content`: Text with title, subtitle, and body.
|
|
251
|
+
- `quote`: Quote with attribution.
|
|
252
|
+
- `showcase`: Image with title and description.
|
|
221
253
|
|
|
222
|
-
|
|
254
|
+
Colors: `black`, `dark`, `light`, `white`.
|
|
223
255
|
|
|
224
|
-
|
|
256
|
+
### `code`
|
|
225
257
|
|
|
226
|
-
|
|
258
|
+
`copy="true"` enables a copy button. Add `L('copy', 'Copy')` and `L('code_copied', 'Code copied!')` to `strings.xml`.
|
|
227
259
|
|
|
228
260
|
```xml
|
|
229
|
-
<!-- Code card with copy button -->
|
|
230
261
|
<Card module="tikit.ui" variant="code" color="dark" copy="true"
|
|
231
|
-
title="Example" text="function hello() { console.log('Hi!'); }" />
|
|
262
|
+
title="Example Function" text="function hello() { console.log('Hi!'); }" />
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### `showcase`
|
|
266
|
+
|
|
267
|
+
Use `rounded` (integer >= 0) to control border radius.
|
|
232
268
|
|
|
233
|
-
|
|
269
|
+
```xml
|
|
234
270
|
<Card module="tikit.ui" variant="showcase" color="black"
|
|
235
271
|
title="Project X" text="Mobile app design concept."
|
|
236
272
|
image="images/showcase/project-x.jpg" />
|
|
273
|
+
```
|
|
237
274
|
|
|
238
|
-
|
|
275
|
+
### `quote`
|
|
276
|
+
|
|
277
|
+
```xml
|
|
239
278
|
<Card module="tikit.ui" variant="quote" color="white"
|
|
240
279
|
name="Jane Austen" text="There is no charm equal to tenderness of heart." />
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### `content`
|
|
241
283
|
|
|
242
|
-
|
|
284
|
+
```xml
|
|
243
285
|
<Card module="tikit.ui" variant="content" color="light"
|
|
244
286
|
title="About TiKit" subtitle="Making UI Easier"
|
|
245
|
-
text="TiKit
|
|
287
|
+
text="TiKit aims to provide useful components..." />
|
|
246
288
|
```
|
|
247
289
|
|
|
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
290
|
## Tabs
|
|
264
291
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
TiKit tabs make it easy to add icon-based tabs using any loaded font library.
|
|
292
|
+
Properties: `title`, `icon`, `activeIcon` (iOS only) plus standard `Titanium.UI.Tab` properties.
|
|
268
293
|
|
|
269
294
|
```xml
|
|
270
295
|
<Tab module="tikit.ui" title="Home" icon="fa fa-home" activeIcon="fas fa-home">
|
|
@@ -272,9 +297,7 @@ TiKit tabs make it easy to add icon-based tabs using any loaded font library.
|
|
|
272
297
|
</Tab>
|
|
273
298
|
```
|
|
274
299
|
|
|
275
|
-
### Styling Tabs
|
|
276
|
-
|
|
277
|
-
Since these are `Titanium.UI.Tab` objects, use standard properties and PurgeTSS classes:
|
|
300
|
+
### Styling Tabs Further
|
|
278
301
|
|
|
279
302
|
```xml
|
|
280
303
|
<Tab module="tikit.ui"
|
|
@@ -286,39 +309,30 @@ Since these are `Titanium.UI.Tab` objects, use standard properties and PurgeTSS
|
|
|
286
309
|
</Tab>
|
|
287
310
|
```
|
|
288
311
|
|
|
289
|
-
---
|
|
290
|
-
|
|
291
312
|
## Updating Components Dynamically
|
|
292
313
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
### Available Update Methods
|
|
314
|
+
Give the component an `id` and call update methods from your controller.
|
|
296
315
|
|
|
297
|
-
|
|
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 |
|
|
316
|
+
Available update methods:
|
|
306
317
|
|
|
307
|
-
|
|
318
|
+
- `updateTitle(newTitle)`
|
|
319
|
+
- `updateSubtitle(newSubtitle)`
|
|
320
|
+
- `updateText(newText)`
|
|
321
|
+
- `updateName(newName)`
|
|
322
|
+
- `updateImage(newImage)`
|
|
323
|
+
- `updateIcon(newIcon)`
|
|
324
|
+
- `update(args)` for multiple properties (`title`, `subtitle`, `text`, `name`, `image`, `icon`)
|
|
308
325
|
|
|
309
|
-
|
|
326
|
+
Supported updates:
|
|
310
327
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
| **Alerts** | `title`, `text`, `icon` (`text` not applicable to `solid`) |
|
|
316
|
-
| **Buttons** | `title`, `icon` (`icon` for `icon-left`/`icon-right`) |
|
|
328
|
+
- Cards: `title`, `subtitle`, `text`, `image`
|
|
329
|
+
- Avatars: `image`, `name` (mostly for `chip`)
|
|
330
|
+
- Alerts: `title`, `text`, `icon` (`text` not applicable to `solid`)
|
|
331
|
+
- Buttons: `title`, `icon` (`icon` for `icon-left`/`icon-right`)
|
|
317
332
|
|
|
318
|
-
|
|
333
|
+
Example:
|
|
319
334
|
|
|
320
335
|
```xml
|
|
321
|
-
<!-- View -->
|
|
322
336
|
<Card id="statusCard" module="tikit.ui" variant="content" color="light"
|
|
323
337
|
title="Status" subtitle="Current" text="Waiting for update..." />
|
|
324
338
|
|
|
@@ -328,26 +342,18 @@ The `update()` method accepts an object with keys: `title`, `subtitle`, `text`,
|
|
|
328
342
|
```
|
|
329
343
|
|
|
330
344
|
```javascript
|
|
331
|
-
// Controller
|
|
332
345
|
function fetchStatus() {
|
|
333
|
-
// Update multiple properties at once
|
|
334
346
|
$.statusCard.update({
|
|
335
347
|
title: 'Status Updated!',
|
|
336
348
|
subtitle: 'Just Now',
|
|
337
349
|
text: 'Everything looks good. System operational.'
|
|
338
350
|
});
|
|
339
|
-
|
|
340
|
-
// Or update individually
|
|
341
|
-
// $.statusCard.updateTitle('Status Updated!');
|
|
342
|
-
// $.statusCard.updateSubtitle('Just Now');
|
|
343
351
|
}
|
|
344
352
|
```
|
|
345
353
|
|
|
346
|
-
|
|
354
|
+
## Working with Icon Fonts
|
|
347
355
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
TiKit components accept icon fonts via the `icon` property. Use any font loaded through PurgeTSS.
|
|
356
|
+
Use any icon font loaded via PurgeTSS. Specify the font prefix and icon name in the `icon` property, along with size and color classes.
|
|
351
357
|
|
|
352
358
|
### Official Icon Fonts
|
|
353
359
|
|
|
@@ -357,9 +363,9 @@ purgetss icon-library --vendor=fa,mi,ms,f7
|
|
|
357
363
|
|
|
358
364
|
### Custom Icon Fonts
|
|
359
365
|
|
|
360
|
-
1. Place font
|
|
361
|
-
|
|
362
|
-
|
|
366
|
+
1. Place your font files and CSS in `purgetss/fonts/your-font-name/`.
|
|
367
|
+
1. Run `purgetss build-fonts`.
|
|
368
|
+
1. Use in TiKit components:
|
|
363
369
|
|
|
364
370
|
```xml
|
|
365
371
|
<Button module="tikit.ui" variant="icon-left" title="Launch"
|
|
@@ -371,23 +377,6 @@ purgetss icon-library --vendor=fa,mi,ms,f7
|
|
|
371
377
|
icon="myicon myicon-download text-2xl" />
|
|
372
378
|
```
|
|
373
379
|
|
|
374
|
-
##
|
|
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
|
|
380
|
+
## License
|
|
391
381
|
|
|
392
|
-
|
|
393
|
-
- **Cards**: `black`, `dark`, `light`, `white`
|
|
382
|
+
TiKit UI Components is open source under the MIT License.
|