@frontile/theme 0.18.13 → 0.18.15
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/declarations/components/app-layout.d.ts +2 -1
- package/declarations/components/app-layout.d.ts.map +1 -1
- package/declarations/components/icon.d.ts.map +1 -1
- package/declarations/index.d.ts +20 -2
- package/declarations/index.d.ts.map +1 -1
- package/declarations/plugin/overlays.d.ts.map +1 -1
- package/declarations/plugin.d.ts.map +1 -1
- package/dist/index.js +42 -13
- package/dist/index.js.map +1 -1
- package/dist/plugin.js +22 -1
- package/dist/plugin.js.map +1 -1
- package/package.json +2 -2
- package/src/index.css +10 -0
|
@@ -152,8 +152,9 @@ declare const appLayout: import("tailwind-variants").TVReturnType<{
|
|
|
152
152
|
pageHeaderTitle: string;
|
|
153
153
|
pageHeaderDescription: string;
|
|
154
154
|
pageHeaderActions: string;
|
|
155
|
-
aside: string;
|
|
155
|
+
aside: string[];
|
|
156
156
|
mobileAside: string;
|
|
157
|
+
mobileSheet: string;
|
|
157
158
|
asideToggle: string[];
|
|
158
159
|
region: string;
|
|
159
160
|
skipLink: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-layout.d.ts","sourceRoot":"","sources":["../../src/components/app-layout.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AA2K1C,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"app-layout.d.ts","sourceRoot":"","sources":["../../src/components/app-layout.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AA2K1C,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CA4mBb,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,MAAM,MAAM,cAAc,GAAG,MAAM,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAChE,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/components/icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/components/icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAmF9C,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uIAuHR,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/declarations/index.d.ts
CHANGED
|
@@ -2,8 +2,26 @@ import * as components from './components';
|
|
|
2
2
|
import type { ClassValue } from 'tailwind-variants';
|
|
3
3
|
export type * from './components';
|
|
4
4
|
export * from './tw';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type Components = typeof components;
|
|
6
|
+
/**
|
|
7
|
+
* What a style override has to be for the component that reads it: callable
|
|
8
|
+
* with that component's variant props, returning what the shipped style
|
|
9
|
+
* returns (a class string, or one function per slot).
|
|
10
|
+
*
|
|
11
|
+
* Only the call signature is kept. `typeof components` also carries each
|
|
12
|
+
* style's class strings as literal types (`base: 'bg-surface-input rounded-xl
|
|
13
|
+
* ...'`), and requiring those would reject every override that changes a class
|
|
14
|
+
* -- which is every override.
|
|
15
|
+
*
|
|
16
|
+
* Entries that are not styles at all (`overlayTransitions` is a plain object)
|
|
17
|
+
* keep their own type.
|
|
18
|
+
*/
|
|
19
|
+
type StyleOverride<T> = T extends (...args: infer A) => infer R ? (...args: A) => R : T;
|
|
20
|
+
export type CustomStyles = {
|
|
21
|
+
[K in keyof Components]?: StyleOverride<Components[K]>;
|
|
22
|
+
};
|
|
23
|
+
declare function registerCustomStyles(styles: CustomStyles): void;
|
|
24
|
+
declare function useStyles(): Components;
|
|
7
25
|
export type SlotsToClasses<S extends string> = {
|
|
8
26
|
[key in S]?: ClassValue;
|
|
9
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,mBAAmB,cAAc,CAAC;AAClC,cAAc,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,mBAAmB,cAAc,CAAC;AAClC,cAAc,MAAM,CAAC;AAErB,KAAK,UAAU,GAAG,OAAO,UAAU,CAAC;AAEpC;;;;;;;;;;;;GAYG;AACH,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GAC3D,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GACjB,CAAC,CAAC;AAEN,MAAM,MAAM,YAAY,GAAG;KACxB,CAAC,IAAI,MAAM,UAAU,CAAC,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;CACvD,CAAC;AAIF,iBAAS,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAIxD;AAED,iBAAS,SAAS,IAAI,UAAU,CAE/B;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,IAAI;KAC5C,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU;CACxB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;AAC3C,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlays.d.ts","sourceRoot":"","sources":["../../src/plugin/overlays.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,SAAS,CAAC;AAExD,iBAAS,WAAW,CAClB,aAAa,EAAE,SAAS,CAAC,eAAe,CAAC,EACzC,MAAM,EAAE,MAAM,GACb,IAAI,
|
|
1
|
+
{"version":3,"file":"overlays.d.ts","sourceRoot":"","sources":["../../src/plugin/overlays.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,SAAS,CAAC;AAExD,iBAAS,WAAW,CAClB,aAAa,EAAE,SAAS,CAAC,eAAe,CAAC,EACzC,MAAM,EAAE,MAAM,GACb,IAAI,CAgCN;AAED,iBAAS,UAAU,CACjB,aAAa,EAAE,SAAS,CAAC,eAAe,CAAC,EACzC,MAAM,EAAE,MAAM,GACb,IAAI,CAyBN;AAED,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AASxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,iBAAS,QAAQ,CAAC,MAAM,GAAE,YAAiB,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AASxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,iBAAS,QAAQ,CAAC,MAAM,GAAE,YAAiB,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAuEtE;AAeD,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1456,7 +1456,10 @@ const BY_VARIANT = {
|
|
|
1456
1456
|
// A circle that centers an icon, sized from the design artifact: the circle
|
|
1457
1457
|
// diameter, the icon inside it, and for `plain` a tighter box with no circle.
|
|
1458
1458
|
// The icon is the `svg` the block contains, so it needs no size class of its
|
|
1459
|
-
// own.
|
|
1459
|
+
// own. Its size is important: a Font Awesome glyph gets an unlayered
|
|
1460
|
+
// `.svg-inline--fa { width; height }` from the library, which beats any layered
|
|
1461
|
+
// utility, so without `!` the glyph would keep Font Awesome's size.
|
|
1462
|
+
// These are the artifact's pixel values, not the `size-icon-*` ramp, which
|
|
1460
1463
|
// follows the label text. Outline draws its ring as an inset shadow in the
|
|
1461
1464
|
// icon color, 0.5px at 4xs up to 2.5px at 3xl.
|
|
1462
1465
|
//
|
|
@@ -1467,16 +1470,16 @@ const icon = tv({
|
|
|
1467
1470
|
base: 'box-border inline-flex shrink-0 items-center justify-center rounded-full align-middle',
|
|
1468
1471
|
variants: {
|
|
1469
1472
|
size: {
|
|
1470
|
-
'4xs': 'size-4 [&_svg]:size-[8px]',
|
|
1471
|
-
'3xs': 'size-5 [&_svg]:size-[10px]',
|
|
1472
|
-
'2xs': 'size-6 [&_svg]:size-[12px]',
|
|
1473
|
-
xs: 'size-8 [&_svg]:size-[16px]',
|
|
1474
|
-
sm: 'size-10 [&_svg]:size-[20px]',
|
|
1475
|
-
md: 'size-12 [&_svg]:size-[28px]',
|
|
1476
|
-
lg: 'size-16 [&_svg]:size-[32px]',
|
|
1477
|
-
xl: 'size-18 [&_svg]:size-[40px]',
|
|
1478
|
-
'2xl': 'size-20 [&_svg]:size-[48px]',
|
|
1479
|
-
'3xl': 'size-24 [&_svg]:size-[56px]'
|
|
1473
|
+
'4xs': 'size-4 [&_svg]:size-[8px]!',
|
|
1474
|
+
'3xs': 'size-5 [&_svg]:size-[10px]!',
|
|
1475
|
+
'2xs': 'size-6 [&_svg]:size-[12px]!',
|
|
1476
|
+
xs: 'size-8 [&_svg]:size-[16px]!',
|
|
1477
|
+
sm: 'size-10 [&_svg]:size-[20px]!',
|
|
1478
|
+
md: 'size-12 [&_svg]:size-[28px]!',
|
|
1479
|
+
lg: 'size-16 [&_svg]:size-[32px]!',
|
|
1480
|
+
xl: 'size-18 [&_svg]:size-[40px]!',
|
|
1481
|
+
'2xl': 'size-20 [&_svg]:size-[48px]!',
|
|
1482
|
+
'3xl': 'size-24 [&_svg]:size-[56px]!'
|
|
1480
1483
|
},
|
|
1481
1484
|
color: {
|
|
1482
1485
|
neutral: '',
|
|
@@ -3985,9 +3988,19 @@ const appLayout = tv({
|
|
|
3985
3988
|
// Literal `lg:block` here, not tied to `breakpoint`: the aside is a
|
|
3986
3989
|
// wide-viewport affordance regardless of where the sidebar collapses.
|
|
3987
3990
|
// Below `lg` the same block renders in a Drawer instead (`mobileAside`).
|
|
3988
|
-
|
|
3991
|
+
// Its `data-state` drives the motion (`Aside` keeps it mounted until the
|
|
3992
|
+
// exit ends); `data-animated=false` and reduced motion turn it off.
|
|
3993
|
+
aside: ['col-start-3 row-start-2 hidden w-72 shrink-0 overflow-y-auto overflow-x-clip p-4 font-body text-body-sm lg:block', 'data-[animated=true]:data-[state=open]:animate-[frontile-aside-in_200ms_ease-out]', 'data-[animated=true]:data-[state=closed]:animate-[frontile-aside-out_200ms_ease-in_forwards]', 'motion-reduce:animate-none'],
|
|
3989
3994
|
// The aside's `aside` element inside the drawer: as tall as the drawer.
|
|
3990
|
-
|
|
3995
|
+
// A flex column, so a single child that is itself a column (header,
|
|
3996
|
+
// scrolling body, footer) can take the aside's height with
|
|
3997
|
+
// `min-h-0 flex-1`. A percentage height would not resolve here: the sheet
|
|
3998
|
+
// is content-sized.
|
|
3999
|
+
mobileAside: 'flex min-h-0 flex-1 flex-col overflow-y-auto p-4 font-body text-body-sm',
|
|
4000
|
+
// Added to the aside's bottom `Drawer` when no size is passed, so the sheet
|
|
4001
|
+
// is as tall as its content (up to the drawer's `full` cap) instead of
|
|
4002
|
+
// filling the cap. Overrides the drawer's `h-full`.
|
|
4003
|
+
mobileSheet: 'h-auto',
|
|
3991
4004
|
asideToggle: iconButton,
|
|
3992
4005
|
// A `layout.Region`: its children lay out as children of its parent.
|
|
3993
4006
|
region: 'contents',
|
|
@@ -6486,8 +6499,24 @@ var components = /*#__PURE__*/Object.freeze({
|
|
|
6486
6499
|
tooltip: tooltip
|
|
6487
6500
|
});
|
|
6488
6501
|
|
|
6502
|
+
/**
|
|
6503
|
+
* What a style override has to be for the component that reads it: callable
|
|
6504
|
+
* with that component's variant props, returning what the shipped style
|
|
6505
|
+
* returns (a class string, or one function per slot).
|
|
6506
|
+
*
|
|
6507
|
+
* Only the call signature is kept. `typeof components` also carries each
|
|
6508
|
+
* style's class strings as literal types (`base: 'bg-surface-input rounded-xl
|
|
6509
|
+
* ...'`), and requiring those would reject every override that changes a class
|
|
6510
|
+
* -- which is every override.
|
|
6511
|
+
*
|
|
6512
|
+
* Entries that are not styles at all (`overlayTransitions` is a plain object)
|
|
6513
|
+
* keep their own type.
|
|
6514
|
+
*/
|
|
6515
|
+
|
|
6489
6516
|
let localStyles = components;
|
|
6490
6517
|
function registerCustomStyles(styles) {
|
|
6518
|
+
// Each override has the call signature of the style it replaces (see
|
|
6519
|
+
// `StyleOverride`), which is all a component uses -- so it stands in for it.
|
|
6491
6520
|
localStyles = {
|
|
6492
6521
|
...localStyles,
|
|
6493
6522
|
...styles
|