@g4rcez/components 0.0.44 → 0.0.45
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/index.css +1 -1
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +585 -501
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +31 -31
- package/dist/index.umd.js.map +1 -1
- package/dist/preset/preset.tailwind.d.ts +2 -2
- package/dist/preset/preset.tailwind.d.ts.map +1 -1
- package/dist/preset/preset.tailwind.js +5 -5
- package/dist/preset/src/styles/dark.d.ts.map +1 -1
- package/dist/preset/src/styles/dark.js +37 -0
- package/dist/preset/src/styles/light.d.ts.map +1 -1
- package/dist/preset/src/styles/light.js +37 -0
- package/dist/preset/src/styles/theme.types.d.ts +5 -0
- package/dist/preset/src/styles/theme.types.d.ts.map +1 -1
- package/dist/preset.tailwind.d.ts +2 -2
- package/dist/preset.tailwind.d.ts.map +1 -1
- package/dist/preset.tailwind.js +5 -5
- package/dist/src/components/core/button.d.ts.map +1 -1
- package/dist/src/components/core/button.js +8 -8
- package/dist/src/components/display/alert.d.ts +4 -3
- package/dist/src/components/display/alert.d.ts.map +1 -1
- package/dist/src/components/display/alert.js +12 -9
- package/dist/src/styles/dark.d.ts.map +1 -1
- package/dist/src/styles/dark.js +37 -0
- package/dist/src/styles/light.d.ts.map +1 -1
- package/dist/src/styles/light.js +37 -0
- package/dist/src/styles/theme.types.d.ts +5 -0
- package/dist/src/styles/theme.types.d.ts.map +1 -1
- package/package.json +8 -2
- package/dist/components/core/button.d.ts +0 -16
- package/dist/components/core/button.d.ts.map +0 -1
- package/dist/components/core/button.js +0 -43
- package/dist/components/core/polymorph.d.ts +0 -10
- package/dist/components/core/polymorph.d.ts.map +0 -1
- package/dist/components/core/polymorph.js +0 -8
- package/dist/components/core/resizable.d.ts +0 -3
- package/dist/components/core/resizable.d.ts.map +0 -1
- package/dist/components/core/resizable.js +0 -50
- package/dist/components/core/tag.d.ts +0 -19
- package/dist/components/core/tag.d.ts.map +0 -1
- package/dist/components/core/tag.js +0 -45
- package/dist/components/display/alert.d.ts +0 -19
- package/dist/components/display/alert.d.ts.map +0 -1
- package/dist/components/display/alert.js +0 -34
- package/dist/components/display/calendar.d.ts +0 -42
- package/dist/components/display/calendar.d.ts.map +0 -1
- package/dist/components/display/calendar.js +0 -215
- package/dist/components/display/card.d.ts +0 -10
- package/dist/components/display/card.d.ts.map +0 -1
- package/dist/components/display/card.js +0 -8
- package/dist/components/display/list.d.ts +0 -16
- package/dist/components/display/list.d.ts.map +0 -1
- package/dist/components/display/list.js +0 -31
- package/dist/components/display/notifications.d.ts +0 -25
- package/dist/components/display/notifications.d.ts.map +0 -1
- package/dist/components/display/notifications.js +0 -70
- package/dist/components/display/stats.d.ts +0 -10
- package/dist/components/display/stats.d.ts.map +0 -1
- package/dist/components/display/stats.js +0 -5
- package/dist/components/display/tabs.d.ts +0 -20
- package/dist/components/display/tabs.d.ts.map +0 -1
- package/dist/components/display/tabs.js +0 -67
- package/dist/components/display/timeline.d.ts +0 -32
- package/dist/components/display/timeline.d.ts.map +0 -1
- package/dist/components/display/timeline.js +0 -21
- package/dist/components/floating/dropdown.d.ts +0 -14
- package/dist/components/floating/dropdown.d.ts.map +0 -1
- package/dist/components/floating/dropdown.js +0 -39
- package/dist/components/floating/expand.d.ts +0 -9
- package/dist/components/floating/expand.d.ts.map +0 -1
- package/dist/components/floating/expand.js +0 -25
- package/dist/components/floating/menu.d.ts +0 -52
- package/dist/components/floating/menu.d.ts.map +0 -1
- package/dist/components/floating/menu.js +0 -126
- package/dist/components/floating/modal.d.ts +0 -19
- package/dist/components/floating/modal.d.ts.map +0 -1
- package/dist/components/floating/modal.js +0 -102
- package/dist/components/floating/toolbar.d.ts +0 -6
- package/dist/components/floating/toolbar.d.ts.map +0 -1
- package/dist/components/floating/toolbar.js +0 -4
- package/dist/components/floating/tooltip.d.ts +0 -12
- package/dist/components/floating/tooltip.d.ts.map +0 -1
- package/dist/components/floating/tooltip.js +0 -28
- package/dist/components/form/autocomplete.d.ts +0 -17
- package/dist/components/form/autocomplete.d.ts.map +0 -1
- package/dist/components/form/autocomplete.js +0 -152
- package/dist/components/form/checkbox.d.ts +0 -11
- package/dist/components/form/checkbox.d.ts.map +0 -1
- package/dist/components/form/checkbox.js +0 -8
- package/dist/components/form/date-picker.d.ts +0 -61
- package/dist/components/form/date-picker.d.ts.map +0 -1
- package/dist/components/form/date-picker.js +0 -78
- package/dist/components/form/file-upload.d.ts +0 -12
- package/dist/components/form/file-upload.d.ts.map +0 -1
- package/dist/components/form/file-upload.js +0 -62
- package/dist/components/form/form.d.ts +0 -4
- package/dist/components/form/form.d.ts.map +0 -1
- package/dist/components/form/form.js +0 -28
- package/dist/components/form/input-field.d.ts +0 -30
- package/dist/components/form/input-field.d.ts.map +0 -1
- package/dist/components/form/input-field.js +0 -14
- package/dist/components/form/input.d.ts +0 -9
- package/dist/components/form/input.d.ts.map +0 -1
- package/dist/components/form/input.js +0 -38
- package/dist/components/form/radiobox.d.ts +0 -7
- package/dist/components/form/radiobox.d.ts.map +0 -1
- package/dist/components/form/radiobox.js +0 -7
- package/dist/components/form/select.d.ts +0 -13
- package/dist/components/form/select.d.ts.map +0 -1
- package/dist/components/form/select.js +0 -33
- package/dist/components/form/switch.d.ts +0 -8
- package/dist/components/form/switch.d.ts.map +0 -1
- package/dist/components/form/switch.js +0 -39
- package/dist/components/form/task-list.d.ts +0 -3
- package/dist/components/form/task-list.d.ts.map +0 -1
- package/dist/components/form/task-list.js +0 -26
- package/dist/components/form/transfer-list.d.ts +0 -14
- package/dist/components/form/transfer-list.d.ts.map +0 -1
- package/dist/components/form/transfer-list.js +0 -21
- package/dist/components/index.d.ts +0 -30
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -29
- package/dist/components/table/filter.d.ts +0 -41
- package/dist/components/table/filter.d.ts.map +0 -1
- package/dist/components/table/filter.js +0 -91
- package/dist/components/table/group.d.ts +0 -17
- package/dist/components/table/group.d.ts.map +0 -1
- package/dist/components/table/group.js +0 -43
- package/dist/components/table/index.d.ts +0 -38
- package/dist/components/table/index.d.ts.map +0 -1
- package/dist/components/table/index.js +0 -145
- package/dist/components/table/metadata.d.ts +0 -3
- package/dist/components/table/metadata.d.ts.map +0 -1
- package/dist/components/table/metadata.js +0 -10
- package/dist/components/table/pagination.d.ts +0 -3
- package/dist/components/table/pagination.d.ts.map +0 -1
- package/dist/components/table/pagination.js +0 -43
- package/dist/components/table/sort.d.ts +0 -28
- package/dist/components/table/sort.d.ts.map +0 -1
- package/dist/components/table/sort.js +0 -79
- package/dist/components/table/table-lib.d.ts +0 -122
- package/dist/components/table/table-lib.d.ts.map +0 -1
- package/dist/components/table/table-lib.js +0 -51
- package/dist/components/table/thead.d.ts +0 -8
- package/dist/components/table/thead.d.ts.map +0 -1
- package/dist/components/table/thead.js +0 -29
- package/dist/constants.d.ts +0 -3
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -2
- package/dist/hooks/use-callback-ref.d.ts +0 -3
- package/dist/hooks/use-callback-ref.d.ts.map +0 -1
- package/dist/hooks/use-callback-ref.js +0 -8
- package/dist/hooks/use-click-outside.d.ts +0 -3
- package/dist/hooks/use-click-outside.d.ts.map +0 -1
- package/dist/hooks/use-click-outside.js +0 -17
- package/dist/hooks/use-debounce.d.ts +0 -4
- package/dist/hooks/use-debounce.d.ts.map +0 -1
- package/dist/hooks/use-debounce.js +0 -12
- package/dist/hooks/use-form.d.ts +0 -41
- package/dist/hooks/use-form.d.ts.map +0 -1
- package/dist/hooks/use-form.js +0 -169
- package/dist/hooks/use-hover.d.ts +0 -3
- package/dist/hooks/use-hover.d.ts.map +0 -1
- package/dist/hooks/use-hover.js +0 -18
- package/dist/hooks/use-media-query.d.ts +0 -2
- package/dist/hooks/use-media-query.d.ts.map +0 -1
- package/dist/hooks/use-media-query.js +0 -25
- package/dist/hooks/use-mutable-state.d.ts +0 -2
- package/dist/hooks/use-mutable-state.d.ts.map +0 -1
- package/dist/hooks/use-mutable-state.js +0 -8
- package/dist/hooks/use-on-event.d.ts +0 -4
- package/dist/hooks/use-on-event.d.ts.map +0 -1
- package/dist/hooks/use-on-event.js +0 -7
- package/dist/hooks/use-parent.d.ts +0 -3
- package/dist/hooks/use-parent.d.ts.map +0 -1
- package/dist/hooks/use-parent.js +0 -21
- package/dist/hooks/use-previous.d.ts +0 -2
- package/dist/hooks/use-previous.d.ts.map +0 -1
- package/dist/hooks/use-previous.js +0 -8
- package/dist/hooks/use-reactive.d.ts +0 -2
- package/dist/hooks/use-reactive.d.ts.map +0 -1
- package/dist/hooks/use-reactive.js +0 -8
- package/dist/hooks/use-stable-ref.d.ts +0 -2
- package/dist/hooks/use-stable-ref.d.ts.map +0 -1
- package/dist/hooks/use-stable-ref.js +0 -8
- package/dist/hooks/use-translate-context.d.ts +0 -99
- package/dist/hooks/use-translate-context.d.ts.map +0 -1
- package/dist/hooks/use-translate-context.js +0 -53
- package/dist/index.d.ts +0 -12
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/dom.d.ts +0 -9
- package/dist/lib/dom.d.ts.map +0 -1
- package/dist/lib/dom.js +0 -34
- package/dist/lib/fns.d.ts +0 -7
- package/dist/lib/fns.d.ts.map +0 -1
- package/dist/lib/fns.js +0 -26
- package/dist/styles/design-tokens.d.ts +0 -19
- package/dist/styles/design-tokens.d.ts.map +0 -1
- package/dist/styles/design-tokens.js +0 -52
- package/dist/styles/theme.d.ts +0 -4
- package/dist/styles/theme.d.ts.map +0 -1
- package/dist/styles/theme.js +0 -294
- package/dist/styles/theme.types.d.ts +0 -101
- package/dist/styles/theme.types.d.ts.map +0 -1
- package/dist/styles/theme.types.js +0 -1
- package/dist/types.d.ts +0 -10
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -1
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useMemo, Fragment } from "react";
|
|
3
|
-
const defaultTranslations = {
|
|
4
|
-
inputCaretDown: "Click to see all options",
|
|
5
|
-
datePickerCalendarButtonLabel: "Click to open a date picker",
|
|
6
|
-
inputOptionalLabel: "Optional",
|
|
7
|
-
tableGroupLabel: "Group",
|
|
8
|
-
tableGroupLabelWithCount: "Group",
|
|
9
|
-
tableSortAsc: "Ascending",
|
|
10
|
-
tableSortOrderByLabel: "Order by",
|
|
11
|
-
tableSortOrderInputPlaceholder: "Order by",
|
|
12
|
-
tableSortOrderInputTitle: "Order by",
|
|
13
|
-
tableSortTypeInputPlaceholder: "Ascending",
|
|
14
|
-
tableSortTypeInputTitle: "Sort type",
|
|
15
|
-
tableSortAddButton: "Add sort",
|
|
16
|
-
tableSortDropdownTitle: "Order by",
|
|
17
|
-
tableSortDesc: "Descending",
|
|
18
|
-
tableFilterTypeContains: "Contains",
|
|
19
|
-
tableFilterTypeIs: "Is",
|
|
20
|
-
tableFilterTypeIsNot: "Is not",
|
|
21
|
-
tableFilterTypeNotContains: "Not contains",
|
|
22
|
-
tableFilterTypeLessThan: "Less than",
|
|
23
|
-
tableFilterTypeGreaterThan: "Greater than",
|
|
24
|
-
tableFilterTypeStartsWith: "Starts with",
|
|
25
|
-
tableFilterTypeEndsWith: "Ends with",
|
|
26
|
-
tableFilterNewFilter: "New filter",
|
|
27
|
-
tableFilterColumnTitle: "Filter by",
|
|
28
|
-
tableFilterColumnPlaceholder: "Filter by",
|
|
29
|
-
tableFilterOperatorTitle: "Operation",
|
|
30
|
-
tableFilterOperatorPlaceholder: "Equals to...",
|
|
31
|
-
tableFilterValueTitle: "Value",
|
|
32
|
-
tableFilterValuePlaceholder: "Something...",
|
|
33
|
-
tableFilterLabel: "Filters",
|
|
34
|
-
tableFilterDropdownTitle: "Filters",
|
|
35
|
-
tableFilterDropdownTitleUnique: "Filter by",
|
|
36
|
-
tablePaginationPrevious: "Previous",
|
|
37
|
-
tablePaginationNext: "Next",
|
|
38
|
-
tablePaginationSelectLabel: "Select the size of page",
|
|
39
|
-
tablePaginationFooter: (pagination) => _jsxs(Fragment, { children: [pagination.current, " to ", pagination.pages, " of ", pagination.totalItems, " items.", Array.isArray(pagination.sizes) ? (pagination.select) : null, " per page."] }),
|
|
40
|
-
calendarFromDate: "From",
|
|
41
|
-
calendarToDate: "To",
|
|
42
|
-
};
|
|
43
|
-
const Context = createContext({ translations: defaultTranslations });
|
|
44
|
-
export const ComponentsProvider = (props) => {
|
|
45
|
-
const memoMap = useMemo(() => ({ translations: Object.assign(Object.assign({}, defaultTranslations), props.map) }), [props.map]);
|
|
46
|
-
return _jsx(Context.Provider, { value: memoMap, children: props.children });
|
|
47
|
-
};
|
|
48
|
-
export const useTranslations = () => {
|
|
49
|
-
const ctx = useContext(Context);
|
|
50
|
-
if (!ctx)
|
|
51
|
-
return defaultTranslations;
|
|
52
|
-
return ctx.translations;
|
|
53
|
-
};
|
package/dist/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "./components";
|
|
2
|
-
export * from "./hooks/use-form";
|
|
3
|
-
export * from "./hooks/use-previous";
|
|
4
|
-
export * from "./hooks/use-reactive";
|
|
5
|
-
export { ComponentsProvider, useTranslations } from "./hooks/use-translate-context";
|
|
6
|
-
export * from "./lib/dom";
|
|
7
|
-
export * from "./lib/fns";
|
|
8
|
-
export * from "./styles/theme";
|
|
9
|
-
export * from "./styles/design-tokens";
|
|
10
|
-
export type * from "./types";
|
|
11
|
-
export { createColumns, createOptionCols, ColType, useTablePreferences } from "./components/table/table-lib";
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACpF,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,mBAAmB,SAAS,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/lib/dom.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ClassValue } from "clsx";
|
|
2
|
-
import React, { LegacyRef, MutableRefObject, RefCallback } from "react";
|
|
3
|
-
export declare const mergeRefs: <T extends unknown = any>(...refs: Array<MutableRefObject<T> | LegacyRef<T> | undefined | null>) => RefCallback<T>;
|
|
4
|
-
export declare const isReactComponent: (a: any) => a is React.ReactElement;
|
|
5
|
-
export declare const isReactFC: (a: any) => a is (...any: any[]) => any;
|
|
6
|
-
export declare const css: (...styles: ClassValue[]) => string;
|
|
7
|
-
export declare const dispatchInput: (input: HTMLInputElement | undefined | null, newValue: string) => Event;
|
|
8
|
-
export declare const initializeInputDataset: (input: HTMLInputElement | HTMLSelectElement) => () => void;
|
|
9
|
-
//# sourceMappingURL=dom.d.ts.map
|
package/dist/lib/dom.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/lib/dom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AACxC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAIxE,eAAO,MAAM,SAAS,GACjB,CAAC,iCAA6B,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,KAAG,WAAW,CAAC,CAAC,CAS1G,CAAC;AAEN,eAAO,MAAM,gBAAgB,MAAO,GAAG,KAAG,CAAC,IAAI,KAAK,CAAC,YAQpD,CAAC;AAEF,eAAO,MAAM,SAAS,MAAO,GAAG,gCAAmB,CAAC;AAEpD,eAAO,MAAM,GAAG,cAAe,UAAU,EAAE,WAA0B,CAAC;AAEtE,eAAO,MAAM,aAAa,UAAW,gBAAgB,GAAG,SAAS,GAAG,IAAI,YAAY,MAAM,UAIzF,CAAC;AAEF,eAAO,MAAM,sBAAsB,UAAW,gBAAgB,GAAG,iBAAiB,eAIjF,CAAC"}
|
package/dist/lib/dom.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { clsx } from "clsx";
|
|
2
|
-
import { Is } from "sidekicker";
|
|
3
|
-
import { twMerge } from "tailwind-merge";
|
|
4
|
-
export const mergeRefs = (...refs) => (value) => {
|
|
5
|
-
refs.forEach((ref) => {
|
|
6
|
-
if (typeof ref === "function") {
|
|
7
|
-
ref(value);
|
|
8
|
-
}
|
|
9
|
-
else if (ref !== null) {
|
|
10
|
-
ref.current = value;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
export const isReactComponent = (a) => {
|
|
15
|
-
if (a.$$typeof === Symbol.for("react.forward_ref")) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
if (a.$$typeof === Symbol.for("react.fragment")) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
return a.$$typeof === Symbol.for("react.element");
|
|
22
|
-
};
|
|
23
|
-
export const isReactFC = (a) => Is.function(a);
|
|
24
|
-
export const css = (...styles) => twMerge(clsx(styles));
|
|
25
|
-
export const dispatchInput = (input, newValue) => {
|
|
26
|
-
const event = new Event("input", { bubbles: true });
|
|
27
|
-
input === null || input === void 0 ? void 0 : input.dispatchEvent(event);
|
|
28
|
-
return event;
|
|
29
|
-
};
|
|
30
|
-
export const initializeInputDataset = (input) => {
|
|
31
|
-
const focus = () => input.setAttribute("data-initialized", "true");
|
|
32
|
-
input.addEventListener("focus", focus);
|
|
33
|
-
return () => input.removeEventListener("focus", focus);
|
|
34
|
-
};
|
package/dist/lib/fns.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { AllPaths } from "sidekicker";
|
|
2
|
-
export declare const uuid: () => string;
|
|
3
|
-
export declare const path: <T extends {}, K extends AllPaths<T>>(obj: T, path: K) => any;
|
|
4
|
-
export declare const isSsr: () => boolean;
|
|
5
|
-
export declare const safeRegex: (string: string) => string;
|
|
6
|
-
export declare const splitInto: <T extends unknown>(array: T[], size: number) => T[][];
|
|
7
|
-
//# sourceMappingURL=fns.d.ts.map
|
package/dist/lib/fns.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fns.d.ts","sourceRoot":"","sources":["../../src/lib/fns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,IAAI,QAAO,MAKlB,CAAC;AAUP,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,QAGxE,CAAC;AAEF,eAAO,MAAM,KAAK,eAAsC,CAAC;AAEzD,eAAO,MAAM,SAAS,WAAY,MAAM,WAAkD,CAAC;AAG3F,eAAO,MAAM,SAAS,GAAI,CAAC,yBAAqB,CAAC,EAAE,QAAQ,MAAM,UAQhE,CAAC"}
|
package/dist/lib/fns.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export const uuid = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
2
|
-
let r = (Math.random() * 16) | 0;
|
|
3
|
-
let v = c == "x" ? r : (r & 0x3) | 0x8;
|
|
4
|
-
return v.toString(16);
|
|
5
|
-
});
|
|
6
|
-
const travel = (path, regexp, obj) => path
|
|
7
|
-
.split(regexp)
|
|
8
|
-
.filter(Boolean)
|
|
9
|
-
.reduce((res, key) => (res !== null && res !== undefined ? res[key] : res), obj);
|
|
10
|
-
const regexPaths = { basic: /[,[\]]+?/, extend: /[,[\].]+?/ };
|
|
11
|
-
export const path = (obj, path) => {
|
|
12
|
-
const result = travel(path, regexPaths.basic, obj) || travel(path, regexPaths.extend, obj);
|
|
13
|
-
return result === undefined || result === obj ? undefined : result;
|
|
14
|
-
};
|
|
15
|
-
export const isSsr = () => typeof window === "undefined";
|
|
16
|
-
export const safeRegex = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
17
|
-
export const splitInto = (array, size) => {
|
|
18
|
-
const newArray = [];
|
|
19
|
-
for (let i = 0; i < size; i++) {
|
|
20
|
-
const init = i * size;
|
|
21
|
-
const result = array.slice(init, init + size);
|
|
22
|
-
if (result.length > 0)
|
|
23
|
-
newArray.push(result);
|
|
24
|
-
}
|
|
25
|
-
return newArray;
|
|
26
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DesignTokens, DesignTokensBuilder, DesignTokensParser, GeneralTokens, Token } from "./theme.types";
|
|
2
|
-
export declare const parsers: {
|
|
3
|
-
cssVariable: (_: string, __: string, k: string) => `var(--${string})`;
|
|
4
|
-
rgba: (v: string) => `rgba(${string})`;
|
|
5
|
-
rgb: (v: string) => `rgb(${string})`;
|
|
6
|
-
hsl: (v: string) => `hsl(${string})`;
|
|
7
|
-
hsla: (v: string) => `hsla(${string})`;
|
|
8
|
-
hex: (v: string) => string;
|
|
9
|
-
raw: (v: string) => string;
|
|
10
|
-
formatWithVar: (format: string) => (_: string, __: string, v: string) => `${string}(var(--${string}), <alpha-value>)`;
|
|
11
|
-
};
|
|
12
|
-
export declare const reduceTokens: <T extends GeneralTokens>(colors: T, parse: DesignTokensBuilder, prefix?: string, append?: string) => Token[];
|
|
13
|
-
export declare const createDesignTokens: <T extends GeneralTokens, Fn extends DesignTokensParser>(colors: T, parse: Fn, prefix?: string, append?: string) => T;
|
|
14
|
-
export declare const createStyles: {
|
|
15
|
-
default: (tokens: Token[]) => string;
|
|
16
|
-
dark: (tokens: Token[]) => string;
|
|
17
|
-
};
|
|
18
|
-
export declare const createTheme: (theme: DesignTokens, name?: string) => string;
|
|
19
|
-
//# sourceMappingURL=design-tokens.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"design-tokens.d.ts","sourceRoot":"","sources":["../../src/styles/design-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE5G,eAAO,MAAM,OAAO;;cAEN,MAAM;aACP,MAAM;aACN,MAAM;cACL,MAAM;aACP,MAAM;aACN,MAAM;4BACS,MAAM,SAAS,MAAM,MAAM,MAAM,KAAK,MAAM;CAC1B,CAAC;AAE/C,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,aAAa,UAAU,CAAC,SAAS,mBAAmB,WAAU,MAAM,WAAe,MAAM,KAAQ,KAAK,EAQnI,CAAC;AAEX,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,aAAa,EAAE,EAAE,SAAS,kBAAkB,UAC7E,CAAC,SACF,EAAE,WACD,MAAM,WACN,MAAM,KACf,CAWY,CAAC;AAmBhB,eAAO,MAAM,YAAY;sBACH,KAAK,EAAE;mBACV,KAAK,EAAE;CACzB,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,YAAY,SAAS,MAAM,WAY7D,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export const parsers = {
|
|
2
|
-
cssVariable: (_, __, k) => `var(--${k})`,
|
|
3
|
-
rgba: (v) => `rgba(${v})`,
|
|
4
|
-
rgb: (v) => `rgb(${v})`,
|
|
5
|
-
hsl: (v) => `hsl(${v})`,
|
|
6
|
-
hsla: (v) => `hsla(${v})`,
|
|
7
|
-
hex: (v) => v,
|
|
8
|
-
raw: (v) => v,
|
|
9
|
-
formatWithVar: (format) => (_, __, v) => `${format}(var(--${v}), <alpha-value>)`,
|
|
10
|
-
};
|
|
11
|
-
export const reduceTokens = (colors, parse, prefix = "", append = "") => Object.entries(colors).reduce((acc, [key, value]) => {
|
|
12
|
-
const combine = append === "" ? `${prefix}${key}` : `${append}-${key}`;
|
|
13
|
-
if (typeof value === "string") {
|
|
14
|
-
const k = append === "" ? `${prefix}${key}` : key;
|
|
15
|
-
return acc.concat(parse(value, k, combine));
|
|
16
|
-
}
|
|
17
|
-
return acc.concat(reduceTokens(value, parse, prefix, combine));
|
|
18
|
-
}, []);
|
|
19
|
-
export const createDesignTokens = (colors, parse, prefix = "", append = "") => Object.entries(colors).reduce((acc, [key, value]) => {
|
|
20
|
-
const combine = append === "" ? `${prefix}${key}` : `${append}-${key}`;
|
|
21
|
-
if (typeof value === "string") {
|
|
22
|
-
const k = append === "" ? `${prefix}${key}` : key;
|
|
23
|
-
return Object.assign(Object.assign({}, acc), { [k]: parse(value, key, combine) });
|
|
24
|
-
}
|
|
25
|
-
return Object.assign(Object.assign({}, acc), { [key]: createDesignTokens(value, parse, prefix, combine) });
|
|
26
|
-
}, {});
|
|
27
|
-
const modifiers = {
|
|
28
|
-
default: (variables) => `:root { ${variables} }`,
|
|
29
|
-
dark: (variables) => `html.dark {${variables}}`,
|
|
30
|
-
};
|
|
31
|
-
const createStyleContent = (tokens, modifiers) => {
|
|
32
|
-
const v = modifiers.value || ((_, s) => s);
|
|
33
|
-
const content = tokens.map((token) => `${token.key}: ${v(token.key, token.value)}`).join(";");
|
|
34
|
-
return modifiers.result(content);
|
|
35
|
-
};
|
|
36
|
-
export const createStyles = {
|
|
37
|
-
default: (tokens) => createStyleContent(tokens, { result: modifiers.default }),
|
|
38
|
-
dark: (tokens) => createStyleContent(tokens, { result: modifiers.dark }),
|
|
39
|
-
};
|
|
40
|
-
export const createTheme = (theme, name) => {
|
|
41
|
-
const fn = (value, _, key) => ({
|
|
42
|
-
key: `--${key}`,
|
|
43
|
-
value: `${value}`,
|
|
44
|
-
});
|
|
45
|
-
const colors = reduceTokens(theme.colors, fn);
|
|
46
|
-
const spacing = reduceTokens(theme.spacing, fn);
|
|
47
|
-
const rounded = reduceTokens(theme.rounded, fn);
|
|
48
|
-
return createStyleContent(colors.concat(spacing, rounded), {
|
|
49
|
-
result: (variables) => `html${name ? `.${name}` : ""} {${variables}}`,
|
|
50
|
-
value: (_, v) => v.replace("hsla(", "").replace(")", ""),
|
|
51
|
-
});
|
|
52
|
-
};
|
package/dist/styles/theme.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/styles/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAoB7C,eAAO,MAAM,gBAAgB,EAAE,YA0I9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YA0I/B,CAAC"}
|
package/dist/styles/theme.js
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
const rounded = {
|
|
2
|
-
button: "0.4rem",
|
|
3
|
-
pill: "2rem",
|
|
4
|
-
card: "0.75rem",
|
|
5
|
-
full: "9999px",
|
|
6
|
-
};
|
|
7
|
-
const spacing = {
|
|
8
|
-
base: "1rem",
|
|
9
|
-
lg: "1.5rem",
|
|
10
|
-
sm: "0.75rem",
|
|
11
|
-
"input-height": "2.5rem",
|
|
12
|
-
"input-x": "0.5rem",
|
|
13
|
-
"input-y": "0.25rem",
|
|
14
|
-
"input-inline": "0.25rem",
|
|
15
|
-
"input-gap": "0.375rem",
|
|
16
|
-
};
|
|
17
|
-
export const defaultDarkTheme = {
|
|
18
|
-
name: "dark",
|
|
19
|
-
rounded,
|
|
20
|
-
spacing,
|
|
21
|
-
shadow: {
|
|
22
|
-
floating: "rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 5px 12px",
|
|
23
|
-
},
|
|
24
|
-
colors: {
|
|
25
|
-
foreground: "hsla(210, 50%, 98%)",
|
|
26
|
-
background: "hsla(0, 0%, 9%)",
|
|
27
|
-
disabled: "hsla(240, 4%, 33%)",
|
|
28
|
-
primary: {
|
|
29
|
-
foreground: "hsla(210, 40%, 98%)",
|
|
30
|
-
DEFAULT: "hsla(200,98%,39%)",
|
|
31
|
-
subtle: "hsla(199, 95%, 87%)",
|
|
32
|
-
hover: "hsla(199, 97%, 40%)",
|
|
33
|
-
},
|
|
34
|
-
secondary: {
|
|
35
|
-
DEFAULT: "hsla(210, 32%, 70%)",
|
|
36
|
-
background: "hsla(210, 30%, 81%)",
|
|
37
|
-
subtle: "hsla(210, 27%, 88%)",
|
|
38
|
-
hover: "hsla(210, 10%, 58%)",
|
|
39
|
-
foreground: "hsla(210, 20%, 30%)",
|
|
40
|
-
},
|
|
41
|
-
info: {
|
|
42
|
-
DEFAULT: "hsla(219, 91%, 59%)",
|
|
43
|
-
subtle: "hsla(219, 93%, 77%)",
|
|
44
|
-
hover: "hsla(219, 83%, 41%)",
|
|
45
|
-
foreground: "hsla(210, 40%, 98%)",
|
|
46
|
-
notification: "hsla(219, 91%, 59%)",
|
|
47
|
-
},
|
|
48
|
-
warn: {
|
|
49
|
-
DEFAULT: "hsla(27, 96%, 61%)",
|
|
50
|
-
subtle: "hsla(45, 95%, 66%)",
|
|
51
|
-
hover: "hsla(21, 90%, 48%)",
|
|
52
|
-
foreground: "hsla(210, 40%, 98%)",
|
|
53
|
-
notification: "hsla(32, 65%, 75%)",
|
|
54
|
-
},
|
|
55
|
-
danger: {
|
|
56
|
-
DEFAULT: "hsla(358, 65%, 57%)",
|
|
57
|
-
subtle: "hsla(0, 94%, 81%)",
|
|
58
|
-
hover: "hsla(0, 82%, 47%)",
|
|
59
|
-
foreground: "hsla(210, 40%, 98%)",
|
|
60
|
-
notification: "hsla(358, 40%, 23%)",
|
|
61
|
-
},
|
|
62
|
-
success: {
|
|
63
|
-
DEFAULT: "hsla(160, 73%, 36%)",
|
|
64
|
-
subtle: "hsla(160, 75%, 75%)",
|
|
65
|
-
hover: "hsla(160, 91%, 27%)",
|
|
66
|
-
foreground: "hsla(160, 91%, 50%)",
|
|
67
|
-
notification: "hsla(161,62%,17%)",
|
|
68
|
-
},
|
|
69
|
-
input: {
|
|
70
|
-
border: "hsla(240, 4%, 25%)",
|
|
71
|
-
placeholder: "hsla(210, 24%, 71%)",
|
|
72
|
-
"mask-error": "hsla(0, 94%, 81%)",
|
|
73
|
-
"switch-bg": "hsla(0, 0%, 9%)",
|
|
74
|
-
switch: "hsla(0, 0%, 100%)",
|
|
75
|
-
},
|
|
76
|
-
card: {
|
|
77
|
-
background: "hsla(0, 0%, 15%)",
|
|
78
|
-
border: "hsla(240, 7%, 27%)",
|
|
79
|
-
},
|
|
80
|
-
floating: {
|
|
81
|
-
background: "hsla(0, 0%, 14%)",
|
|
82
|
-
border: "hsla(240, 7%, 27%)",
|
|
83
|
-
overlay: "hsla(0, 0%, 0%)",
|
|
84
|
-
},
|
|
85
|
-
tooltip: {
|
|
86
|
-
foreground: "hsla(210, 40%, 98%)",
|
|
87
|
-
background: "hsla(0, 0%, 8%)",
|
|
88
|
-
border: "hsla(0, 0%, 19%)",
|
|
89
|
-
},
|
|
90
|
-
table: {
|
|
91
|
-
background: "hsla(0, 0%, 15%)",
|
|
92
|
-
border: "hsla(240, 4%, 33%)",
|
|
93
|
-
},
|
|
94
|
-
button: {
|
|
95
|
-
primary: {
|
|
96
|
-
text: "hsla(200,98%,60%)",
|
|
97
|
-
bg: "hsla(200,28%,19%)",
|
|
98
|
-
},
|
|
99
|
-
warn: {
|
|
100
|
-
text: "hsla(26,100%,67%)",
|
|
101
|
-
bg: "hsla(37,100%,15%)",
|
|
102
|
-
},
|
|
103
|
-
info: {
|
|
104
|
-
text: "hsla(200,80%,70%)",
|
|
105
|
-
bg: "hsla(206,66%,24%)",
|
|
106
|
-
},
|
|
107
|
-
success: {
|
|
108
|
-
text: "hsla(151,65%,54%)",
|
|
109
|
-
bg: "hsla(154,52%,19%)",
|
|
110
|
-
},
|
|
111
|
-
danger: {
|
|
112
|
-
text: "hsla(2,100%,90%)",
|
|
113
|
-
bg: "hsla(5,62%,23%)",
|
|
114
|
-
},
|
|
115
|
-
neutral: {
|
|
116
|
-
text: "hsla(200,98%,60%)",
|
|
117
|
-
bg: "hsla(200,28%,19%)",
|
|
118
|
-
},
|
|
119
|
-
secondary: {
|
|
120
|
-
text: "hsla(216,10%,90%)",
|
|
121
|
-
bg: "hsla(214,7%,19%)",
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
tag: {
|
|
125
|
-
primary: {
|
|
126
|
-
text: "hsla(200,98%,60%)",
|
|
127
|
-
bg: "hsla(200,28%,19%)",
|
|
128
|
-
},
|
|
129
|
-
warn: {
|
|
130
|
-
text: "hsla(26,100%,67%)",
|
|
131
|
-
bg: "hsla(37,100%,15%)",
|
|
132
|
-
},
|
|
133
|
-
info: {
|
|
134
|
-
text: "hsla(200,80%,70%)",
|
|
135
|
-
bg: "hsla(206,66%,24%)",
|
|
136
|
-
},
|
|
137
|
-
success: {
|
|
138
|
-
text: "hsla(151,65%,54%)",
|
|
139
|
-
bg: "hsla(154,52%,19%)",
|
|
140
|
-
},
|
|
141
|
-
danger: {
|
|
142
|
-
text: "hsla(2,100%,79%)",
|
|
143
|
-
bg: "hsla(5,62%,23%)",
|
|
144
|
-
},
|
|
145
|
-
neutral: {
|
|
146
|
-
text: "hsla(200,98%,60%)",
|
|
147
|
-
bg: "hsla(200,28%,19%)",
|
|
148
|
-
},
|
|
149
|
-
secondary: {
|
|
150
|
-
text: "hsla(216,10%,90%)",
|
|
151
|
-
bg: "hsla(214,7%,19%)",
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
export const defaultLightTheme = {
|
|
157
|
-
name: "light",
|
|
158
|
-
rounded,
|
|
159
|
-
spacing,
|
|
160
|
-
shadow: {
|
|
161
|
-
floating: "rgba(50, 50, 50, 0.1) 0px 0px 0px 1px, rgba(50, 50, 50, 0.1) 0px 3px 6px, rgba(50, 50, 50, 0.1) 0px 2px 3px",
|
|
162
|
-
},
|
|
163
|
-
colors: {
|
|
164
|
-
foreground: "hsla(217, 15%, 30%)",
|
|
165
|
-
background: "hsla(210, 34%, 96%)",
|
|
166
|
-
disabled: "hsla(240, 10%, 78%)",
|
|
167
|
-
primary: {
|
|
168
|
-
foreground: "hsla(210, 40%, 98%)",
|
|
169
|
-
DEFAULT: "hsla(199, 89%, 54%)",
|
|
170
|
-
subtle: "hsla(199, 95%, 87%)",
|
|
171
|
-
hover: "hsla(199, 97%, 40%)",
|
|
172
|
-
},
|
|
173
|
-
secondary: {
|
|
174
|
-
background: "hsla(210, 25%, 35%)",
|
|
175
|
-
DEFAULT: "hsla(210, 25%, 35%)",
|
|
176
|
-
subtle: "hsla(207, 29%, 39%)",
|
|
177
|
-
hover: "hsla(210, 21%, 67%)",
|
|
178
|
-
foreground: "hsla(210, 40%, 98%)",
|
|
179
|
-
},
|
|
180
|
-
info: {
|
|
181
|
-
DEFAULT: "hsla(219, 91%, 59%)",
|
|
182
|
-
subtle: "hsla(219, 70%, 90%)",
|
|
183
|
-
hover: "hsla(219, 83%, 41%)",
|
|
184
|
-
foreground: "hsla(210, 34%, 96%)",
|
|
185
|
-
notification: "hsla(219, 91%, 59%)",
|
|
186
|
-
},
|
|
187
|
-
danger: {
|
|
188
|
-
DEFAULT: "hsla(0, 82%, 63%)",
|
|
189
|
-
subtle: "hsla(0, 96%, 95%)",
|
|
190
|
-
hover: "hsla(0, 82%, 47%)",
|
|
191
|
-
foreground: "hsla(210, 34%, 96%)",
|
|
192
|
-
notification: "hsla(0, 100%, 87%)",
|
|
193
|
-
},
|
|
194
|
-
warn: {
|
|
195
|
-
DEFAULT: "hsla(27, 100%, 70%)",
|
|
196
|
-
subtle: "hsla(45, 95%, 80%)",
|
|
197
|
-
hover: "hsla(29, 85%, 50%)",
|
|
198
|
-
foreground: "hsla(210, 34%, 96%)",
|
|
199
|
-
notification: "hsla(27, 85%, 92%)",
|
|
200
|
-
},
|
|
201
|
-
success: {
|
|
202
|
-
DEFAULT: "hsla(160, 73%, 36%)",
|
|
203
|
-
subtle: "hsla(160, 75%, 90%)",
|
|
204
|
-
hover: "hsla(160, 91%, 27%)",
|
|
205
|
-
foreground: "hsla(160, 91%, 17%)",
|
|
206
|
-
notification: "hsla(160, 75%, 80%)",
|
|
207
|
-
},
|
|
208
|
-
input: {
|
|
209
|
-
border: "hsla(218, 22%, 85%)",
|
|
210
|
-
placeholder: "hsla(210, 24%, 71%)",
|
|
211
|
-
"mask-error": "hsla(0, 94%, 81%)",
|
|
212
|
-
"switch-bg": "hsla(0, 0%, 45%)",
|
|
213
|
-
switch: "hsla(0, 0%, 100%)",
|
|
214
|
-
},
|
|
215
|
-
card: {
|
|
216
|
-
background: "hsla(0, 0%, 100%)",
|
|
217
|
-
border: "hsla(210, 25%, 88%)",
|
|
218
|
-
},
|
|
219
|
-
floating: {
|
|
220
|
-
background: "hsla(0, 0%, 100%)",
|
|
221
|
-
border: "hsla(210, 25%, 88%)",
|
|
222
|
-
overlay: "hsla(0, 0%, 0%)",
|
|
223
|
-
},
|
|
224
|
-
tooltip: {
|
|
225
|
-
foreground: "hsla(217, 15%, 20%)",
|
|
226
|
-
background: "hsla(210, 25%, 98%)",
|
|
227
|
-
border: "hsla(200, 1%, 80%)",
|
|
228
|
-
},
|
|
229
|
-
table: {
|
|
230
|
-
background: "hsla(0, 0%, 100%)",
|
|
231
|
-
border: "hsla(210, 25%, 88%)",
|
|
232
|
-
},
|
|
233
|
-
button: {
|
|
234
|
-
primary: {
|
|
235
|
-
text: "hsla(0, 0%, 100%)",
|
|
236
|
-
bg: "hsla(207,96%,48%)",
|
|
237
|
-
},
|
|
238
|
-
warn: {
|
|
239
|
-
bg: "hsla(26,90%,60%)",
|
|
240
|
-
text: "hsla(0, 0%, 100%)",
|
|
241
|
-
},
|
|
242
|
-
info: {
|
|
243
|
-
text: "hsla(0, 0%, 100%)",
|
|
244
|
-
bg: "hsla(210,60%,60%)",
|
|
245
|
-
},
|
|
246
|
-
success: {
|
|
247
|
-
text: "hsla(0, 0%, 100%)",
|
|
248
|
-
bg: "hsla(152,56%,39%)",
|
|
249
|
-
},
|
|
250
|
-
danger: {
|
|
251
|
-
text: "hsla(0, 0%, 100%)",
|
|
252
|
-
bg: "hsla(10,78%,54%)",
|
|
253
|
-
},
|
|
254
|
-
neutral: {
|
|
255
|
-
text: "hsla(200,98%,60%)",
|
|
256
|
-
bg: "hsla(200,28%,19%)",
|
|
257
|
-
},
|
|
258
|
-
secondary: {
|
|
259
|
-
text: "hsla(216,10%,90%)",
|
|
260
|
-
bg: "hsla(214,7%,19%)",
|
|
261
|
-
},
|
|
262
|
-
},
|
|
263
|
-
tag: {
|
|
264
|
-
primary: {
|
|
265
|
-
text: "hsla(0, 0%, 100%)",
|
|
266
|
-
bg: "hsla(207,70%,55%)",
|
|
267
|
-
},
|
|
268
|
-
warn: {
|
|
269
|
-
bg: "hsla(30,100%,82%)",
|
|
270
|
-
text: "hsla(23,100%,40%)",
|
|
271
|
-
},
|
|
272
|
-
info: {
|
|
273
|
-
text: "hsla(196,100%,20%)",
|
|
274
|
-
bg: "hsla(197,65%,80%)",
|
|
275
|
-
},
|
|
276
|
-
success: {
|
|
277
|
-
text: "hsla(154,52%,19%)",
|
|
278
|
-
bg: "hsla(152,56%,80%)",
|
|
279
|
-
},
|
|
280
|
-
danger: {
|
|
281
|
-
text: "hsla(10,82%,45%)",
|
|
282
|
-
bg: "hsla(359,94%,92%)",
|
|
283
|
-
},
|
|
284
|
-
neutral: {
|
|
285
|
-
text: "hsla(200,98%,60%)",
|
|
286
|
-
bg: "hsla(200,28%,19%)",
|
|
287
|
-
},
|
|
288
|
-
secondary: {
|
|
289
|
-
text: "hsla(216,10%,90%)",
|
|
290
|
-
bg: "hsla(214,7%,19%)",
|
|
291
|
-
},
|
|
292
|
-
},
|
|
293
|
-
},
|
|
294
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
export type GeneralTokens = {
|
|
2
|
-
[K in string]: string | GeneralTokens;
|
|
3
|
-
};
|
|
4
|
-
type ThemeState = "primary" | "warn" | "secondary" | "info" | "danger" | "success" | "neutral";
|
|
5
|
-
export type DesignTokens = {
|
|
6
|
-
name: string;
|
|
7
|
-
shadow: Record<"floating", string>;
|
|
8
|
-
rounded: Record<"button" | "full" | "pill" | "card", string>;
|
|
9
|
-
spacing: Record<"base" | "lg" | "sm", string>;
|
|
10
|
-
colors: {
|
|
11
|
-
tag: Record<ThemeState, {
|
|
12
|
-
text: string;
|
|
13
|
-
bg: string;
|
|
14
|
-
}>;
|
|
15
|
-
button: Record<ThemeState, {
|
|
16
|
-
text: string;
|
|
17
|
-
bg: string;
|
|
18
|
-
}>;
|
|
19
|
-
foreground: string;
|
|
20
|
-
background: string;
|
|
21
|
-
disabled: string;
|
|
22
|
-
primary: {
|
|
23
|
-
foreground: string;
|
|
24
|
-
DEFAULT: string;
|
|
25
|
-
subtle: string;
|
|
26
|
-
hover: string;
|
|
27
|
-
};
|
|
28
|
-
warn: {
|
|
29
|
-
DEFAULT: string;
|
|
30
|
-
subtle: string;
|
|
31
|
-
hover: string;
|
|
32
|
-
foreground: string;
|
|
33
|
-
notification: string;
|
|
34
|
-
};
|
|
35
|
-
secondary: {
|
|
36
|
-
DEFAULT: string;
|
|
37
|
-
background: string;
|
|
38
|
-
subtle: string;
|
|
39
|
-
hover: string;
|
|
40
|
-
foreground: string;
|
|
41
|
-
};
|
|
42
|
-
info: {
|
|
43
|
-
DEFAULT: string;
|
|
44
|
-
subtle: string;
|
|
45
|
-
hover: string;
|
|
46
|
-
foreground: string;
|
|
47
|
-
notification: string;
|
|
48
|
-
};
|
|
49
|
-
danger: {
|
|
50
|
-
DEFAULT: string;
|
|
51
|
-
subtle: string;
|
|
52
|
-
hover: string;
|
|
53
|
-
foreground: string;
|
|
54
|
-
notification: string;
|
|
55
|
-
};
|
|
56
|
-
success: {
|
|
57
|
-
DEFAULT: string;
|
|
58
|
-
subtle: string;
|
|
59
|
-
hover: string;
|
|
60
|
-
foreground: string;
|
|
61
|
-
notification: string;
|
|
62
|
-
};
|
|
63
|
-
input: {
|
|
64
|
-
border: string;
|
|
65
|
-
placeholder: string;
|
|
66
|
-
"mask-error": string;
|
|
67
|
-
"switch-bg": string;
|
|
68
|
-
switch: string;
|
|
69
|
-
};
|
|
70
|
-
card: {
|
|
71
|
-
background: string;
|
|
72
|
-
border: string;
|
|
73
|
-
};
|
|
74
|
-
floating: {
|
|
75
|
-
background: string;
|
|
76
|
-
border: string;
|
|
77
|
-
overlay: string;
|
|
78
|
-
};
|
|
79
|
-
tooltip: {
|
|
80
|
-
foreground: string;
|
|
81
|
-
background: string;
|
|
82
|
-
border: string;
|
|
83
|
-
};
|
|
84
|
-
table: {
|
|
85
|
-
background: string;
|
|
86
|
-
border: string;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
export type Token = {
|
|
91
|
-
key: string;
|
|
92
|
-
value: string;
|
|
93
|
-
};
|
|
94
|
-
export type DesignTokensParser = ((value: string, key: string, combine: string) => string) | ((format: string) => (value: string, key: string, combine: string) => string);
|
|
95
|
-
export type DesignTokensBuilder = (value: string, key: string, combine: string) => Token;
|
|
96
|
-
type Fn = (...a: any[]) => any;
|
|
97
|
-
export type DeepParse<T extends GeneralTokens, F extends Fn> = {
|
|
98
|
-
[K in keyof T]: T[K] extends GeneralTokens ? DeepParse<T[K], F> : ReturnType<Fn>;
|
|
99
|
-
};
|
|
100
|
-
export {};
|
|
101
|
-
//# sourceMappingURL=theme.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.types.d.ts","sourceRoot":"","sources":["../../src/styles/theme.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/types.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, { Dispatch, JSX, JSXElementConstructor, SetStateAction } from "react";
|
|
2
|
-
export type Label = React.ReactNode | React.ReactElement | JSX.Element;
|
|
3
|
-
export type Merge<T> = {
|
|
4
|
-
[K in keyof T]: T[K];
|
|
5
|
-
} & {};
|
|
6
|
-
export type Override<Source, New> = Omit<Source, keyof New> & New;
|
|
7
|
-
export type SetState<T> = Dispatch<SetStateAction<T>>;
|
|
8
|
-
export type POJO = {};
|
|
9
|
-
export type ComponentLike = keyof JSX.IntrinsicElements | JSXElementConstructor<any>;
|
|
10
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEpF,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,YAAY,GAAG,GAAG,CAAC,OAAO,CAAC;AAEvE,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,EAAE,CAAC;AAErD,MAAM,MAAM,QAAQ,CAAC,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,GAAG,GAAG,CAAC;AAElE,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtD,MAAM,MAAM,IAAI,GAAG,EAAE,CAAC;AAEtB,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC"}
|