@appica/ui-react 1.3.1 → 1.5.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.
- package/CHANGELOG.md +33 -0
- package/README.md +8 -2
- package/agent-rules.md +9 -2
- package/appica.css +2 -2
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/button/button-variants.js +1 -1
- package/dist/components/button/button-variants.js.map +1 -1
- package/dist/components/card/card.js +1 -1
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/carousel/carousel.d.ts +24 -3
- package/dist/components/carousel/carousel.d.ts.map +1 -1
- package/dist/components/carousel/carousel.js +149 -31
- package/dist/components/carousel/carousel.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/command-palette/command-palette.d.ts +91 -0
- package/dist/components/command-palette/command-palette.d.ts.map +1 -0
- package/dist/components/command-palette/command-palette.js +376 -0
- package/dist/components/command-palette/command-palette.js.map +1 -0
- package/dist/components/date-field/date-field.js +1 -1
- package/dist/components/date-field/date-field.js.map +1 -1
- package/dist/components/date-picker/date-picker.js +1 -1
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/input/input-variants.js +2 -2
- package/dist/components/input/input-variants.js.map +1 -1
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/splitter/splitter.d.ts +57 -0
- package/dist/components/splitter/splitter.d.ts.map +1 -0
- package/dist/components/splitter/splitter.js +395 -0
- package/dist/components/splitter/splitter.js.map +1 -0
- package/dist/components/textarea/textarea.js +1 -1
- package/dist/components/textarea/textarea.js.map +1 -1
- package/dist/components/time-field/time-field.js +1 -1
- package/dist/components/time-field/time-field.js.map +1 -1
- package/dist/components/toc/toc.d.ts +6 -1
- package/dist/components/toc/toc.d.ts.map +1 -1
- package/dist/components/toc/toc.js +15 -7
- package/dist/components/toc/toc.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +24 -14
- package/src/components/badge/badge.tsx +1 -1
- package/src/components/button/button-variants.ts +1 -1
- package/src/components/card/card.tsx +1 -1
- package/src/components/carousel/carousel.test.tsx +559 -21
- package/src/components/carousel/carousel.tsx +195 -40
- package/src/components/checkbox/checkbox.tsx +1 -1
- package/src/components/command-palette/command-palette.test.tsx +280 -0
- package/src/components/command-palette/command-palette.tsx +544 -0
- package/src/components/compare-slider/compare-slider.test.tsx +8 -7
- package/src/components/date-field/date-field.tsx +1 -1
- package/src/components/date-picker/date-picker.tsx +1 -1
- package/src/components/input/input-variants.ts +2 -2
- package/src/components/radio/radio.tsx +1 -1
- package/src/components/rating/rating.test.tsx +10 -3
- package/src/components/splitter/splitter.test.tsx +415 -0
- package/src/components/splitter/splitter.tsx +555 -0
- package/src/components/textarea/textarea.tsx +1 -1
- package/src/components/time-field/time-field.tsx +1 -1
- package/src/components/toc/toc.test.tsx +15 -0
- package/src/components/toc/toc.tsx +22 -7
- package/src/index.ts +2 -0
- package/src/test/css.ts +9 -0
- package/src/test/setup.ts +13 -0
- package/styles.css +3 -0
package/src/test/css.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A CSS value as the DOM reports it back from an inline style, so an assertion holds however the
|
|
3
|
+
* environment serializes it (`inset(0 70% 0 0)` reads back as `inset(0px 70% 0px 0px)` in jsdom 31).
|
|
4
|
+
*/
|
|
5
|
+
export function cssValue(property: string, value: string): string {
|
|
6
|
+
const probe = document.createElement('div')
|
|
7
|
+
probe.style.setProperty(property, value)
|
|
8
|
+
return probe.style.getPropertyValue(property)
|
|
9
|
+
}
|
package/src/test/setup.ts
CHANGED
|
@@ -22,6 +22,19 @@ if (typeof window !== 'undefined' && !window.matchMedia) {
|
|
|
22
22
|
}) as unknown as MediaQueryList
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
// jsdom matches :focus-visible on any focus. Browsers skip focus that follows a pointer press, and
|
|
26
|
+
// Carousel's keyboard-only autoplay pause relies on that, so track the input modality the same way.
|
|
27
|
+
let pointerModality = false
|
|
28
|
+
document.addEventListener('keydown', () => (pointerModality = false), true)
|
|
29
|
+
document.addEventListener('pointerdown', () => (pointerModality = true), true)
|
|
30
|
+
document.addEventListener('mousedown', () => (pointerModality = true), true)
|
|
31
|
+
const nativeMatches = Element.prototype.matches
|
|
32
|
+
Element.prototype.matches = function (this: Element, selectors: string) {
|
|
33
|
+
if (selectors === ':focus-visible') return !pointerModality && nativeMatches.call(this, ':focus')
|
|
34
|
+
return nativeMatches.call(this, selectors)
|
|
35
|
+
} as typeof Element.prototype.matches
|
|
36
|
+
|
|
25
37
|
afterEach(() => {
|
|
26
38
|
cleanup()
|
|
39
|
+
pointerModality = false
|
|
27
40
|
})
|
package/styles.css
CHANGED
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
--color-background: var(--background);
|
|
41
41
|
--color-background-subtle: var(--background-subtle);
|
|
42
|
+
--color-background-soft: var(--background-soft);
|
|
42
43
|
--color-background-muted: var(--background-muted);
|
|
43
44
|
--color-background-strong: var(--background-strong);
|
|
44
45
|
--color-background-inverse: var(--background-inverse);
|
|
@@ -190,6 +191,7 @@
|
|
|
190
191
|
|
|
191
192
|
--background: oklch(1 0 0);
|
|
192
193
|
--background-subtle: oklch(0.985 0.002 247.839);
|
|
194
|
+
--background-soft: oklch(0.967 0.003 264.542 / 60%);
|
|
193
195
|
--background-muted: oklch(0.967 0.003 264.542);
|
|
194
196
|
--background-strong: oklch(0.928 0.006 264.531);
|
|
195
197
|
--background-inverse: oklch(0.13 0.028 261.692);
|
|
@@ -302,6 +304,7 @@
|
|
|
302
304
|
|
|
303
305
|
--background: oklch(0.13 0.028 261.692);
|
|
304
306
|
--background-subtle: oklch(0.551 0.027 264.364 / 8%);
|
|
307
|
+
--background-soft: oklch(0.551 0.027 264.364 / 10%);
|
|
305
308
|
--background-muted: oklch(0.21 0.034 264.665);
|
|
306
309
|
--background-strong: oklch(0.278 0.033 256.848);
|
|
307
310
|
--background-inverse: oklch(1 0 0);
|