@f-ewald/components 0.1.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 (102) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +147 -0
  3. package/custom-elements.json +3398 -0
  4. package/dist/address-autocomplete.d.ts +75 -0
  5. package/dist/address-autocomplete.d.ts.map +1 -0
  6. package/dist/address-autocomplete.js +342 -0
  7. package/dist/address-autocomplete.js.map +1 -0
  8. package/dist/animate-confetti.d.ts +53 -0
  9. package/dist/animate-confetti.d.ts.map +1 -0
  10. package/dist/animate-confetti.js +180 -0
  11. package/dist/animate-confetti.js.map +1 -0
  12. package/dist/autocomplete-input.d.ts +73 -0
  13. package/dist/autocomplete-input.d.ts.map +1 -0
  14. package/dist/autocomplete-input.js +309 -0
  15. package/dist/autocomplete-input.js.map +1 -0
  16. package/dist/confirm-dialog.d.ts +36 -0
  17. package/dist/confirm-dialog.d.ts.map +1 -0
  18. package/dist/confirm-dialog.js +191 -0
  19. package/dist/confirm-dialog.js.map +1 -0
  20. package/dist/copy-link-button.d.ts +27 -0
  21. package/dist/copy-link-button.d.ts.map +1 -0
  22. package/dist/copy-link-button.js +84 -0
  23. package/dist/copy-link-button.js.map +1 -0
  24. package/dist/distance-value.d.ts +24 -0
  25. package/dist/distance-value.d.ts.map +1 -0
  26. package/dist/distance-value.js +50 -0
  27. package/dist/distance-value.js.map +1 -0
  28. package/dist/distribution-chart.d.ts +52 -0
  29. package/dist/distribution-chart.d.ts.map +1 -0
  30. package/dist/distribution-chart.js +299 -0
  31. package/dist/distribution-chart.js.map +1 -0
  32. package/dist/icons.d.ts +32 -0
  33. package/dist/icons.d.ts.map +1 -0
  34. package/dist/icons.js +35 -0
  35. package/dist/icons.js.map +1 -0
  36. package/dist/index.d.ts +18 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/index.js +18 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/percent-bar-chart.d.ts +29 -0
  41. package/dist/percent-bar-chart.d.ts.map +1 -0
  42. package/dist/percent-bar-chart.js +92 -0
  43. package/dist/percent-bar-chart.js.map +1 -0
  44. package/dist/price-history-chart.d.ts +39 -0
  45. package/dist/price-history-chart.d.ts.map +1 -0
  46. package/dist/price-history-chart.js +217 -0
  47. package/dist/price-history-chart.js.map +1 -0
  48. package/dist/relative-time.d.ts +26 -0
  49. package/dist/relative-time.d.ts.map +1 -0
  50. package/dist/relative-time.js +64 -0
  51. package/dist/relative-time.js.map +1 -0
  52. package/dist/reveal-button.d.ts +19 -0
  53. package/dist/reveal-button.d.ts.map +1 -0
  54. package/dist/reveal-button.js +62 -0
  55. package/dist/reveal-button.js.map +1 -0
  56. package/dist/roman-numeral.d.ts +18 -0
  57. package/dist/roman-numeral.d.ts.map +1 -0
  58. package/dist/roman-numeral.js +54 -0
  59. package/dist/roman-numeral.js.map +1 -0
  60. package/dist/slide-panel.d.ts +27 -0
  61. package/dist/slide-panel.d.ts.map +1 -0
  62. package/dist/slide-panel.js +149 -0
  63. package/dist/slide-panel.js.map +1 -0
  64. package/dist/toast-notification.d.ts +53 -0
  65. package/dist/toast-notification.d.ts.map +1 -0
  66. package/dist/toast-notification.js +173 -0
  67. package/dist/toast-notification.js.map +1 -0
  68. package/dist/tokens.css +21 -0
  69. package/dist/tokens.d.ts +16 -0
  70. package/dist/tokens.d.ts.map +1 -0
  71. package/dist/tokens.js +79 -0
  72. package/dist/tokens.js.map +1 -0
  73. package/dist/utils/distance.d.ts +11 -0
  74. package/dist/utils/distance.d.ts.map +1 -0
  75. package/dist/utils/distance.js +25 -0
  76. package/dist/utils/distance.js.map +1 -0
  77. package/dist/utils/time.d.ts +10 -0
  78. package/dist/utils/time.d.ts.map +1 -0
  79. package/dist/utils/time.js +33 -0
  80. package/dist/utils/time.js.map +1 -0
  81. package/dist/weight-bar-chart.d.ts +29 -0
  82. package/dist/weight-bar-chart.d.ts.map +1 -0
  83. package/dist/weight-bar-chart.js +96 -0
  84. package/dist/weight-bar-chart.js.map +1 -0
  85. package/docs/address-autocomplete.md +68 -0
  86. package/docs/animate-confetti.md +34 -0
  87. package/docs/autocomplete-input.md +79 -0
  88. package/docs/confirm-dialog.md +65 -0
  89. package/docs/copy-link-button.md +46 -0
  90. package/docs/distance-value.md +38 -0
  91. package/docs/distribution-chart.md +51 -0
  92. package/docs/mcp-evaluation.md +31 -0
  93. package/docs/percent-bar-chart.md +40 -0
  94. package/docs/price-history-chart.md +44 -0
  95. package/docs/relative-time.md +37 -0
  96. package/docs/reveal-button.md +43 -0
  97. package/docs/roman-numeral.md +33 -0
  98. package/docs/slide-panel.md +56 -0
  99. package/docs/toast-notification.md +52 -0
  100. package/docs/weight-bar-chart.md +53 -0
  101. package/llms.txt +361 -0
  102. package/package.json +69 -0
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024 Friedrich Ewald. All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,147 @@
1
+ # @f-ewald/components
2
+
3
+ [![npm](https://img.shields.io/npm/v/@f-ewald/components)](https://www.npmjs.com/package/@f-ewald/components)
4
+ [![license](https://img.shields.io/badge/license-BSD--3--Clause-blue)](./LICENSE)
5
+
6
+ A collection of self-contained [Lit](https://lit.dev) web components sharing a
7
+ Tailwind-inspired design token system. Every component is individually
8
+ importable and ships its own TypeScript types plus a checked-in
9
+ [`custom-elements.json`](./custom-elements.json) manifest.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install @f-ewald/components
15
+ ```
16
+
17
+ ## Quick start
18
+
19
+ Import the whole library (registers every component):
20
+
21
+ ```js
22
+ import "@f-ewald/components";
23
+ ```
24
+
25
+ ...or import components individually — this tree-shakes everything else,
26
+ including the `d3` dependency used only by the chart components:
27
+
28
+ ```js
29
+ import "@f-ewald/components/confirm-dialog.js";
30
+ import "@f-ewald/components/roman-numeral.js";
31
+ ```
32
+
33
+ ```html
34
+ <confirm-dialog open confirm-label="Delete" cancel-label="Cancel">
35
+ Are you sure you want to delete this item?
36
+ </confirm-dialog>
37
+ <roman-numeral value="2004"></roman-numeral>
38
+ ```
39
+
40
+ ## Components
41
+
42
+ | Component | Docs |
43
+ | --- | --- |
44
+ | `<address-autocomplete>` | [docs/address-autocomplete.md](./docs/address-autocomplete.md) |
45
+ | `<animate-confetti>` | [docs/animate-confetti.md](./docs/animate-confetti.md) |
46
+ | `<autocomplete-input>` | [docs/autocomplete-input.md](./docs/autocomplete-input.md) |
47
+ | `<confirm-dialog>` | [docs/confirm-dialog.md](./docs/confirm-dialog.md) |
48
+ | `<copy-link-button>` | [docs/copy-link-button.md](./docs/copy-link-button.md) |
49
+ | `<distance-value>` | [docs/distance-value.md](./docs/distance-value.md) |
50
+ | `<distribution-chart>` | [docs/distribution-chart.md](./docs/distribution-chart.md) |
51
+ | `<percent-bar-chart>` | [docs/percent-bar-chart.md](./docs/percent-bar-chart.md) |
52
+ | `<price-history-chart>` | [docs/price-history-chart.md](./docs/price-history-chart.md) |
53
+ | `<relative-time>` | [docs/relative-time.md](./docs/relative-time.md) |
54
+ | `<reveal-button>` | [docs/reveal-button.md](./docs/reveal-button.md) |
55
+ | `<roman-numeral>` | [docs/roman-numeral.md](./docs/roman-numeral.md) |
56
+ | `<slide-panel>` | [docs/slide-panel.md](./docs/slide-panel.md) |
57
+ | `<toast-notification>` | [docs/toast-notification.md](./docs/toast-notification.md) |
58
+ | `<weight-bar-chart>` | [docs/weight-bar-chart.md](./docs/weight-bar-chart.md) |
59
+
60
+ Each doc lists the component's attributes/properties, events, slots, and the
61
+ `--ui-*` CSS custom properties it consumes. For a machine-readable summary of
62
+ the whole library in one file, see [`llms.txt`](./llms.txt).
63
+
64
+ ## Theming
65
+
66
+ Components use Lit `css` with `var(--ui-*, <fallback>)` custom properties, so
67
+ they render correctly out of the box with **zero external CSS** — every
68
+ token has a sensible default baked in as the `var()` fallback.
69
+
70
+ To retheme, override any `--ui-*` custom property on `:root` (or a closer
71
+ ancestor):
72
+
73
+ ```css
74
+ :root {
75
+ --ui-primary: #0ea5e9;
76
+ --ui-radius: 0.75rem;
77
+ }
78
+ ```
79
+
80
+ Or import the generated stylesheet as a starting point and edit it:
81
+
82
+ ```js
83
+ import "@f-ewald/components/tokens.css";
84
+ ```
85
+
86
+ The full token set is defined in [`src/tokens.ts`](./src/tokens.ts).
87
+
88
+ ## Playground / development
89
+
90
+ ```bash
91
+ npm install
92
+ npm run dev
93
+ ```
94
+
95
+ Opens a live playground (`index.html`) with a rendered, hand-testable example
96
+ of every component, plus a copy-paste usage snippet for each. Component
97
+ sources are imported directly from `src/`, so edits hot-reload.
98
+
99
+ ```bash
100
+ npm run build:demo # static build of the playground, into demo-dist/
101
+ ```
102
+
103
+ ## Development commands
104
+
105
+ | Command | Purpose |
106
+ | --- | --- |
107
+ | `npm run dev` | Start the Vite playground with HMR. |
108
+ | `npm run build` | Compile `src/` with `tsc` into `dist/`, and generate `dist/tokens.css`. |
109
+ | `npm run build:demo` | Build the static playground into `demo-dist/`. |
110
+ | `npm run icons` | Regenerate `src/icons.ts` from the Heroicons package. |
111
+ | `npm run analyze` | Regenerate `custom-elements.json` via the custom-elements-manifest analyzer. |
112
+ | `npm run docs` | Regenerate the manifest, `docs/*.md`, and `llms.txt`. |
113
+ | `npm run test` | Run the Playwright suite against the playground. |
114
+
115
+ ## Contributing
116
+
117
+ - New components live in `src/`, are exported from `src/index.ts`, restyled
118
+ to the `--ui-*` design tokens, and get a playground section (`index.html`)
119
+ and a Playwright spec (`tests/`). See [`CLAUDE.md`](./CLAUDE.md) for the
120
+ full checklist.
121
+ - Relative imports within `src/` must use `.js` specifiers (not `.ts`), so
122
+ the `tsc`-emitted `dist/` output resolves correctly for consumers.
123
+ - Run `npm run docs` after changing any component's public API so the
124
+ generated docs and `llms.txt` stay in sync.
125
+
126
+ ## Publishing
127
+
128
+ First publish (package is not yet on the npm registry):
129
+
130
+ ```bash
131
+ npm login # if needed
132
+ npm publish --access public
133
+ ```
134
+
135
+ Subsequent releases:
136
+
137
+ ```bash
138
+ npm version <patch|minor|major>
139
+ npm publish
140
+ ```
141
+
142
+ `prepublishOnly` runs `build`, `docs`, and `test` automatically before every
143
+ publish.
144
+
145
+ ## License
146
+
147
+ [BSD-3-Clause](./LICENSE)