@ekanos/ui 0.1.1 → 0.1.3
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 +184 -26
- package/dist/ai-prompt-input.js +122 -816
- package/dist/base.css +116 -0
- package/dist/card.d.ts +1 -1
- package/dist/dialog.js +16 -716
- package/dist/dropdown-menu.js +26 -719
- package/dist/form.d.ts +2 -2
- package/dist/icon.js +27 -0
- package/dist/select.js +22 -722
- package/dist/styles.css +2159 -0
- package/dist/switch.d.ts +8 -0
- package/dist/switch.js +44 -0
- package/dist/textarea.d.ts +5 -0
- package/dist/textarea.js +25 -0
- package/dist/theme.css +221 -0
- package/dist/tokens.css +414 -0
- package/package.json +28 -15
package/dist/base.css
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @ekanos/ui — base rules the components depend on
|
|
3
|
+
* ------------------------------------------------------------------
|
|
4
|
+
* Plain CSS. Everything here is something a component's class strings assume
|
|
5
|
+
* about the page rather than state themselves. Kept deliberately short: a
|
|
6
|
+
* library stylesheet has no business restyling a host's page.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Default border colour.
|
|
11
|
+
*
|
|
12
|
+
* Tailwind's Preflight resets every element to `border: 0 solid`, which leaves
|
|
13
|
+
* `border-color` at `currentColor`. Several components then set only a border
|
|
14
|
+
* *width* and expect the theme colour: `Button variant="outline"` and
|
|
15
|
+
* `SelectTrigger` use a bare `border`, `Badge` uses `border border-transparent`.
|
|
16
|
+
* Without this rule those borders come out the colour of the label text.
|
|
17
|
+
*
|
|
18
|
+
* This is the same rule Fusion's own `@layer base` carries
|
|
19
|
+
* (the host's global stylesheet).
|
|
20
|
+
*/
|
|
21
|
+
*,
|
|
22
|
+
::after,
|
|
23
|
+
::before,
|
|
24
|
+
::backdrop,
|
|
25
|
+
::file-selector-button {
|
|
26
|
+
border-color: var(--border, currentColor);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
* Missing-icon placeholders.
|
|
31
|
+
*
|
|
32
|
+
* `@ekanos/ui/icon` renders Font Awesome markup — `<i class="fa-solid fa-house">`
|
|
33
|
+
* — and this package ships NO icon font. Fusion uses Font Awesome **Pro**,
|
|
34
|
+
* which is commercially licensed and cannot be redistributed inside an MIT
|
|
35
|
+
* package. See the README for what to load instead.
|
|
36
|
+
*
|
|
37
|
+
* That leaves two ways for an icon to come out blank, and both are silent, so
|
|
38
|
+
* there are two placeholders. Neither can change the rendering of a correctly
|
|
39
|
+
* licensed Pro host.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/*
|
|
43
|
+
* 1. No Font Awesome CSS at all. An `<i>` then has no content and no box, so
|
|
44
|
+
* icons render as *literally nothing* and a partner cannot tell "I forgot
|
|
45
|
+
* the icon font" apart from "my code is broken". This draws a placeholder
|
|
46
|
+
* box instead.
|
|
47
|
+
*
|
|
48
|
+
* `:where()` keeps the specificity at (0,0,1) — below Font Awesome's own
|
|
49
|
+
* `:is(…)::before` at (0,1,1) — so FA wins `content` outright the instant
|
|
50
|
+
* any Font Awesome stylesheet is present.
|
|
51
|
+
*
|
|
52
|
+
* BUT specificity only settles properties BOTH rules declare, and `content`
|
|
53
|
+
* is the ONLY one FA sets on `::before`. FA declares `font-family` and
|
|
54
|
+
* `font-weight` on the ELEMENT (`.fa-solid { font-family: var(--_fa-family) }`),
|
|
55
|
+
* never on the pseudo-element. So declaring them here left them uncontested
|
|
56
|
+
* at `::before` level — a declared value beats an inherited one regardless
|
|
57
|
+
* of specificity — and FA's correct codepoint got painted in system-ui,
|
|
58
|
+
* which has no glyph in the Private Use Area. The result was Chromium's
|
|
59
|
+
* missing-glyph hex box on every icon in any app that loads both this
|
|
60
|
+
* stylesheet and a real Font Awesome build.
|
|
61
|
+
*
|
|
62
|
+
* So this rule must NOT set the font. Inheriting is correct in both cases:
|
|
63
|
+
* with FA present the element carries the FA family and the glyph resolves;
|
|
64
|
+
* with FA absent the element inherits the body font, which does have U+25A1.
|
|
65
|
+
*
|
|
66
|
+
* Override the glyph with `--ekanos-icon-fallback` (any CSS <string>), or
|
|
67
|
+
* switch it off with `--ekanos-icon-fallback: ''`.
|
|
68
|
+
*/
|
|
69
|
+
:where(i[class*='fa-']) {
|
|
70
|
+
display: inline-block;
|
|
71
|
+
font-style: normal;
|
|
72
|
+
line-height: 1;
|
|
73
|
+
text-align: center;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:where(i[class*='fa-'])::before {
|
|
77
|
+
content: var(--ekanos-icon-fallback, '\25a1');
|
|
78
|
+
font-style: normal;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/*
|
|
82
|
+
* 2. Font Awesome Free IS loaded, but the requested glyph is Pro-only. Free
|
|
83
|
+
* covers `fa-solid` / `fa-regular` / `fa-brands`; it has no `fa-light` or
|
|
84
|
+
* `fa-duotone` families and is missing many Pro glyphs — including
|
|
85
|
+
* `fa-light fa-shapes`, which is what this package's icon resolver falls
|
|
86
|
+
* back to for an unmapped name. Font Awesome drives its glyphs off a per-icon
|
|
87
|
+
* `--fa` custom property (`.fa-house { --fa: '\f015' }`) and renders
|
|
88
|
+
* `content: var(--fa)`, so a glyph Free doesn't define leaves `--fa` unset
|
|
89
|
+
* and `content` invalid — nothing renders, again silently.
|
|
90
|
+
*
|
|
91
|
+
* Giving `--fa` a zero-specificity default fixes that: any real Font Awesome
|
|
92
|
+
* icon class is (0,1,0) and beats it, so known glyphs are untouched, while
|
|
93
|
+
* an unknown one falls through to a question mark (`\f059`,
|
|
94
|
+
* `fa-circle-question`, which Free does ship). Matches the fallback the
|
|
95
|
+
* Fusion dev harness uses against Font Awesome Free.
|
|
96
|
+
*/
|
|
97
|
+
:where(i[class*='fa-']) {
|
|
98
|
+
--fa: var(--ekanos-icon-fa-fallback, '\f059');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/*
|
|
102
|
+
* Opt-in page shell.
|
|
103
|
+
*
|
|
104
|
+
* Fusion's app sets `bg-background text-foreground` on `<body>`; this package
|
|
105
|
+
* will not do that to a host page uninvited. Put `class="ekanos-root"` on
|
|
106
|
+
* `<body>` (or on any wrapper around Ekanos UI) to adopt Fusion's page surface
|
|
107
|
+
* — which is what makes dark mode look right, rather than dark cards floating
|
|
108
|
+
* on a white page.
|
|
109
|
+
*/
|
|
110
|
+
.ekanos-root {
|
|
111
|
+
background-color: var(--background);
|
|
112
|
+
color: var(--foreground);
|
|
113
|
+
font-family: var(--font-sans);
|
|
114
|
+
-webkit-font-smoothing: antialiased;
|
|
115
|
+
-moz-osx-font-smoothing: grayscale;
|
|
116
|
+
}
|
package/dist/card.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Takes a `render` prop (the Base UI convention
|
|
5
|
+
* Takes a `render` prop (the Base UI convention) so
|
|
6
6
|
* a card that is itself a destination can BE the link rather than wrapping one:
|
|
7
7
|
* `<Card render={<Link href={href} />}>`. Without it, clickable cards get
|
|
8
8
|
* hand-styled anchors and the surface drifts from this one.
|