@andrilla/mado-ui 1.0.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.
Files changed (89) hide show
  1. package/README.md +196 -0
  2. package/dist/client.cjs +9163 -0
  3. package/dist/client.esm.js +9045 -0
  4. package/dist/components/button.d.ts +83 -0
  5. package/dist/components/checkbox.d.ts +22 -0
  6. package/dist/components/details.d.ts +16 -0
  7. package/dist/components/drop-down.d.ts +32 -0
  8. package/dist/components/fieldset.d.ts +18 -0
  9. package/dist/components/form.d.ts +3 -0
  10. package/dist/components/ghost.d.ts +3 -0
  11. package/dist/components/heading.d.ts +19 -0
  12. package/dist/components/human-verification.d.ts +14 -0
  13. package/dist/components/iframe.d.ts +15 -0
  14. package/dist/components/index.d.ts +18 -0
  15. package/dist/components/input.d.ts +35 -0
  16. package/dist/components/link.d.ts +116 -0
  17. package/dist/components/modal.d.ts +18 -0
  18. package/dist/components/select.d.ts +80 -0
  19. package/dist/components/submit-button.d.ts +49 -0
  20. package/dist/components/textarea.d.ts +37 -0
  21. package/dist/components/time.d.ts +32 -0
  22. package/dist/components/tooltip.d.ts +54 -0
  23. package/dist/components/video.d.ts +30 -0
  24. package/dist/css/index.css +4551 -0
  25. package/dist/graphics/index.d.ts +1 -0
  26. package/dist/graphics/social-media/facebook-logo.d.ts +32 -0
  27. package/dist/graphics/social-media/google-logo.d.ts +12 -0
  28. package/dist/graphics/social-media/index.d.ts +7 -0
  29. package/dist/graphics/social-media/instagram-logo.d.ts +12 -0
  30. package/dist/graphics/social-media/linkedin-logo.d.ts +25 -0
  31. package/dist/graphics/social-media/tiktok-logo.d.ts +25 -0
  32. package/dist/graphics/social-media/x-logo.d.ts +5 -0
  33. package/dist/graphics/social-media/youtube-logo.d.ts +25 -0
  34. package/dist/hooks/create-fast-context.d.ts +10 -0
  35. package/dist/hooks/index.d.ts +3 -0
  36. package/dist/hooks/use-form-status.d.ts +10 -0
  37. package/dist/hooks/use-pointer-movement.d.ts +15 -0
  38. package/dist/icons/rectangle-triangle-up.d.ts +2 -0
  39. package/dist/index.cjs +9162 -0
  40. package/dist/index.d.ts +5 -0
  41. package/dist/mado-ui.esm.js +9044 -0
  42. package/dist/symbols/10.arrow.trianglehead.clockwise.d.ts +3 -0
  43. package/dist/symbols/10.arrow.trianglehead.counterclockwise.d.ts +3 -0
  44. package/dist/symbols/15.arrow.trianglehead.clockwise.d.ts +3 -0
  45. package/dist/symbols/15.arrow.trianglehead.counterclockwise.d.ts +3 -0
  46. package/dist/symbols/30.arrow.trianglehead.clockwise.d.ts +3 -0
  47. package/dist/symbols/30.arrow.trianglehead.counterclockwise.d.ts +3 -0
  48. package/dist/symbols/45.arrow.trianglehead.clockwise.d.ts +3 -0
  49. package/dist/symbols/45.arrow.trianglehead.counterclockwise.d.ts +3 -0
  50. package/dist/symbols/5.arrow.trianglehead.clockwise.d.ts +3 -0
  51. package/dist/symbols/5.arrow.trianglehead.counterclockwise.d.ts +3 -0
  52. package/dist/symbols/60.arrow.trianglehead.clockwise.d.ts +3 -0
  53. package/dist/symbols/60.arrow.trianglehead.counterclockwise.d.ts +3 -0
  54. package/dist/symbols/75.arrow.trianglehead.clockwise.d.ts +3 -0
  55. package/dist/symbols/75.arrow.trianglehead.counterclockwise.d.ts +3 -0
  56. package/dist/symbols/90.arrow.trianglehead.clockwise.d.ts +3 -0
  57. package/dist/symbols/90.arrow.trianglehead.counterclockwise.d.ts +3 -0
  58. package/dist/symbols/arrow.down.backward.and.arrow.up.forward.rectangle.d.ts +3 -0
  59. package/dist/symbols/arrow.down.backward.and.arrow.up.forward.rectangle.fill.d.ts +3 -0
  60. package/dist/symbols/arrow.down.forward.topleading.rectangle.fill.d.ts +3 -0
  61. package/dist/symbols/arrow.up.forward.and.arrow.down.backward.rectangle.d.ts +3 -0
  62. package/dist/symbols/calendar.d.ts +3 -0
  63. package/dist/symbols/checkmark.d.ts +3 -0
  64. package/dist/symbols/chevron.down.d.ts +3 -0
  65. package/dist/symbols/chevron.forward.d.ts +3 -0
  66. package/dist/symbols/chevron.up.chevron.down.d.ts +3 -0
  67. package/dist/symbols/circle.fill.d.ts +3 -0
  68. package/dist/symbols/clock.d.ts +3 -0
  69. package/dist/symbols/exclamationmark.octagon.d.ts +3 -0
  70. package/dist/symbols/gearshape.fill.d.ts +3 -0
  71. package/dist/symbols/pause.fill.d.ts +3 -0
  72. package/dist/symbols/photo.badge.arrow.down.fill.d.ts +3 -0
  73. package/dist/symbols/play.fill.d.ts +3 -0
  74. package/dist/symbols/plus.d.ts +3 -0
  75. package/dist/symbols/rectangle.fill.d.ts +3 -0
  76. package/dist/symbols/speaker.minus.fill.d.ts +3 -0
  77. package/dist/symbols/speaker.plus.fill.d.ts +3 -0
  78. package/dist/symbols/types.d.ts +5 -0
  79. package/dist/symbols/xmark.d.ts +3 -0
  80. package/dist/types/index.d.ts +1 -0
  81. package/dist/types.d.ts +34 -0
  82. package/dist/utils/class-management.d.ts +29 -0
  83. package/dist/utils/custom-tailwind-merge.d.ts +4 -0
  84. package/dist/utils/get-date.d.ts +170 -0
  85. package/dist/utils/index.d.ts +6 -0
  86. package/dist/utils/math.d.ts +1 -0
  87. package/dist/utils/regex.d.ts +12 -0
  88. package/dist/utils/string-manipulation.d.ts +74 -0
  89. package/package.json +66 -0
package/README.md ADDED
@@ -0,0 +1,196 @@
1
+ # 窓 <sup>(mado)</sup> UI
2
+
3
+ 窓 UI is a collection of opinionated React components built on Tailwind CSS 4.
4
+ It was originally created for use on websites built by Andrilla, but is now
5
+ available for anyone.
6
+
7
+ All of the components are built in similar ways, that always allow for
8
+ customization.
9
+
10
+ ## How to Use
11
+
12
+ In general it's best to download the latest versions of components to your
13
+ project, rather than using `npm i mado-ui`, so you can modify the colors to fit
14
+ your branding.
15
+
16
+ ### Install
17
+
18
+ Install or copy and paste the components you with to use.
19
+
20
+ ```bash
21
+ npm i mado-ui
22
+ ```
23
+
24
+ ```bash
25
+ pnpm add mado-ui
26
+ ```
27
+
28
+ ```bash
29
+ yarn add mado-ui
30
+ ```
31
+
32
+ ```bash
33
+ bun add mado-ui
34
+ ```
35
+
36
+ ```bash
37
+ deno add npm:mado-ui
38
+ ```
39
+
40
+ ### Add CSS
41
+
42
+ Import CSS above your tailwind import in your `globals.css`.
43
+
44
+ ```css
45
+ @import 'mado-ui/css';
46
+ ```
47
+
48
+ ## Tailwind Modifications and Additions
49
+
50
+ If you use the default `mado-ui/css` import, then you will have access to the
51
+ following classes, and you should expect some minor changes.
52
+
53
+ ### Modifications
54
+
55
+ You can review the `@layer base` to see these changes directly.
56
+
57
+ 1. All elements are positioned relatively by default, instead of static.
58
+ 2. Browser-defined minimum widths are removed.
59
+ 3. `:focus-visible` uses Tailwind's ring instead of outline.
60
+ 4. Default background and text colors are modified to `--color-neutral-50` and
61
+ `--color-neutral-950` respectively.
62
+ 5. `cursor: pointer;` is back on all buttons, in spite of Tailwind removing
63
+ this.
64
+ 6. Color inputs have removed browser default padding on
65
+ `::-webkit-color-swatch-wrapper`.
66
+ 7. Similar to borders, `<svg>` elements use `fill: currentColor;` as the
67
+ default.
68
+
69
+ ### Additions
70
+
71
+ These apply to `@layer theme`, `@layer components`, `@utility`, and
72
+ `@custom-variant` as mentioned.
73
+
74
+ 1. Animation utility classes.
75
+ 2. Modified animations to use the new utility classes.
76
+ 3. More animations.
77
+ 4. UI colors that work great in both light and dark mode.
78
+ 5. More easing options.
79
+ 6. More border radiuses.
80
+ 7. Change gap to use variables for easy reuse in children.
81
+ 8. New grid template rows and columns utility classes for 0fr to 1fr
82
+ transitions.
83
+ 9. Grid template rows and columns added as transition options.
84
+
85
+ ## Components
86
+
87
+ ### Button
88
+
89
+ A pre-styled button component with utility props for easy customization.
90
+ Supports both button and anchor functionality.
91
+
92
+ Exported from `mado-ui/button`:
93
+
94
+ Default export:
95
+
96
+ - Button
97
+
98
+ Props include `padding`, `rounded`, `theme`, and standard button/anchor
99
+ attributes.
100
+
101
+ #### Example
102
+
103
+ ```tsx
104
+ import Button from 'mado-ui/button'
105
+
106
+ <Button theme="primary" padding="md" rounded="lg">
107
+ Click me
108
+ </Button>
109
+
110
+ <Button href="/about" theme="blue-gradient">
111
+ Link Button
112
+ </Button>
113
+ ```
114
+
115
+ ### Form
116
+
117
+ Just a form component with `className="grid gap-3"`.
118
+
119
+ ### Ghost
120
+
121
+ A loading placeholder component with animated pulse effect.
122
+
123
+ ### Heading
124
+
125
+ A heading component that renders HTML heading elements (h1-h6) with appropriate
126
+ styling. Automatically generates IDs for targeting. Defaults to `h2`.
127
+
128
+ ### Input
129
+
130
+ A form input component with built-in validation CSS, labels, and descriptions.
131
+
132
+ ### Link
133
+
134
+ A link component with various animation styles and theming options. Supports
135
+ both single-line and multiline text. Automatically removes hashes after scrolling to anchor points.
136
+
137
+ #### Example
138
+
139
+ ```tsx
140
+ <Link href="/about" type="ltr" theme="blue">
141
+ Learn more
142
+ </Link>
143
+
144
+ <Link href="/contact" type="fill-center" theme="red">
145
+ Get in touch
146
+ </Link>
147
+ ```
148
+
149
+ ### Modal
150
+
151
+ A pre-built modal component based on @headlessui's Dialog. Handles transitions,
152
+ drag-to-close functionality, and backdrop interactions.
153
+
154
+ The Modal component must wrap both the ModalDialog and ModalTrigger components
155
+ to work.
156
+
157
+ #### Example
158
+
159
+ ```tsx
160
+ <Modal>
161
+ <ModalTrigger>Open Modal</ModalTrigger>
162
+ <ModalDialog>
163
+ <h2>Modal Content</h2>
164
+ <p>This is the modal content.</p>
165
+ </ModalDialog>
166
+ </Modal>
167
+ ```
168
+
169
+ ### SubmitButton
170
+
171
+ A specialized button for form submission with status-aware styling and content.
172
+
173
+ #### Example
174
+
175
+ ```tsx
176
+ <SubmitButton
177
+ formStatus={formStatus}
178
+ loading='Submitting…'
179
+ success='Form Submitted!'
180
+ error='Submission Failed'
181
+ >
182
+ Submit
183
+ </SubmitButton>
184
+ ```
185
+
186
+ ### Time
187
+
188
+ A time component that displays formatted dates and times with customizable
189
+ precision.
190
+
191
+ #### Example
192
+
193
+ ```tsx
194
+ <Time dateObject={new Date()} day month year hours minutes />
195
+ <Time dateTime='2024-01-01T12:00:00Z' />
196
+ ```