macbetter 0.0.0-stage → 0.1.0-beta.1
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/LICENSE +201 -0
- package/README.md +92 -2
- package/dist/components/accessory-tile.d.ts +50 -0
- package/dist/components/accessory-tile.js +46 -0
- package/dist/components/activity-indicator.d.ts +15 -0
- package/dist/components/activity-indicator.js +15 -0
- package/dist/components/alert.d.ts +29 -0
- package/dist/components/alert.js +30 -0
- package/dist/components/artwork.d.ts +44 -0
- package/dist/components/artwork.js +935 -0
- package/dist/components/automation-row.d.ts +24 -0
- package/dist/components/automation-row.js +12 -0
- package/dist/components/avatar.d.ts +33 -0
- package/dist/components/avatar.js +45 -0
- package/dist/components/badge.d.ts +24 -0
- package/dist/components/badge.js +19 -0
- package/dist/components/button.d.ts +20 -0
- package/dist/components/button.js +10 -0
- package/dist/components/calendar.d.ts +30 -0
- package/dist/components/calendar.js +47 -0
- package/dist/components/camera-view.d.ts +40 -0
- package/dist/components/camera-view.js +44 -0
- package/dist/components/card.d.ts +14 -0
- package/dist/components/card.js +21 -0
- package/dist/components/carousel.d.ts +18 -0
- package/dist/components/carousel.js +33 -0
- package/dist/components/checkbox.d.ts +13 -0
- package/dist/components/checkbox.js +16 -0
- package/dist/components/code-field.d.ts +16 -0
- package/dist/components/code-field.js +29 -0
- package/dist/components/color-well.d.ts +23 -0
- package/dist/components/color-well.js +27 -0
- package/dist/components/combo-box.d.ts +42 -0
- package/dist/components/combo-box.js +102 -0
- package/dist/components/command-palette.d.ts +33 -0
- package/dist/components/command-palette.js +55 -0
- package/dist/components/context-menu.d.ts +9 -0
- package/dist/components/context-menu.js +15 -0
- package/dist/components/date-picker.d.ts +53 -0
- package/dist/components/date-picker.js +86 -0
- package/dist/components/device-frame.d.ts +18 -0
- package/dist/components/device-frame.js +16 -0
- package/dist/components/dialog.d.ts +27 -0
- package/dist/components/dialog.js +35 -0
- package/dist/components/disclosure.d.ts +32 -0
- package/dist/components/disclosure.js +35 -0
- package/dist/components/dock.d.ts +28 -0
- package/dist/components/dock.js +80 -0
- package/dist/components/door-control.d.ts +20 -0
- package/dist/components/door-control.js +43 -0
- package/dist/components/energy-readout.d.ts +32 -0
- package/dist/components/energy-readout.js +27 -0
- package/dist/components/field.d.ts +28 -0
- package/dist/components/field.js +32 -0
- package/dist/components/gauge.d.ts +25 -0
- package/dist/components/gauge.js +42 -0
- package/dist/components/glass.d.ts +34 -0
- package/dist/components/glass.js +31 -0
- package/dist/components/home-backdrop.d.ts +23 -0
- package/dist/components/home-backdrop.js +12 -0
- package/dist/components/home-section.d.ts +19 -0
- package/dist/components/home-section.js +21 -0
- package/dist/components/home-status.d.ts +24 -0
- package/dist/components/home-status.js +14 -0
- package/dist/components/hover-card.d.ts +14 -0
- package/dist/components/hover-card.js +16 -0
- package/dist/components/level-control.d.ts +19 -0
- package/dist/components/level-control.js +13 -0
- package/dist/components/light-color-picker.d.ts +33 -0
- package/dist/components/light-color-picker.js +56 -0
- package/dist/components/list.d.ts +42 -0
- package/dist/components/list.js +42 -0
- package/dist/components/listbox.d.ts +16 -0
- package/dist/components/listbox.js +28 -0
- package/dist/components/lock-control.d.ts +20 -0
- package/dist/components/lock-control.js +35 -0
- package/dist/components/menu-bar.d.ts +14 -0
- package/dist/components/menu-bar.js +16 -0
- package/dist/components/menu.d.ts +40 -0
- package/dist/components/menu.js +54 -0
- package/dist/components/navigation-bar.d.ts +24 -0
- package/dist/components/navigation-bar.js +54 -0
- package/dist/components/outline.d.ts +21 -0
- package/dist/components/outline.js +40 -0
- package/dist/components/page-control.d.ts +10 -0
- package/dist/components/page-control.js +8 -0
- package/dist/components/popover.d.ts +16 -0
- package/dist/components/popover.js +24 -0
- package/dist/components/progress.d.ts +27 -0
- package/dist/components/progress.js +27 -0
- package/dist/components/radio.d.ts +16 -0
- package/dist/components/radio.js +13 -0
- package/dist/components/rating.d.ts +10 -0
- package/dist/components/rating.js +12 -0
- package/dist/components/scene-tile.d.ts +22 -0
- package/dist/components/scene-tile.js +13 -0
- package/dist/components/scroll-view.d.ts +21 -0
- package/dist/components/scroll-view.js +13 -0
- package/dist/components/search-field.d.ts +16 -0
- package/dist/components/search-field.js +12 -0
- package/dist/components/secure-field.d.ts +23 -0
- package/dist/components/secure-field.js +21 -0
- package/dist/components/segmented-control.d.ts +12 -0
- package/dist/components/segmented-control.js +10 -0
- package/dist/components/select.d.ts +45 -0
- package/dist/components/select.js +79 -0
- package/dist/components/sensor-readout.d.ts +29 -0
- package/dist/components/sensor-readout.js +12 -0
- package/dist/components/separator.d.ts +14 -0
- package/dist/components/separator.js +11 -0
- package/dist/components/setup-code.d.ts +29 -0
- package/dist/components/setup-code.js +47 -0
- package/dist/components/sheet.d.ts +31 -0
- package/dist/components/sheet.js +51 -0
- package/dist/components/sidebar.d.ts +30 -0
- package/dist/components/sidebar.js +26 -0
- package/dist/components/slider.d.ts +27 -0
- package/dist/components/slider.js +43 -0
- package/dist/components/split-view.d.ts +11 -0
- package/dist/components/split-view.js +13 -0
- package/dist/components/squircle.d.ts +41 -0
- package/dist/components/squircle.js +63 -0
- package/dist/components/stepper.d.ts +30 -0
- package/dist/components/stepper.js +28 -0
- package/dist/components/switch.d.ts +10 -0
- package/dist/components/switch.js +10 -0
- package/dist/components/tab-bar.d.ts +20 -0
- package/dist/components/tab-bar.js +17 -0
- package/dist/components/table.d.ts +49 -0
- package/dist/components/table.js +179 -0
- package/dist/components/tabs.d.ts +16 -0
- package/dist/components/tabs.js +19 -0
- package/dist/components/text-area.d.ts +14 -0
- package/dist/components/text-area.js +9 -0
- package/dist/components/text-field.d.ts +26 -0
- package/dist/components/text-field.js +23 -0
- package/dist/components/thermostat-control.d.ts +30 -0
- package/dist/components/thermostat-control.js +139 -0
- package/dist/components/toast.d.ts +30 -0
- package/dist/components/toast.js +114 -0
- package/dist/components/toggle.d.ts +21 -0
- package/dist/components/toggle.js +19 -0
- package/dist/components/token-field.d.ts +31 -0
- package/dist/components/token-field.js +78 -0
- package/dist/components/toolbar.d.ts +27 -0
- package/dist/components/toolbar.js +39 -0
- package/dist/components/tooltip.d.ts +11 -0
- package/dist/components/tooltip.js +18 -0
- package/dist/components/window.d.ts +56 -0
- package/dist/components/window.js +61 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.js +79 -0
- package/dist/lib/cx.d.ts +9 -0
- package/dist/lib/cx.js +14 -0
- package/dist/lib/derive.d.ts +53 -0
- package/dist/lib/derive.js +255 -0
- package/dist/lib/field-glyphs.d.ts +13 -0
- package/dist/lib/field-glyphs.js +28 -0
- package/dist/lib/menu-glyphs.d.ts +6 -0
- package/dist/lib/menu-glyphs.js +15 -0
- package/dist/lib/platform.d.ts +18 -0
- package/dist/lib/platform.js +17 -0
- package/dist/lib/squircle.d.ts +23 -0
- package/dist/lib/squircle.js +69 -0
- package/dist/lib/theme.d.ts +42 -0
- package/dist/lib/theme.js +62 -0
- package/dist/styles/base.css +115 -0
- package/dist/styles/components/accessory-tile.css +461 -0
- package/dist/styles/components/activity-indicator.css +63 -0
- package/dist/styles/components/alert.css +433 -0
- package/dist/styles/components/artwork.css +380 -0
- package/dist/styles/components/automation-row.css +52 -0
- package/dist/styles/components/avatar.css +230 -0
- package/dist/styles/components/badge.css +204 -0
- package/dist/styles/components/button.css +298 -0
- package/dist/styles/components/calendar.css +287 -0
- package/dist/styles/components/camera-view.css +239 -0
- package/dist/styles/components/card.css +100 -0
- package/dist/styles/components/carousel.css +210 -0
- package/dist/styles/components/checkbox.css +212 -0
- package/dist/styles/components/code-field.css +163 -0
- package/dist/styles/components/color-well.css +452 -0
- package/dist/styles/components/combo-box.css +222 -0
- package/dist/styles/components/command-palette.css +379 -0
- package/dist/styles/components/context-menu.css +43 -0
- package/dist/styles/components/date-picker.css +356 -0
- package/dist/styles/components/device-frame.css +194 -0
- package/dist/styles/components/dialog.css +366 -0
- package/dist/styles/components/disclosure.css +197 -0
- package/dist/styles/components/dock.css +404 -0
- package/dist/styles/components/door-control.css +187 -0
- package/dist/styles/components/energy-readout.css +161 -0
- package/dist/styles/components/field.css +175 -0
- package/dist/styles/components/gauge.css +239 -0
- package/dist/styles/components/glass.css +113 -0
- package/dist/styles/components/home-backdrop.css +81 -0
- package/dist/styles/components/home-section.css +100 -0
- package/dist/styles/components/home-status.css +215 -0
- package/dist/styles/components/hover-card.css +145 -0
- package/dist/styles/components/index.css +75 -0
- package/dist/styles/components/level-control.css +247 -0
- package/dist/styles/components/light-color-picker.css +94 -0
- package/dist/styles/components/list.css +411 -0
- package/dist/styles/components/listbox.css +168 -0
- package/dist/styles/components/lock-control.css +164 -0
- package/dist/styles/components/menu-bar.css +94 -0
- package/dist/styles/components/menu.css +454 -0
- package/dist/styles/components/navigation-bar.css +248 -0
- package/dist/styles/components/outline.css +248 -0
- package/dist/styles/components/page-control.css +127 -0
- package/dist/styles/components/popover.css +186 -0
- package/dist/styles/components/progress.css +228 -0
- package/dist/styles/components/radio.css +281 -0
- package/dist/styles/components/rating.css +122 -0
- package/dist/styles/components/scene-tile.css +295 -0
- package/dist/styles/components/scroll-view.css +195 -0
- package/dist/styles/components/search-field.css +128 -0
- package/dist/styles/components/secure-field.css +189 -0
- package/dist/styles/components/segmented-control.css +183 -0
- package/dist/styles/components/select.css +290 -0
- package/dist/styles/components/sensor-readout.css +231 -0
- package/dist/styles/components/separator.css +62 -0
- package/dist/styles/components/setup-code.css +138 -0
- package/dist/styles/components/sheet.css +345 -0
- package/dist/styles/components/sidebar.css +261 -0
- package/dist/styles/components/slider.css +208 -0
- package/dist/styles/components/split-view.css +75 -0
- package/dist/styles/components/squircle.css +44 -0
- package/dist/styles/components/stepper.css +278 -0
- package/dist/styles/components/switch.css +115 -0
- package/dist/styles/components/tab-bar.css +223 -0
- package/dist/styles/components/table.css +313 -0
- package/dist/styles/components/tabs.css +262 -0
- package/dist/styles/components/text-area.css +94 -0
- package/dist/styles/components/text-field.css +294 -0
- package/dist/styles/components/thermostat-control.css +214 -0
- package/dist/styles/components/toast.css +418 -0
- package/dist/styles/components/toggle.css +312 -0
- package/dist/styles/components/token-field.css +193 -0
- package/dist/styles/components/toolbar.css +370 -0
- package/dist/styles/components/tooltip.css +69 -0
- package/dist/styles/components/window.css +428 -0
- package/dist/styles/index.css +17 -0
- package/dist/styles/materials.css +263 -0
- package/dist/styles/platforms.css +214 -0
- package/dist/styles/themes/ember.css +24 -0
- package/dist/styles/themes/graphite.css +16 -0
- package/dist/styles/themes/nebula.css +16 -0
- package/dist/styles/themes/system.css +28 -0
- package/dist/styles/tokens.css +299 -0
- package/package.json +82 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,93 @@
|
|
|
1
|
-
#
|
|
1
|
+
# macbetter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A design system for the web: macOS, iPadOS and iOS from one set of React components, themeable to any brand, built on [ui-sdk](https://ui-sdk.dev).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add macbetter @ui-sdk/react @ui-sdk/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires React 19 or newer. The package is compiled JavaScript with type declarations, one file per component, so it needs no bundler configuration.
|
|
12
|
+
|
|
13
|
+
## Set up
|
|
14
|
+
|
|
15
|
+
Import the stylesheet once. It sits in the `macbetter` cascade layer, so your own unlayered CSS wins without `!important`:
|
|
16
|
+
|
|
17
|
+
```css
|
|
18
|
+
@layer ui-sdk, macbetter;
|
|
19
|
+
@import "macbetter/styles.css";
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
With Tailwind CSS v4, declare `@layer ui-sdk, theme, base, macbetter, components, utilities;` and import `tailwindcss` before macbetter.
|
|
23
|
+
|
|
24
|
+
Render `<MacbetterScript />` at the top of `<body>`. It sets `data-platform` on `<html>` before first paint: `macos` for a fine pointer, `ipados` or `ios` for touch.
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { MacbetterScript } from "macbetter"
|
|
28
|
+
|
|
29
|
+
<html lang="en" data-theme="ember" suppressHydrationWarning>
|
|
30
|
+
<body data-macbetter="">
|
|
31
|
+
<MacbetterScript />
|
|
32
|
+
{children}
|
|
33
|
+
</body>
|
|
34
|
+
</html>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Use
|
|
38
|
+
|
|
39
|
+
Import each component from its own entry:
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Button } from "macbetter/button"
|
|
43
|
+
import { Switch } from "macbetter/switch"
|
|
44
|
+
|
|
45
|
+
<label>
|
|
46
|
+
Wi-Fi
|
|
47
|
+
<Switch defaultChecked />
|
|
48
|
+
</label>
|
|
49
|
+
<Button variant="filled">Join network</Button>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
| Entry | Contents |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `macbetter/<component>` | One component and its parts |
|
|
55
|
+
| `macbetter` | Everything, plus `MacbetterScript`, `resolvePlatform` and `cx` |
|
|
56
|
+
| `macbetter/styles.css` | Tokens, platforms, themes, base, materials and component CSS |
|
|
57
|
+
| `macbetter/themes/<name>.css` | One built-in theme |
|
|
58
|
+
| `macbetter/theme` | `createTheme`, `themeVariables`, `contrastRatio` |
|
|
59
|
+
|
|
60
|
+
## Platforms
|
|
61
|
+
|
|
62
|
+
`data-platform="macos" | "ipados" | "ios"` sets text styles, control and row heights, hit targets and radii. It inherits and can be nested, so a phone preview can sit inside a desktop page. Force one with `<MacbetterScript platform="ios" />`, or let people choose with `storageKey`.
|
|
63
|
+
|
|
64
|
+
## Theming
|
|
65
|
+
|
|
66
|
+
A theme sets seed tokens; labels, fills, separators, materials, shadows and states derive from them. Every color is written with `light-dark()`, and `data-scheme="light" | "dark"` pins a scheme for a subtree.
|
|
67
|
+
|
|
68
|
+
```css
|
|
69
|
+
[data-theme="harbor"] {
|
|
70
|
+
--mb-accent: light-dark(#0b6e99, #3fb3e6);
|
|
71
|
+
--mb-on-accent: light-dark(#ffffff, #04202e);
|
|
72
|
+
--mb-accent-text: light-dark(#0a5f85, #6cc7ef);
|
|
73
|
+
--mb-radius-scale: 1.1;
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Or from TypeScript:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { contrastRatio, createTheme, themeVariables } from "macbetter/theme"
|
|
81
|
+
|
|
82
|
+
const css = createTheme("harbor", { accent: { light: "#0b6e99", dark: "#3fb3e6" } })
|
|
83
|
+
const style = themeVariables({ accent: "#0b6e99" }) // for a style prop, alongside data-theme
|
|
84
|
+
contrastRatio("#0a5f85", "#ffffff") // 7.03
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Seeds: `--mb-accent`, `--mb-on-accent`, `--mb-accent-text`, `--mb-accent-secondary`, `--mb-ink`, `--mb-bg`, `--mb-bg-secondary`, `--mb-bg-tertiary`, `--mb-bg-elevated`, `--mb-bg-sidebar`, `--mb-tint`, the twelve system colors (`--mb-red` … `--mb-brown`), `--mb-radius-scale`, `--mb-font`, `--mb-font-display`, `--mb-font-rounded` and `--mb-font-mono`.
|
|
88
|
+
|
|
89
|
+
Built-in themes: `ember` (the default), `system`, `nebula` and `graphite`. Check that text holds 4.5:1 and control edges 3:1 in light and dark.
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
Apache 2.0 © Kyle Ledbetter
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Button as ButtonPrimitive } from "@ui-sdk/react/button";
|
|
2
|
+
import { Toggle as TogglePrimitive } from "@ui-sdk/react/toggle";
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
type AccessoryTint = "yellow" | "orange" | "red" | "green" | "teal" | "blue" | "indigo" | "purple" | "accent" | "neutral";
|
|
5
|
+
type AccessoryTileState = "unreachable" | "updating" | "alert";
|
|
6
|
+
type AccessoryTileProps = Omit<React.ComponentProps<"div">, "children"> & {
|
|
7
|
+
/** The icon's color while the accessory is on. Lights are yellow in the Home app. */
|
|
8
|
+
tint?: AccessoryTint;
|
|
9
|
+
/** `sm` is the square icon-only tile, `md` the wide tile with a name and status, `lg` the large square tile. */
|
|
10
|
+
size?: "sm" | "md" | "lg";
|
|
11
|
+
/** `unreachable` is "No Response"; `alert` is a sensor that detected a leak, smoke or carbon monoxide. */
|
|
12
|
+
state?: AccessoryTileState;
|
|
13
|
+
/** Shows the on look for a tile without a toggle, like an open door or a sensor that detected motion. */
|
|
14
|
+
active?: boolean;
|
|
15
|
+
/** A group with some of its members on. */
|
|
16
|
+
partial?: boolean;
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
icon?: React.ReactNode;
|
|
19
|
+
name?: React.ReactNode;
|
|
20
|
+
room?: React.ReactNode;
|
|
21
|
+
status?: React.ReactNode;
|
|
22
|
+
pressed?: boolean;
|
|
23
|
+
defaultPressed?: boolean;
|
|
24
|
+
onPressedChange?: React.ComponentProps<typeof TogglePrimitive>["onPressedChange"];
|
|
25
|
+
/** Names the icon button. Defaults to the name, when it's a string. */
|
|
26
|
+
toggleLabel?: string;
|
|
27
|
+
/** Runs when the name side of the tile is pressed: show the accessory's controls. */
|
|
28
|
+
onOpen?: () => void;
|
|
29
|
+
/** `false` for an accessory with nothing to switch, like a sensor. The whole tile opens its details. */
|
|
30
|
+
toggleable?: boolean;
|
|
31
|
+
};
|
|
32
|
+
declare function AccessoryTile({ tint, size, state, active, partial, className, children, icon, name, room, status, pressed, defaultPressed, onPressedChange, toggleLabel, onOpen, toggleable, ...props }: AccessoryTileProps): React.JSX.Element;
|
|
33
|
+
/** The icon side of the tile: a toggle that turns the accessory on or off. Name it with the accessory's name. */
|
|
34
|
+
declare function AccessoryTileToggle({ className, children, ...props }: React.ComponentProps<typeof TogglePrimitive>): React.JSX.Element;
|
|
35
|
+
/** The icon of a tile that has nothing to switch, like a sensor. */
|
|
36
|
+
declare function AccessoryTileIcon({ className, children, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
37
|
+
/**
|
|
38
|
+
* The name side of the tile. It covers the whole tile under the icon, so a press
|
|
39
|
+
* anywhere but the icon shows the controls. Pass it as a trigger's `render`.
|
|
40
|
+
*/
|
|
41
|
+
declare function AccessoryTileDetail({ className, ...props }: React.ComponentProps<typeof ButtonPrimitive>): React.JSX.Element;
|
|
42
|
+
declare function AccessoryTileName({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
43
|
+
/** The room, for tiles shown outside their room: in Favorites or a category. */
|
|
44
|
+
declare function AccessoryTileRoom({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
45
|
+
/** The state in words: "Off", "80%", "Locked", "No Response". */
|
|
46
|
+
declare function AccessoryTileStatus({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
47
|
+
/** The Home tab's grid: four columns on iPhone, as many as fit on iPad and Mac. */
|
|
48
|
+
declare function AccessoryGrid({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
49
|
+
export { AccessoryGrid, AccessoryTile, AccessoryTileDetail, AccessoryTileIcon, AccessoryTileName, AccessoryTileRoom, AccessoryTileStatus, AccessoryTileToggle, };
|
|
50
|
+
export type { AccessoryTileProps, AccessoryTileState, AccessoryTint };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button as ButtonPrimitive } from "@ui-sdk/react/button";
|
|
4
|
+
import { Toggle as TogglePrimitive } from "@ui-sdk/react/toggle";
|
|
5
|
+
import { cx, join } from "../lib/cx.js";
|
|
6
|
+
import { ActivityIndicator } from "./activity-indicator.js";
|
|
7
|
+
function AccessoryTile({ tint = "accent", size = "md", state, active, partial, className, children, icon, name, room, status, pressed, defaultPressed, onPressedChange, toggleLabel, onOpen, toggleable = true, ...props }) {
|
|
8
|
+
const label = toggleLabel ?? (typeof name === "string" ? name : undefined);
|
|
9
|
+
const shownStatus = status ?? (state === "unreachable" ? "No Response" : undefined);
|
|
10
|
+
const text = (_jsxs(_Fragment, { children: [_jsx(AccessoryTileName, { children: name }), room ? _jsx(AccessoryTileRoom, { children: room }) : null, shownStatus ? _jsx(AccessoryTileStatus, { children: shownStatus }) : null] }));
|
|
11
|
+
return (_jsx("div", { "data-tint": tint, "data-size": size, "data-state": state, "data-active": active ? "" : undefined, "data-partial": partial ? "" : undefined, "aria-busy": state === "updating" ? true : undefined, className: join("mb-accessory-tile", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [toggleable ? (_jsx(AccessoryTileToggle, { "aria-label": label, pressed: pressed, defaultPressed: defaultPressed, onPressedChange: onPressedChange, disabled: state === "unreachable", focusableWhenDisabled: true, children: icon })) : (_jsx(AccessoryTileIcon, { children: icon })), onOpen ? (_jsx(AccessoryTileDetail, { onClick: onOpen, children: text })) : (_jsx("div", { className: "mb-accessory-tile-detail", children: text })), state === "updating" ? _jsx(AccessoryTileSpinner, {}) : null] })) }));
|
|
12
|
+
}
|
|
13
|
+
/** The icon side of the tile: a toggle that turns the accessory on or off. Name it with the accessory's name. */
|
|
14
|
+
function AccessoryTileToggle({ className, children, ...props }) {
|
|
15
|
+
return (_jsx(TogglePrimitive, { className: cx("mb-accessory-tile-toggle", className), ...props, children: typeof children === "function" ? children : _jsx("span", { className: "mb-accessory-tile-glyph", "aria-hidden": "true", children: children }) }));
|
|
16
|
+
}
|
|
17
|
+
/** The icon of a tile that has nothing to switch, like a sensor. */
|
|
18
|
+
function AccessoryTileIcon({ className, children, ...props }) {
|
|
19
|
+
return (_jsx("span", { "aria-hidden": "true", className: join("mb-accessory-tile-icon", className), ...props, children: _jsx("span", { className: "mb-accessory-tile-glyph", children: children }) }));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The name side of the tile. It covers the whole tile under the icon, so a press
|
|
23
|
+
* anywhere but the icon shows the controls. Pass it as a trigger's `render`.
|
|
24
|
+
*/
|
|
25
|
+
function AccessoryTileDetail({ className, ...props }) {
|
|
26
|
+
return _jsx(ButtonPrimitive, { className: cx("mb-accessory-tile-detail", className), ...props });
|
|
27
|
+
}
|
|
28
|
+
function AccessoryTileName({ className, ...props }) {
|
|
29
|
+
return _jsx("span", { className: join("mb-accessory-tile-name", className), ...props });
|
|
30
|
+
}
|
|
31
|
+
/** The room, for tiles shown outside their room: in Favorites or a category. */
|
|
32
|
+
function AccessoryTileRoom({ className, ...props }) {
|
|
33
|
+
return _jsx("span", { className: join("mb-accessory-tile-room", className), ...props });
|
|
34
|
+
}
|
|
35
|
+
/** The state in words: "Off", "80%", "Locked", "No Response". */
|
|
36
|
+
function AccessoryTileStatus({ className, ...props }) {
|
|
37
|
+
return _jsx("span", { className: join("mb-accessory-tile-status", className), ...props });
|
|
38
|
+
}
|
|
39
|
+
function AccessoryTileSpinner() {
|
|
40
|
+
return _jsx(ActivityIndicator, { size: "sm", "aria-label": "Updating", className: "mb-accessory-tile-spinner" });
|
|
41
|
+
}
|
|
42
|
+
/** The Home tab's grid: four columns on iPhone, as many as fit on iPad and Mac. */
|
|
43
|
+
function AccessoryGrid({ className, ...props }) {
|
|
44
|
+
return _jsx("div", { className: join("mb-accessory-grid", className), ...props });
|
|
45
|
+
}
|
|
46
|
+
export { AccessoryGrid, AccessoryTile, AccessoryTileDetail, AccessoryTileIcon, AccessoryTileName, AccessoryTileRoom, AccessoryTileStatus, AccessoryTileToggle, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Progress as ProgressPrimitive } from "@ui-sdk/react/progress";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
type ActivityIndicatorProps = Omit<React.ComponentProps<typeof ProgressPrimitive>, "value" | "children"> & {
|
|
4
|
+
size?: "sm" | "md" | "lg";
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The Apple spinner: eight spokes that light in turn around the circle, each
|
|
8
|
+
* fading as the next one lights. It keeps turning under Reduce Motion, as the
|
|
9
|
+
* system one does, because the motion is the message. It's an
|
|
10
|
+
* indeterminate progress bar to assistive technology, named "Loading" unless
|
|
11
|
+
* you give it a label.
|
|
12
|
+
*/
|
|
13
|
+
declare function ActivityIndicator({ size, className, "aria-label": label, ...props }: ActivityIndicatorProps): React.JSX.Element;
|
|
14
|
+
export { ActivityIndicator };
|
|
15
|
+
export type { ActivityIndicatorProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Progress as ProgressPrimitive } from "@ui-sdk/react/progress";
|
|
3
|
+
import { cx } from "../lib/cx.js";
|
|
4
|
+
const spokes = [0, 1, 2, 3, 4, 5, 6, 7];
|
|
5
|
+
/**
|
|
6
|
+
* The Apple spinner: eight spokes that light in turn around the circle, each
|
|
7
|
+
* fading as the next one lights. It keeps turning under Reduce Motion, as the
|
|
8
|
+
* system one does, because the motion is the message. It's an
|
|
9
|
+
* indeterminate progress bar to assistive technology, named "Loading" unless
|
|
10
|
+
* you give it a label.
|
|
11
|
+
*/
|
|
12
|
+
function ActivityIndicator({ size = "md", className, "aria-label": label, ...props }) {
|
|
13
|
+
return (_jsx(ProgressPrimitive, { value: null, "aria-label": props["aria-labelledby"] ? label : (label ?? "Loading"), "data-size": size, className: cx("mb-activity-indicator", className), ...props, children: _jsx("svg", { "aria-hidden": "true", viewBox: "0 0 100 100", className: "mb-activity-indicator-spokes", children: spokes.map((index) => (_jsx("rect", { x: "45", y: "5", width: "10", height: "25", rx: "5", transform: `rotate(${index * 45} 50 50)`, style: { animationDelay: `calc(var(--mb-activity-indicator-duration) * ${(index - 8) / 8})` } }, index))) }) }));
|
|
14
|
+
}
|
|
15
|
+
export { ActivityIndicator };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogTitle, AlertDialogTrigger } from "@ui-sdk/react/alert-dialog";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
type AlertProps = React.ComponentProps<typeof AlertDialog>;
|
|
4
|
+
declare function Alert(props: AlertProps): React.JSX.Element;
|
|
5
|
+
declare function AlertTrigger(props: React.ComponentProps<typeof AlertDialogTrigger>): React.JSX.Element;
|
|
6
|
+
type AlertContentProps<Payload = unknown> = React.ComponentProps<typeof AlertDialogContent<Payload>> & {
|
|
7
|
+
/** `sheet` docks an iOS action sheet to the bottom of the screen. macOS always shows an alert. */
|
|
8
|
+
variant?: "alert" | "sheet";
|
|
9
|
+
};
|
|
10
|
+
declare function AlertContent<Payload = unknown>({ variant, className, ...props }: AlertContentProps<Payload>): React.JSX.Element;
|
|
11
|
+
/** The app icon macOS shows above the title. Hidden on iOS and iPadOS, where alerts carry none. */
|
|
12
|
+
declare function AlertIcon({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
13
|
+
declare function AlertTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogTitle>): React.JSX.Element;
|
|
14
|
+
declare function AlertDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogDescription>): React.JSX.Element;
|
|
15
|
+
type AlertActionsProps = React.ComponentProps<"div"> & {
|
|
16
|
+
/** `auto` puts two buttons side by side and stacks three or more, as the system does. */
|
|
17
|
+
orientation?: "auto" | "horizontal" | "vertical";
|
|
18
|
+
};
|
|
19
|
+
declare function AlertActions({ orientation, className, ...props }: AlertActionsProps): React.JSX.Element;
|
|
20
|
+
type AlertActionProps = React.ComponentProps<typeof AlertDialogClose> & {
|
|
21
|
+
/** `primary` is the default action (Return). `cancel` goes last in a stack and stands apart in an action sheet. */
|
|
22
|
+
variant?: "default" | "primary" | "cancel";
|
|
23
|
+
tone?: "accent" | "destructive";
|
|
24
|
+
};
|
|
25
|
+
declare function AlertAction({ variant, tone, className, ...props }: AlertActionProps): React.JSX.Element;
|
|
26
|
+
export { confirm, createAlertDialogController, createConfirm } from "@ui-sdk/react/alert-dialog";
|
|
27
|
+
export type { ConfirmOptions } from "@ui-sdk/react/alert-dialog";
|
|
28
|
+
export { Alert, AlertAction, AlertActions, AlertContent, AlertDescription, AlertIcon, AlertTitle, AlertTrigger };
|
|
29
|
+
export type { AlertActionProps, AlertActionsProps, AlertContentProps, AlertProps };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogTitle, AlertDialogTrigger, } from "@ui-sdk/react/alert-dialog";
|
|
3
|
+
import { cx, join } from "../lib/cx.js";
|
|
4
|
+
function Alert(props) {
|
|
5
|
+
return _jsx(AlertDialog, { ...props });
|
|
6
|
+
}
|
|
7
|
+
function AlertTrigger(props) {
|
|
8
|
+
return _jsx(AlertDialogTrigger, { ...props });
|
|
9
|
+
}
|
|
10
|
+
function AlertContent({ variant = "alert", className, ...props }) {
|
|
11
|
+
return (_jsxs(_Fragment, { children: [_jsx(AlertDialogBackdrop, { className: "mb-alert-backdrop" }), _jsx(AlertDialogContent, { "data-variant": variant, className: cx("mb-alert", className), ...props })] }));
|
|
12
|
+
}
|
|
13
|
+
/** The app icon macOS shows above the title. Hidden on iOS and iPadOS, where alerts carry none. */
|
|
14
|
+
function AlertIcon({ className, ...props }) {
|
|
15
|
+
return _jsx("span", { "aria-hidden": "true", className: join("mb-alert-icon", className), ...props });
|
|
16
|
+
}
|
|
17
|
+
function AlertTitle({ className, ...props }) {
|
|
18
|
+
return _jsx(AlertDialogTitle, { className: cx("mb-alert-title", className), ...props });
|
|
19
|
+
}
|
|
20
|
+
function AlertDescription({ className, ...props }) {
|
|
21
|
+
return _jsx(AlertDialogDescription, { className: cx("mb-alert-description", className), ...props });
|
|
22
|
+
}
|
|
23
|
+
function AlertActions({ orientation = "auto", className, ...props }) {
|
|
24
|
+
return _jsx("div", { "data-orientation": orientation, className: join("mb-alert-actions", className), ...props });
|
|
25
|
+
}
|
|
26
|
+
function AlertAction({ variant = "default", tone = "accent", className, ...props }) {
|
|
27
|
+
return (_jsx(AlertDialogClose, { "data-variant": variant, "data-tone": tone, className: cx("mb-alert-action", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
export { confirm, createAlertDialogController, createConfirm } from "@ui-sdk/react/alert-dialog";
|
|
30
|
+
export { Alert, AlertAction, AlertActions, AlertContent, AlertDescription, AlertIcon, AlertTitle, AlertTrigger };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const artworkVariants: readonly ["aurora", "bloom", "orbit", "strata", "prism", "halftone", "rays", "glyph", "ribbon", "topo", "grain", "mosaic", "wash", "horizon", "window", "lens"];
|
|
3
|
+
/** The variants made to sit behind an interface: soft, low in contrast, flat by default. */
|
|
4
|
+
declare const artworkBackgrounds: readonly ["wash", "horizon", "window", "lens"];
|
|
5
|
+
declare const artworkTimes: readonly ["dawn", "day", "dusk", "night"];
|
|
6
|
+
declare const artworkPalettes: readonly ["accent", "sunset", "ocean", "forest", "berry", "citrus", "dusk", "ember", "glacier", "candy", "mono", "dawn", "sky", "night", "amber", "water", "slate"];
|
|
7
|
+
type ArtworkVariant = (typeof artworkVariants)[number];
|
|
8
|
+
type ArtworkPalette = (typeof artworkPalettes)[number];
|
|
9
|
+
type ArtworkTime = (typeof artworkTimes)[number];
|
|
10
|
+
type ArtworkShape = "square" | "rounded" | "circle" | "app";
|
|
11
|
+
type ArtworkFinish = "flat" | "gloss" | "grain";
|
|
12
|
+
type ArtworkProps = Omit<React.ComponentProps<"span">, "title"> & {
|
|
13
|
+
/** Same seed, same picture, on the server and in the browser. */
|
|
14
|
+
seed: string | number;
|
|
15
|
+
/** `auto` picks one from the seed. */
|
|
16
|
+
variant?: ArtworkVariant | "auto";
|
|
17
|
+
/** System colors the art is painted with, so it follows the theme. `auto` picks one from the seed. */
|
|
18
|
+
palette?: ArtworkPalette | "auto";
|
|
19
|
+
/** Your own CSS colors in place of a palette: up to four hues, then an optional ground. */
|
|
20
|
+
colors?: readonly string[];
|
|
21
|
+
shape?: ArtworkShape;
|
|
22
|
+
/** Corner radius, in pixels or any CSS length. Overrides `shape`. */
|
|
23
|
+
radius?: number | string;
|
|
24
|
+
/** Width over height. */
|
|
25
|
+
aspect?: number;
|
|
26
|
+
/** Width, in pixels or any CSS length. Fills its container when left out. */
|
|
27
|
+
size?: number | string;
|
|
28
|
+
/** `gloss` adds a soft top light and vignette; `grain` adds film grain on top. Covers default to `gloss`, backgrounds to `flat`. */
|
|
29
|
+
finish?: ArtworkFinish;
|
|
30
|
+
/** A slow drift of the shapes. Pauses under Reduce Motion. */
|
|
31
|
+
animated?: boolean;
|
|
32
|
+
/** Names the picture and makes it an image. Without it or `aria-label` the art is decorative. */
|
|
33
|
+
title?: string;
|
|
34
|
+
/** The light in a background: where `horizon` puts its sun, and the palette when none is given. */
|
|
35
|
+
time?: ArtworkTime;
|
|
36
|
+
/** How far the art recedes behind content, from 0 to 1: it's veiled with the page's background color. */
|
|
37
|
+
dim?: number;
|
|
38
|
+
};
|
|
39
|
+
/** An abstract picture drawn from a seed: album and playlist covers, card headers, placeholders. */
|
|
40
|
+
declare function Artwork(props: ArtworkProps): React.JSX.Element;
|
|
41
|
+
/** Artwork without hooks, for renderers that can't run them, like social images drawn at build time. */
|
|
42
|
+
declare function renderArtwork({ seed, variant, palette, colors, shape, radius, aspect, size, finish: finishProp, animated, title, time, dim, id, className, style, children, "aria-label": ariaLabel, ...props }: ArtworkProps, reactId: string): React.JSX.Element;
|
|
43
|
+
export { Artwork, artworkBackgrounds, artworkPalettes, artworkTimes, artworkVariants, renderArtwork };
|
|
44
|
+
export type { ArtworkFinish, ArtworkPalette, ArtworkProps, ArtworkShape, ArtworkTime, ArtworkVariant };
|