@qoretechnologies/reqore 0.78.11-pr.723.g4423093 → 0.78.11
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/dist/components/Accordion/index.d.ts.map +1 -1
- package/dist/components/Accordion/index.js +14 -60
- package/dist/components/Accordion/index.js.map +1 -1
- package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/index.js +21 -58
- package/dist/components/Breadcrumbs/index.js.map +1 -1
- package/dist/components/Bubble/index.d.ts.map +1 -1
- package/dist/components/Bubble/index.js +4 -13
- package/dist/components/Bubble/index.js.map +1 -1
- package/dist/components/Button/index.d.ts +0 -67
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +98 -238
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Callout/index.d.ts.map +1 -1
- package/dist/components/Callout/index.js +29 -49
- package/dist/components/Callout/index.js.map +1 -1
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +36 -112
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/CollapsibleContent/index.d.ts.map +1 -1
- package/dist/components/CollapsibleContent/index.js +2 -6
- package/dist/components/CollapsibleContent/index.js.map +1 -1
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +1 -22
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/DataView/index.d.ts.map +1 -1
- package/dist/components/DataView/index.js +10 -13
- package/dist/components/DataView/index.js.map +1 -1
- package/dist/components/DescriptionList/index.d.ts.map +1 -1
- package/dist/components/DescriptionList/index.js +4 -30
- package/dist/components/DescriptionList/index.js.map +1 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +25 -41
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Dropdown/list.js +14 -19
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Effect/index.d.ts +0 -37
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js +58 -224
- package/dist/components/Effect/index.js.map +1 -1
- package/dist/components/EntityRow/index.d.ts.map +1 -1
- package/dist/components/EntityRow/index.js +59 -98
- package/dist/components/EntityRow/index.js.map +1 -1
- package/dist/components/FeatureCard/index.d.ts.map +1 -1
- package/dist/components/FeatureCard/index.js +21 -54
- package/dist/components/FeatureCard/index.js.map +1 -1
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +4 -7
- package/dist/components/Header/index.js.map +1 -1
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +3 -13
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Input/index.d.ts +1 -44
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +23 -89
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InputClearButton/index.d.ts +2 -7
- package/dist/components/InputClearButton/index.d.ts.map +1 -1
- package/dist/components/InputClearButton/index.js +5 -12
- package/dist/components/InputClearButton/index.js.map +1 -1
- package/dist/components/InternalPopover/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.js +10 -19
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/Link/index.d.ts.map +1 -1
- package/dist/components/Link/index.js +1 -6
- package/dist/components/Link/index.js.map +1 -1
- package/dist/components/Menu/divider.d.ts.map +1 -1
- package/dist/components/Menu/divider.js +3 -8
- package/dist/components/Menu/divider.js.map +1 -1
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +4 -17
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Message/index.js +4 -20
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/NavRail/index.d.ts +0 -2
- package/dist/components/NavRail/index.d.ts.map +1 -1
- package/dist/components/NavRail/index.js +40 -120
- package/dist/components/NavRail/index.js.map +1 -1
- package/dist/components/Notifications/notification.d.ts +2 -6
- package/dist/components/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +18 -78
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Notifications/styles.d.ts +0 -20
- package/dist/components/Notifications/styles.d.ts.map +1 -1
- package/dist/components/Notifications/styles.js +9 -37
- package/dist/components/Notifications/styles.js.map +1 -1
- package/dist/components/Panel/index.d.ts +0 -3
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +153 -214
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Paragraph/index.d.ts.map +1 -1
- package/dist/components/Paragraph/index.js +5 -8
- package/dist/components/Paragraph/index.js.map +1 -1
- package/dist/components/Progress/index.d.ts.map +1 -1
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/Progress/index.js.map +1 -1
- package/dist/components/Rating/index.d.ts.map +1 -1
- package/dist/components/Rating/index.js +8 -20
- package/dist/components/Rating/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts +5 -0
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +52 -90
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/SegmentedControl/index.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index.js +42 -87
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/SeverityRow/index.d.ts.map +1 -1
- package/dist/components/SeverityRow/index.js +1 -1
- package/dist/components/SeverityRow/index.js.map +1 -1
- package/dist/components/Span/index.d.ts.map +1 -1
- package/dist/components/Span/index.js +5 -8
- package/dist/components/Span/index.js.map +1 -1
- package/dist/components/StackedBar/index.d.ts.map +1 -1
- package/dist/components/StackedBar/index.js +12 -42
- package/dist/components/StackedBar/index.js.map +1 -1
- package/dist/components/Statistic/index.d.ts.map +1 -1
- package/dist/components/Statistic/index.js +6 -34
- package/dist/components/Statistic/index.js.map +1 -1
- package/dist/components/Table/cell.d.ts.map +1 -1
- package/dist/components/Table/cell.js +41 -72
- package/dist/components/Table/cell.js.map +1 -1
- package/dist/components/Table/headerCell.d.ts.map +1 -1
- package/dist/components/Table/headerCell.js +5 -7
- package/dist/components/Table/headerCell.js.map +1 -1
- package/dist/components/Tag/index.d.ts +3 -70
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +67 -233
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Testimonial/index.d.ts.map +1 -1
- package/dist/components/Testimonial/index.js +20 -35
- package/dist/components/Testimonial/index.js.map +1 -1
- package/dist/components/Textarea/index.d.ts +0 -6
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +20 -20
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/components/Timeline/index.d.ts +0 -2
- package/dist/components/Timeline/index.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +13 -56
- package/dist/components/Timeline/index.js.map +1 -1
- package/dist/components/Tree/index.d.ts.map +1 -1
- package/dist/components/Tree/index.js +20 -24
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/containers/UIProvider.d.ts +0 -10
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +4 -33
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/helpers/colors.d.ts +2 -184
- package/dist/helpers/colors.d.ts.map +1 -1
- package/dist/helpers/colors.js +86 -739
- package/dist/helpers/colors.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
- package/tests.json +1 -0
- package/vitest.config.ts +0 -10
- package/dist/context/SurfaceContext.d.ts +0 -18
- package/dist/context/SurfaceContext.d.ts.map +0 -1
- package/dist/context/SurfaceContext.js +0 -39
- package/dist/context/SurfaceContext.js.map +0 -1
- package/dist/helpers/iconProps.d.ts +0 -14
- package/dist/helpers/iconProps.d.ts.map +0 -1
- package/dist/helpers/iconProps.js +0 -33
- package/dist/helpers/iconProps.js.map +0 -1
- package/dist/helpers/surface.d.ts +0 -31
- package/dist/helpers/surface.d.ts.map +0 -1
- package/dist/helpers/surface.js +0 -87
- package/dist/helpers/surface.js.map +0 -1
- package/dist/hooks/useDrawnSurface.d.ts +0 -38
- package/dist/hooks/useDrawnSurface.d.ts.map +0 -1
- package/dist/hooks/useDrawnSurface.js +0 -48
- package/dist/hooks/useDrawnSurface.js.map +0 -1
package/vitest.config.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { readFileSync, readdirSync } from 'node:fs';
|
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
import { configDefaults, defineConfig, mergeConfig } from 'vitest/config';
|
|
8
|
-
import type { BrowserCommand } from 'vitest/node';
|
|
9
8
|
import viteConfig from './vite.config';
|
|
10
9
|
|
|
11
10
|
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -72,15 +71,6 @@ const storyBrowser = (phone = false) => ({
|
|
|
72
71
|
? { viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true }
|
|
73
72
|
: { viewport: { width: 1920, height: 1080 } },
|
|
74
73
|
}),
|
|
75
|
-
/* Asks for reduced motion (`prefers-reduced-motion: reduce`) or stops asking, in the page the stories run in.
|
|
76
|
-
Reqore honours it: its springs settle at once and its transitions take no time. The contrast gate asks for it
|
|
77
|
-
while it measures, so it measures what stays on screen, never a frame of a fade (qorus#646: a clear button
|
|
78
|
-
measured on its way in); a story tagged `reduced-motion` runs under it (.storybook/vitest.setup.ts). */
|
|
79
|
-
commands: {
|
|
80
|
-
emulateReducedMotion: (async ({ page }, reduce) => {
|
|
81
|
-
await page.emulateMedia({ reducedMotion: reduce ? 'reduce' : 'no-preference' });
|
|
82
|
-
}) satisfies BrowserCommand<[reduce: boolean]>,
|
|
83
|
-
},
|
|
84
74
|
headless: true,
|
|
85
75
|
instances: [{ browser: 'chromium' as const }],
|
|
86
76
|
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import type { TReqoreSurface } from '../helpers/colors';
|
|
3
|
-
/**
|
|
4
|
-
* Hands `color` (opaque; what this component is drawn in - each color of its gradient, when it has one) to the
|
|
5
|
-
* components inside as their surface. Without a `color` (a component that paints nothing), they keep the surface
|
|
6
|
-
* around it.
|
|
7
|
-
*
|
|
8
|
-
* The surface handed down stays the same value for as long as its colors do. A component that works its colors out
|
|
9
|
-
* again on each render (an inline effect or content effect, a new list each time) would otherwise hand down a new
|
|
10
|
-
* list with the same colors, and every component below that reads the surface would render again with it.
|
|
11
|
-
*/
|
|
12
|
-
export declare const ReqoreSurfaceProvider: ({ color, children, }: {
|
|
13
|
-
color?: TReqoreSurface;
|
|
14
|
-
children?: ReactNode;
|
|
15
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
/** The color this component is drawn on, when a component around it has said; undefined when none has. */
|
|
17
|
-
export declare const useReqoreSurface: () => TReqoreSurface | undefined;
|
|
18
|
-
//# sourceMappingURL=SurfaceContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SurfaceContext.d.ts","sourceRoot":"","sources":["../../src/context/SurfaceContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAuB,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAcxD;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAAI,sBAGnC;IACD,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,4CAQA,CAAC;AAEF,0GAA0G;AAC1G,eAAO,MAAM,gBAAgB,QAAO,cAAc,GAAG,SAAuC,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useReqoreSurface = exports.ReqoreSurfaceProvider = void 0;
|
|
4
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
var react_1 = require("react");
|
|
6
|
-
/**
|
|
7
|
-
* The color the components inside are drawn on, as the browser draws it (opaque): what a component that paints a
|
|
8
|
-
* background of its own (the layout, a panel, a message, a button) hands to what it holds, so that their text and
|
|
9
|
-
* icons are picked against what is really under them - an intent's text inside a message, a badge on a button.
|
|
10
|
-
* Undefined outside all of them: the theme's surface then (`getThemeSurface`).
|
|
11
|
-
*/
|
|
12
|
-
var SurfaceContext = (0, react_1.createContext)(undefined);
|
|
13
|
-
/** One key for a surface's colors: the same colors, in the same order, are the same key. */
|
|
14
|
-
var getSurfaceKey = function (surface) {
|
|
15
|
-
return Array.isArray(surface) ? "[".concat(surface.join('|'), "]") : surface;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Hands `color` (opaque; what this component is drawn in - each color of its gradient, when it has one) to the
|
|
19
|
-
* components inside as their surface. Without a `color` (a component that paints nothing), they keep the surface
|
|
20
|
-
* around it.
|
|
21
|
-
*
|
|
22
|
-
* The surface handed down stays the same value for as long as its colors do. A component that works its colors out
|
|
23
|
-
* again on each render (an inline effect or content effect, a new list each time) would otherwise hand down a new
|
|
24
|
-
* list with the same colors, and every component below that reads the surface would render again with it.
|
|
25
|
-
*/
|
|
26
|
-
var ReqoreSurfaceProvider = function (_a) {
|
|
27
|
-
var color = _a.color, children = _a.children;
|
|
28
|
-
var around = (0, react_1.useContext)(SurfaceContext);
|
|
29
|
-
var surface = color !== null && color !== void 0 ? color : around;
|
|
30
|
-
var key = getSurfaceKey(surface);
|
|
31
|
-
// the first surface with these colors, for as long as they hold
|
|
32
|
-
var value = (0, react_1.useMemo)(function () { return surface; }, [key]);
|
|
33
|
-
return (0, jsx_runtime_1.jsx)(SurfaceContext.Provider, { value: value, children: children });
|
|
34
|
-
};
|
|
35
|
-
exports.ReqoreSurfaceProvider = ReqoreSurfaceProvider;
|
|
36
|
-
/** The color this component is drawn on, when a component around it has said; undefined when none has. */
|
|
37
|
-
var useReqoreSurface = function () { return (0, react_1.useContext)(SurfaceContext); };
|
|
38
|
-
exports.useReqoreSurface = useReqoreSurface;
|
|
39
|
-
//# sourceMappingURL=SurfaceContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SurfaceContext.js","sourceRoot":"","sources":["../../src/context/SurfaceContext.tsx"],"names":[],"mappings":";;;;AAAA,+BAAsE;AAGtE;;;;;GAKG;AACH,IAAM,cAAc,GAAG,IAAA,qBAAa,EAA6B,SAAS,CAAC,CAAC;AAE5E,4FAA4F;AAC5F,IAAM,aAAa,GAAG,UAAC,OAAwB;IAC7C,OAAA,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAG,CAAC,CAAC,CAAC,OAAO;AAA3D,CAA2D,CAAC;AAE9D;;;;;;;;GAQG;AACI,IAAM,qBAAqB,GAAG,UAAC,EAMrC;QALC,KAAK,WAAA,EACL,QAAQ,cAAA;IAKR,IAAM,MAAM,GAAG,IAAA,kBAAU,EAAC,cAAc,CAAC,CAAC;IAC1C,IAAM,OAAO,GAAG,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,MAAM,CAAC;IAChC,IAAM,GAAG,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IACnC,gEAAgE;IAChE,IAAM,KAAK,GAAG,IAAA,eAAO,EAAC,cAAM,OAAA,OAAO,EAAP,CAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAE5C,OAAO,uBAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAA2B,CAAC;AACrF,CAAC,CAAC;AAdW,QAAA,qBAAqB,yBAchC;AAEF,0GAA0G;AACnG,IAAM,gBAAgB,GAAG,cAAkC,OAAA,IAAA,kBAAU,EAAC,cAAc,CAAC,EAA1B,CAA0B,CAAC;AAAhF,QAAA,gBAAgB,oBAAgE"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { TReqoreEffectColor } from '../components/Effect';
|
|
2
|
-
import type { IReqoreIconProps } from '../components/Icon';
|
|
3
|
-
/**
|
|
4
|
-
* An icon's own color given in its props (`leftIconProps={{ intent }}`, `iconProps={{ color }}`), split from the rest
|
|
5
|
-
* of them (qorus#646).
|
|
6
|
-
*
|
|
7
|
-
* A component that draws an icon faded (a button's or an input's at `CONTROL_ICON_OPACITY`, a tag's, a panel's
|
|
8
|
-
* title icon) picks the icon's color and opacity together so that it stands out by 3:1 at that opacity. A color
|
|
9
|
-
* given in the icon's props was spread over that pick: the icon made it readable at full opacity, and drawn at 70%
|
|
10
|
-
* a warning icon was 2.4:1. The component picks it instead, as it does its own `iconColor`, and passes the rest on.
|
|
11
|
-
* The props' color wins over the component's, as it did when the props were spread last.
|
|
12
|
-
*/
|
|
13
|
-
export declare const splitIconColor: (props?: IReqoreIconProps) => [TReqoreEffectColor | undefined, IReqoreIconProps | undefined];
|
|
14
|
-
//# sourceMappingURL=iconProps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iconProps.d.ts","sourceRoot":"","sources":["../../src/helpers/iconProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GACzB,QAAQ,gBAAgB,KACvB,CAAC,kBAAkB,GAAG,SAAS,EAAE,gBAAgB,GAAG,SAAS,CAQ/D,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.splitIconColor = void 0;
|
|
15
|
-
/**
|
|
16
|
-
* An icon's own color given in its props (`leftIconProps={{ intent }}`, `iconProps={{ color }}`), split from the rest
|
|
17
|
-
* of them (qorus#646).
|
|
18
|
-
*
|
|
19
|
-
* A component that draws an icon faded (a button's or an input's at `CONTROL_ICON_OPACITY`, a tag's, a panel's
|
|
20
|
-
* title icon) picks the icon's color and opacity together so that it stands out by 3:1 at that opacity. A color
|
|
21
|
-
* given in the icon's props was spread over that pick: the icon made it readable at full opacity, and drawn at 70%
|
|
22
|
-
* a warning icon was 2.4:1. The component picks it instead, as it does its own `iconColor`, and passes the rest on.
|
|
23
|
-
* The props' color wins over the component's, as it did when the props were spread last.
|
|
24
|
-
*/
|
|
25
|
-
var splitIconColor = function (props) {
|
|
26
|
-
if (!props || (!props.intent && !props.color)) {
|
|
27
|
-
return [undefined, props];
|
|
28
|
-
}
|
|
29
|
-
var intent = props.intent, color = props.color, rest = __rest(props, ["intent", "color"]);
|
|
30
|
-
return [intent || color, rest];
|
|
31
|
-
};
|
|
32
|
-
exports.splitIconColor = splitIconColor;
|
|
33
|
-
//# sourceMappingURL=iconProps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iconProps.js","sourceRoot":"","sources":["../../src/helpers/iconProps.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA;;;;;;;;;GASG;AACI,IAAM,cAAc,GAAG,UAC5B,KAAwB;IAExB,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9C,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAEO,IAAA,MAAM,GAAqB,KAAK,OAA1B,EAAE,KAAK,GAAc,KAAK,MAAnB,EAAK,IAAI,UAAK,KAAK,EAAlC,mBAA0B,CAAF,CAAW;IAEzC,OAAO,CAAC,MAAM,IAAI,KAAK,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC,CAAC;AAVW,QAAA,cAAc,kBAUzB"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { IReqoreCustomTheme, IReqoreTheme, TReqoreIntent } from '../constants/theme';
|
|
2
|
-
import { TReqoreSurface } from './colors';
|
|
3
|
-
import { TReqoreEffectColor, TReqoreHexColor } from '../components/Effect';
|
|
4
|
-
/**
|
|
5
|
-
* What an element that paints nothing (`unpainted`: transparent, or drawn at no opacity) is drawn on. The surface a
|
|
6
|
-
* component around it hands down (`useReqoreSurface`) when one does; with none around it, the main of the
|
|
7
|
-
* `customTheme` it was given - how a consumer says what it painted under it (a band, a card of its own) - drawn over
|
|
8
|
-
* the page when it is translucent; undefined otherwise (the theme's surface, `getThemeSurface`). An intent is not a
|
|
9
|
-
* surface: an element in an intent with nothing around it is drawn on the page.
|
|
10
|
-
*/
|
|
11
|
-
export declare const getUnpaintedSurface: (theme: IReqoreTheme, customTheme: IReqoreCustomTheme | undefined, surface: TReqoreSurface | undefined, unpainted: boolean) => TReqoreSurface | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* The color a text effect draws `color` in on `backgrounds` (`getEffectTextColor`: a theme color in the shade of it
|
|
14
|
-
* that reads there, any other as given), or undefined where it draws none - a CSS color name, a variable, a
|
|
15
|
-
* four-digit hex, which its text does not take either: it keeps the color it inherits. Never throws.
|
|
16
|
-
*/
|
|
17
|
-
export declare const getDrawnEffectTextColor: (theme: IReqoreTheme, color: TReqoreEffectColor | undefined, backgrounds: TReqoreHexColor[]) => TReqoreHexColor | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* The color a card's own mark (an entity row's icon, a callout's icon, a testimonial's avatar and quote mark) is
|
|
20
|
-
* drawn in on `backgrounds`: its `own` color, moved to a shade that stands out by 3:1 there when it is a theme's;
|
|
21
|
-
* else its intent's shade that does; else the card's `text`.
|
|
22
|
-
*/
|
|
23
|
-
export declare const getCardMarkColor: (theme: IReqoreTheme, backgrounds: TReqoreHexColor[], text: TReqoreHexColor, own?: TReqoreEffectColor, intent?: TReqoreIntent) => TReqoreEffectColor;
|
|
24
|
-
/**
|
|
25
|
-
* The fill a clickable card paints while it is hovered: a wash of its intent (4% when it paints nothing at rest,
|
|
26
|
-
* else 10%), or else of the theme a step lighter (8% when it paints nothing at rest), or `opaque`, the card's own.
|
|
27
|
-
* What its styled rule paints, and what what it holds is read on as well as on its resting fill: a card's text and
|
|
28
|
-
* its fainter text were read on the resting fill only, and a hovered row's metadata fell to 4.2:1 (qorus#646).
|
|
29
|
-
*/
|
|
30
|
-
export declare const getCardHoverFill: (theme: IReqoreTheme, intent: TReqoreIntent | undefined, transparent: boolean | undefined, opaque: string) => string;
|
|
31
|
-
//# sourceMappingURL=surface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../src/helpers/surface.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAUL,cAAc,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAsB,kBAAkB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAwB/F;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO,YAAY,EACnB,aAAa,kBAAkB,GAAG,SAAS,EAC3C,SAAS,cAAc,GAAG,SAAS,EACnC,WAAW,OAAO,KACjB,cAAc,GAAG,SAQnB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,YAAY,EACnB,OAAO,kBAAkB,GAAG,SAAS,EACrC,aAAa,eAAe,EAAE,KAC7B,eAAe,GAAG,SAYpB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,YAAY,EACnB,aAAa,eAAe,EAAE,EAC9B,MAAM,eAAe,EACrB,MAAM,kBAAkB,EACxB,SAAS,aAAa,KACrB,kBAQF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,YAAY,EACnB,QAAQ,aAAa,GAAG,SAAS,EACjC,aAAa,OAAO,GAAG,SAAS,EAChC,QAAQ,MAAM,KACb,MAKW,CAAC"}
|
package/dist/helpers/surface.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCardHoverFill = exports.getCardMarkColor = exports.getDrawnEffectTextColor = exports.getUnpaintedSurface = void 0;
|
|
4
|
-
var polished_1 = require("polished");
|
|
5
|
-
var colors_1 = require("./colors");
|
|
6
|
-
var Effect_1 = require("../components/Effect");
|
|
7
|
-
/**
|
|
8
|
-
* `color` as the theme resolves it (a theme color, a shade of one, a hex), or undefined where it cannot: a CSS color
|
|
9
|
-
* name, a variable, a four-digit hex. Never throws: a color the theme cannot read is no reason to unmount the
|
|
10
|
-
* component that was given it.
|
|
11
|
-
*/
|
|
12
|
-
var resolveColor = function (theme, color) {
|
|
13
|
-
if (!color) {
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
try {
|
|
17
|
-
var resolved = (0, colors_1.getColorFromMaybeString)(theme, color);
|
|
18
|
-
return resolved && (0, colors_1.isValidSixCharHex)(resolved) ? resolved : undefined;
|
|
19
|
-
}
|
|
20
|
-
catch (_a) {
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* What an element that paints nothing (`unpainted`: transparent, or drawn at no opacity) is drawn on. The surface a
|
|
26
|
-
* component around it hands down (`useReqoreSurface`) when one does; with none around it, the main of the
|
|
27
|
-
* `customTheme` it was given - how a consumer says what it painted under it (a band, a card of its own) - drawn over
|
|
28
|
-
* the page when it is translucent; undefined otherwise (the theme's surface, `getThemeSurface`). An intent is not a
|
|
29
|
-
* surface: an element in an intent with nothing around it is drawn on the page.
|
|
30
|
-
*/
|
|
31
|
-
var getUnpaintedSurface = function (theme, customTheme, surface, unpainted) {
|
|
32
|
-
if (surface || !unpainted) {
|
|
33
|
-
return surface;
|
|
34
|
-
}
|
|
35
|
-
var own = resolveColor(theme, customTheme === null || customTheme === void 0 ? void 0 : customTheme.main);
|
|
36
|
-
return own ? (0, colors_1.getDrawnColor)(own, (0, colors_1.getThemeSurface)(theme)) : undefined;
|
|
37
|
-
};
|
|
38
|
-
exports.getUnpaintedSurface = getUnpaintedSurface;
|
|
39
|
-
/**
|
|
40
|
-
* The color a text effect draws `color` in on `backgrounds` (`getEffectTextColor`: a theme color in the shade of it
|
|
41
|
-
* that reads there, any other as given), or undefined where it draws none - a CSS color name, a variable, a
|
|
42
|
-
* four-digit hex, which its text does not take either: it keeps the color it inherits. Never throws.
|
|
43
|
-
*/
|
|
44
|
-
var getDrawnEffectTextColor = function (theme, color, backgrounds) {
|
|
45
|
-
if (!resolveColor(theme, color)) {
|
|
46
|
-
return undefined;
|
|
47
|
-
}
|
|
48
|
-
try {
|
|
49
|
-
var drawn = (0, Effect_1.getEffectTextColor)(theme, color, undefined, backgrounds);
|
|
50
|
-
return drawn && (0, colors_1.isValidSixCharHex)(drawn) ? drawn : undefined;
|
|
51
|
-
}
|
|
52
|
-
catch (_a) {
|
|
53
|
-
return undefined;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
exports.getDrawnEffectTextColor = getDrawnEffectTextColor;
|
|
57
|
-
/**
|
|
58
|
-
* The color a card's own mark (an entity row's icon, a callout's icon, a testimonial's avatar and quote mark) is
|
|
59
|
-
* drawn in on `backgrounds`: its `own` color, moved to a shade that stands out by 3:1 there when it is a theme's;
|
|
60
|
-
* else its intent's shade that does; else the card's `text`.
|
|
61
|
-
*/
|
|
62
|
-
var getCardMarkColor = function (theme, backgrounds, text, own, intent) {
|
|
63
|
-
var _a;
|
|
64
|
-
if (own) {
|
|
65
|
-
return ((_a = (0, colors_1.getReadableIconLook)(theme, backgrounds, text, 1, own).color) !== null && _a !== void 0 ? _a : own);
|
|
66
|
-
}
|
|
67
|
-
if (intent) {
|
|
68
|
-
return (0, colors_1.getReadableIntentColor)(theme, intent, colors_1.READABLE_ICON_CONTRAST, backgrounds);
|
|
69
|
-
}
|
|
70
|
-
return text;
|
|
71
|
-
};
|
|
72
|
-
exports.getCardMarkColor = getCardMarkColor;
|
|
73
|
-
/**
|
|
74
|
-
* The fill a clickable card paints while it is hovered: a wash of its intent (4% when it paints nothing at rest,
|
|
75
|
-
* else 10%), or else of the theme a step lighter (8% when it paints nothing at rest), or `opaque`, the card's own.
|
|
76
|
-
* What its styled rule paints, and what what it holds is read on as well as on its resting fill: a card's text and
|
|
77
|
-
* its fainter text were read on the resting fill only, and a hovered row's metadata fell to 4.2:1 (qorus#646).
|
|
78
|
-
*/
|
|
79
|
-
var getCardHoverFill = function (theme, intent, transparent, opaque) {
|
|
80
|
-
return intent
|
|
81
|
-
? (0, polished_1.rgba)(theme.intents[intent], transparent ? 0.04 : 0.1)
|
|
82
|
-
: transparent
|
|
83
|
-
? (0, polished_1.rgba)((0, colors_1.changeLightness)((0, colors_1.getMainBackgroundColor)(theme), 0.08), 0.08)
|
|
84
|
-
: opaque;
|
|
85
|
-
};
|
|
86
|
-
exports.getCardHoverFill = getCardHoverFill;
|
|
87
|
-
//# sourceMappingURL=surface.js.map
|
|
@@ -1 +0,0 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AAM;AAJZ,CAIY,CAAC;AAVF,QAAA,gBAAgB,oBAUd"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { IReqoreEffect, TReqoreHexColor } from '../components/Effect';
|
|
2
|
-
import { IReqoreCustomTheme, IReqoreTheme } from '../constants/theme';
|
|
3
|
-
import { TReqoreSurface } from '../helpers/colors';
|
|
4
|
-
export interface IReqoreDrawnSurfaceOptions {
|
|
5
|
-
theme: IReqoreTheme;
|
|
6
|
-
customTheme?: IReqoreCustomTheme;
|
|
7
|
-
/** It paints no fill of its own: it is on what is around it. */
|
|
8
|
-
transparent?: boolean;
|
|
9
|
-
/** The fill it paints, translucent or not, over what it is on. */
|
|
10
|
-
fill: string;
|
|
11
|
-
/** The effect it paints: what its gradient draws is what it holds is read on. */
|
|
12
|
-
effect?: IReqoreEffect;
|
|
13
|
-
/**
|
|
14
|
-
* The fill it paints while hovered, when it is clickable (`getCardHoverFill`): what it holds is drawn on that
|
|
15
|
-
* too, unless its effect paints a gradient over it.
|
|
16
|
-
*/
|
|
17
|
-
hoverFill?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface IReqoreDrawnSurface {
|
|
20
|
-
/** What it is on: what a component around it says, or its customTheme's main when it paints nothing. */
|
|
21
|
-
surface: TReqoreSurface | undefined;
|
|
22
|
-
/** Its fill as drawn over that (the surface itself when it paints nothing). */
|
|
23
|
-
background: TReqoreHexColor;
|
|
24
|
-
/** Each color what it holds is drawn on: its gradient's, when its effect paints one, else its fill (and its
|
|
25
|
-
* hover fill, when it is clickable). */
|
|
26
|
-
backgrounds: TReqoreHexColor[];
|
|
27
|
-
/** The text that reads on all of them. */
|
|
28
|
-
text: TReqoreHexColor;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* What a card (an entity row, a callout, a testimonial, a statistic, a feature card) is drawn on and in, worked out
|
|
32
|
-
* once for all of them, so they cannot drift apart in how they read their own colors.
|
|
33
|
-
*
|
|
34
|
-
* The values are one object each for as long as what they come from holds: a gradient is followed by its colors,
|
|
35
|
-
* not by the effect object, which given inline is new on every render (and so was every surface handed down).
|
|
36
|
-
*/
|
|
37
|
-
export declare const useReqoreDrawnSurface: ({ theme, customTheme, transparent, fill, effect, hoverFill, }: IReqoreDrawnSurfaceOptions) => IReqoreDrawnSurface;
|
|
38
|
-
//# sourceMappingURL=useDrawnSurface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDrawnSurface.d.ts","sourceRoot":"","sources":["../../src/hooks/useDrawnSurface.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,EACb,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,EAAqD,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGtG,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,YAAY,CAAC;IACpB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,gEAAgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,wGAAwG;IACxG,OAAO,EAAE,cAAc,GAAG,SAAS,CAAC;IACpC,+EAA+E;IAC/E,UAAU,EAAE,eAAe,CAAC;IAC5B;6CACyC;IACzC,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,0CAA0C;IAC1C,IAAI,EAAE,eAAe,CAAC;CACvB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,+DAOnC,0BAA0B,KAAG,mBAiC/B,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.useReqoreDrawnSurface = void 0;
|
|
13
|
-
var react_1 = require("react");
|
|
14
|
-
var Effect_1 = require("../components/Effect");
|
|
15
|
-
var SurfaceContext_1 = require("../context/SurfaceContext");
|
|
16
|
-
var colors_1 = require("../helpers/colors");
|
|
17
|
-
var surface_1 = require("../helpers/surface");
|
|
18
|
-
/**
|
|
19
|
-
* What a card (an entity row, a callout, a testimonial, a statistic, a feature card) is drawn on and in, worked out
|
|
20
|
-
* once for all of them, so they cannot drift apart in how they read their own colors.
|
|
21
|
-
*
|
|
22
|
-
* The values are one object each for as long as what they come from holds: a gradient is followed by its colors,
|
|
23
|
-
* not by the effect object, which given inline is new on every render (and so was every surface handed down).
|
|
24
|
-
*/
|
|
25
|
-
var useReqoreDrawnSurface = function (_a) {
|
|
26
|
-
var _b;
|
|
27
|
-
var theme = _a.theme, customTheme = _a.customTheme, transparent = _a.transparent, fill = _a.fill, effect = _a.effect, hoverFill = _a.hoverFill;
|
|
28
|
-
var aroundSurface = (0, SurfaceContext_1.useReqoreSurface)();
|
|
29
|
-
var surface = (0, react_1.useMemo)(function () { return (0, surface_1.getUnpaintedSurface)(theme, customTheme, aroundSurface, !!transparent); }, [theme, customTheme, aroundSurface, transparent]);
|
|
30
|
-
var background = (0, react_1.useMemo)(function () {
|
|
31
|
-
return transparent
|
|
32
|
-
? (0, colors_1.getThemeSurface)(theme, surface)
|
|
33
|
-
: (0, colors_1.getDrawnColor)(fill, (0, colors_1.getThemeSurface)(theme, surface));
|
|
34
|
-
}, [transparent, theme, fill, surface]);
|
|
35
|
-
var gradientKey = JSON.stringify((_b = effect === null || effect === void 0 ? void 0 : effect.gradient) !== null && _b !== void 0 ? _b : null);
|
|
36
|
-
var backgrounds = (0, react_1.useMemo)(function () {
|
|
37
|
-
var under = (0, colors_1.getThemeSurface)(theme, surface);
|
|
38
|
-
var drawn = (0, Effect_1.getEffectBackgrounds)(theme, effect, background, under);
|
|
39
|
-
// hovered, it paints its hover fill where its gradient does not cover it
|
|
40
|
-
return hoverFill && !(0, Effect_1.getPrimaryGradient)(effect === null || effect === void 0 ? void 0 : effect.gradient)
|
|
41
|
-
? __spreadArray(__spreadArray([], drawn, true), [(0, colors_1.getDrawnColor)(hoverFill, under)], false) : drawn;
|
|
42
|
-
// `effect` is followed by its gradient's colors (see above)
|
|
43
|
-
}, [theme, gradientKey, background, surface, hoverFill]);
|
|
44
|
-
var text = (0, react_1.useMemo)(function () { return (0, colors_1.getReadableTextOn)(theme, backgrounds); }, [theme, backgrounds]);
|
|
45
|
-
return (0, react_1.useMemo)(function () { return ({ surface: surface, background: background, backgrounds: backgrounds, text: text }); }, [surface, background, backgrounds, text]);
|
|
46
|
-
};
|
|
47
|
-
exports.useReqoreDrawnSurface = useReqoreDrawnSurface;
|
|
48
|
-
//# sourceMappingURL=useDrawnSurface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDrawnSurface.js","sourceRoot":"","sources":["../../src/hooks/useDrawnSurface.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAAgC;AAChC,+CAK8B;AAE9B,4DAA6D;AAC7D,4CAAsG;AACtG,8CAAyD;AA8BzD;;;;;;GAMG;AACI,IAAM,qBAAqB,GAAG,UAAC,EAOT;;QAN3B,KAAK,WAAA,EACL,WAAW,iBAAA,EACX,WAAW,iBAAA,EACX,IAAI,UAAA,EACJ,MAAM,YAAA,EACN,SAAS,eAAA;IAET,IAAM,aAAa,GAAG,IAAA,iCAAgB,GAAE,C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