@alegendstale/holly-components 0.2.2
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/LICENSE +674 -0
- package/README.md +21 -0
- package/dist/components/absolute-container/absolute-container.d.ts +34 -0
- package/dist/components/absolute-container/absolute-container.d.ts.map +1 -0
- package/dist/components/absolute-container/absolute-container.js +96 -0
- package/dist/components/absolute-container/absolute-container.stories.d.ts +9 -0
- package/dist/components/absolute-container/absolute-container.stories.d.ts.map +1 -0
- package/dist/components/absolute-container/index.d.ts +2 -0
- package/dist/components/absolute-container/index.d.ts.map +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +68 -0
- package/dist/components/bottom-sheet/bottom-sheet.d.ts.map +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.js +312 -0
- package/dist/components/bottom-sheet/bottom-sheet.stories.d.ts +14 -0
- package/dist/components/bottom-sheet/bottom-sheet.stories.d.ts.map +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.test.d.ts +2 -0
- package/dist/components/bottom-sheet/bottom-sheet.test.d.ts.map +1 -0
- package/dist/components/bottom-sheet/index.d.ts +2 -0
- package/dist/components/bottom-sheet/index.d.ts.map +1 -0
- package/dist/components/canvas/canvas-base.d.ts +16 -0
- package/dist/components/canvas/canvas-base.d.ts.map +1 -0
- package/dist/components/canvas/canvas-base.js +48 -0
- package/dist/components/canvas/canvas-gradient.d.ts +20 -0
- package/dist/components/canvas/canvas-gradient.d.ts.map +1 -0
- package/dist/components/canvas/canvas-gradient.js +47 -0
- package/dist/components/canvas/canvas-image.d.ts +49 -0
- package/dist/components/canvas/canvas-image.d.ts.map +1 -0
- package/dist/components/canvas/canvas-image.js +117 -0
- package/dist/components/canvas/index.d.ts +3 -0
- package/dist/components/canvas/index.d.ts.map +1 -0
- package/dist/components/carousel-scroller/carousel-scroller.d.ts +29 -0
- package/dist/components/carousel-scroller/carousel-scroller.d.ts.map +1 -0
- package/dist/components/carousel-scroller/carousel-scroller.js +125 -0
- package/dist/components/carousel-scroller/carousel-scroller.stories.d.ts +11 -0
- package/dist/components/carousel-scroller/carousel-scroller.stories.d.ts.map +1 -0
- package/dist/components/carousel-scroller/index.d.ts +2 -0
- package/dist/components/carousel-scroller/index.d.ts.map +1 -0
- package/dist/components/color-palette/color-palette-utils.d.ts +69 -0
- package/dist/components/color-palette/color-palette-utils.d.ts.map +1 -0
- package/dist/components/color-palette/color-palette-utils.js +43 -0
- package/dist/components/color-palette/color-palette.d.ts +61 -0
- package/dist/components/color-palette/color-palette.d.ts.map +1 -0
- package/dist/components/color-palette/color-palette.js +346 -0
- package/dist/components/color-palette/component/color-palette-component.d.ts +22 -0
- package/dist/components/color-palette/component/color-palette-component.d.ts.map +1 -0
- package/dist/components/color-palette/component/color-palette-component.js +148 -0
- package/dist/components/color-palette/component/color-palette-component.stories.d.ts +11 -0
- package/dist/components/color-palette/component/color-palette-component.stories.d.ts.map +1 -0
- package/dist/components/color-palette/component/index.d.ts +2 -0
- package/dist/components/color-palette/component/index.d.ts.map +1 -0
- package/dist/components/color-palette/editor/color-palette-editor.d.ts +46 -0
- package/dist/components/color-palette/editor/color-palette-editor.d.ts.map +1 -0
- package/dist/components/color-palette/editor/color-palette-editor.js +611 -0
- package/dist/components/color-palette/editor/color-palette-editor.stories.d.ts +11 -0
- package/dist/components/color-palette/editor/color-palette-editor.stories.d.ts.map +1 -0
- package/dist/components/color-palette/editor/index.d.ts +2 -0
- package/dist/components/color-palette/editor/index.d.ts.map +1 -0
- package/dist/components/color-palette/index.d.ts +6 -0
- package/dist/components/color-palette/index.d.ts.map +1 -0
- package/dist/components/color-palette/item/color-palette-item-edit.d.ts +20 -0
- package/dist/components/color-palette/item/color-palette-item-edit.d.ts.map +1 -0
- package/dist/components/color-palette/item/color-palette-item-edit.js +91 -0
- package/dist/components/color-palette/item/color-palette-item.d.ts +29 -0
- package/dist/components/color-palette/item/color-palette-item.d.ts.map +1 -0
- package/dist/components/color-palette/item/color-palette-item.js +146 -0
- package/dist/components/color-palette/item/index.d.ts +3 -0
- package/dist/components/color-palette/item/index.d.ts.map +1 -0
- package/dist/components/color-palette/menu/color-palette-menu.d.ts +30 -0
- package/dist/components/color-palette/menu/color-palette-menu.d.ts.map +1 -0
- package/dist/components/color-palette/menu/color-palette-menu.js +231 -0
- package/dist/components/color-palette/menu/color-palette-reorder.d.ts +31 -0
- package/dist/components/color-palette/menu/color-palette-reorder.d.ts.map +1 -0
- package/dist/components/color-palette/menu/color-palette-reorder.js +108 -0
- package/dist/components/color-palette/menu/index.d.ts +3 -0
- package/dist/components/color-palette/menu/index.d.ts.map +1 -0
- package/dist/components/color-palette/storybook/color-palette-invalid.stories.d.ts +15 -0
- package/dist/components/color-palette/storybook/color-palette-invalid.stories.d.ts.map +1 -0
- package/dist/components/color-palette/storybook/color-palette-valid.stories.d.ts +34 -0
- package/dist/components/color-palette/storybook/color-palette-valid.stories.d.ts.map +1 -0
- package/dist/components/color-palette/storybook/color-palette.stories.d.ts +13 -0
- package/dist/components/color-palette/storybook/color-palette.stories.d.ts.map +1 -0
- package/dist/components/tool-tip/Tooltip2.d.ts +17 -0
- package/dist/components/tool-tip/Tooltip2.d.ts.map +1 -0
- package/dist/components/tool-tip/index.d.ts +2 -0
- package/dist/components/tool-tip/index.d.ts.map +1 -0
- package/dist/components/tool-tip/tool-tip.d.ts +29 -0
- package/dist/components/tool-tip/tool-tip.d.ts.map +1 -0
- package/dist/components/tool-tip/tool-tip.js +106 -0
- package/dist/components/tool-tip/tool-tip.stories.d.ts +12 -0
- package/dist/components/tool-tip/tool-tip.stories.d.ts.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/utils/EventEmitter.d.ts +9 -0
- package/dist/utils/EventEmitter.d.ts.map +1 -0
- package/dist/utils/EventEmitter.js +24 -0
- package/dist/utils/basicUtils.d.ts +47 -0
- package/dist/utils/basicUtils.d.ts.map +1 -0
- package/dist/utils/basicUtils.js +23 -0
- package/dist/utils/dragDropUtils.d.ts +36 -0
- package/dist/utils/dragDropUtils.d.ts.map +1 -0
- package/dist/utils/generateUtils.d.ts +27 -0
- package/dist/utils/generateUtils.d.ts.map +1 -0
- package/dist/utils/generateUtils.js +40 -0
- package/dist/utils/types.d.ts +5 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
+
import { PaletteSettings } from '../color-palette-utils';
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Props = {
|
|
6
|
+
colors: string[];
|
|
7
|
+
} & PaletteSettings;
|
|
8
|
+
type Story = StoryObj<Props>;
|
|
9
|
+
export declare const InvalidColors: Story;
|
|
10
|
+
export declare const OneColorGradient: Story;
|
|
11
|
+
export declare const NonOverriddenPalette: Story;
|
|
12
|
+
export declare const InvalidSettings: Story;
|
|
13
|
+
export declare const InvalidColorsSettings: Story;
|
|
14
|
+
export declare const InvalidDirections: Story;
|
|
15
|
+
//# sourceMappingURL=color-palette-invalid.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-palette-invalid.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/color-palette/storybook/color-palette-invalid.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAmB,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE1E,QAAA,MAAM,IAAI,EAAE,IAaX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,eAAe,CAAC;AAEpD,KAAK,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;AAoB7B,eAAO,MAAM,aAAa,EAAE,KAQ3B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAQ9B,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAOlC,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAS7B,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,KASnC,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAS/B,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
+
import { PaletteSettings } from '../color-palette-utils';
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Props = {
|
|
6
|
+
colors: string[];
|
|
7
|
+
} & PaletteSettings;
|
|
8
|
+
type Story = StoryObj<Props>;
|
|
9
|
+
export declare const Hex: Story;
|
|
10
|
+
export declare const HSL: Story;
|
|
11
|
+
export declare const RGB: Story;
|
|
12
|
+
export declare const NamedColors: Story;
|
|
13
|
+
export declare const URLWithSettings: Story;
|
|
14
|
+
export declare const HexHorizontalWithSettings: Story;
|
|
15
|
+
export declare const Semicolon: Story;
|
|
16
|
+
export declare const EightCharacterHex: Story;
|
|
17
|
+
export declare const Black: Story;
|
|
18
|
+
export declare const Hex_RGB_HSL: Story;
|
|
19
|
+
export declare const HeightDirection: Story;
|
|
20
|
+
export declare const HorizontalGradient: Story;
|
|
21
|
+
export declare const VerticalGradient: Story;
|
|
22
|
+
export declare const Aliases: Story;
|
|
23
|
+
export declare const AliasesSkipColor: Story;
|
|
24
|
+
export declare const Width: Story;
|
|
25
|
+
export declare const PreventHover: Story;
|
|
26
|
+
export declare const Override: Story;
|
|
27
|
+
export declare const RGBA_CSS_Variable: Story;
|
|
28
|
+
export declare const RGBSettings: Story;
|
|
29
|
+
export declare const Others: Story;
|
|
30
|
+
export declare const WhiteBlue: Story;
|
|
31
|
+
export declare const OrangeBlue: Story;
|
|
32
|
+
export declare const GreyGradient: Story;
|
|
33
|
+
export declare const URL: Story;
|
|
34
|
+
//# sourceMappingURL=color-palette-valid.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-palette-valid.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/color-palette/storybook/color-palette-valid.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAA8B,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAErF,QAAA,MAAM,IAAI,EAAE,IAaX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,eAAe,CAAC;AAEpD,KAAK,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;AAoB7B,eAAO,MAAM,GAAG,EAAE,KAQjB,CAAA;AAED,eAAO,MAAM,GAAG,EAAE,KAQjB,CAAA;AAED,eAAO,MAAM,GAAG,EAAE,KAQjB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAQzB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAQ7B,CAAA;AAED,eAAO,MAAM,yBAAyB,EAAE,KAavC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAQvB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAO/B,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAOnB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KASzB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAc7B,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAShC,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAW9B,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAerB,CAAA;AACD,eAAO,MAAM,gBAAgB,EAAE,KAW9B,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAYnB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAW1B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAQtB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAQ/B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KASzB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KASpB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KASvB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAW1B,CAAA;AAED,eAAO,MAAM,GAAG,EAAE,KAOjB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
+
import { PaletteSettings } from '../color-palette-utils';
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Props = {
|
|
6
|
+
colors: string[];
|
|
7
|
+
} & PaletteSettings;
|
|
8
|
+
type Story = StoryObj<Props>;
|
|
9
|
+
export declare const Empty: Story;
|
|
10
|
+
export declare const OneItem: Story;
|
|
11
|
+
export declare const ManyItems: Story;
|
|
12
|
+
export declare const Gradient: Story;
|
|
13
|
+
//# sourceMappingURL=color-palette.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-palette.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/color-palette/storybook/color-palette.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAA8B,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGrF,QAAA,MAAM,IAAI,EAAE,IAaX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,eAAe,CAAC;AAEpD,KAAK,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;AAuB7B,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAYvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAYtB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class SimpleTooltip extends LitElement {
|
|
3
|
+
static lazy(target: Element, callback: (target: SimpleTooltip) => void): void;
|
|
4
|
+
static styles: import("lit").CSSResult;
|
|
5
|
+
offset: number;
|
|
6
|
+
showing: boolean;
|
|
7
|
+
_target: Element | null;
|
|
8
|
+
get target(): Element | null;
|
|
9
|
+
set target(target: Element | null);
|
|
10
|
+
constructor();
|
|
11
|
+
connectedCallback(): void;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
show(): void;
|
|
14
|
+
hide(): void;
|
|
15
|
+
finishHide(): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=Tooltip2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip2.d.ts","sourceRoot":"","sources":["../../../src/components/tool-tip/Tooltip2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAM5C,qBACa,aAAc,SAAQ,UAAU;IAC5C,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI;IAWtE,MAAM,CAAC,MAAM,0BAqBX;IAGF,MAAM,SAAK;IAGX,OAAO,UAAS;IAGhB,OAAO,EAAE,OAAO,GAAG,IAAI,CAAQ;IAE/B,IAAI,MAAM,IAIS,OAAO,GAAG,IAAI,CAFhC;IAED,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,EAYhC;;IAOD,iBAAiB,IAAI,IAAI;IAQzB,MAAM;IAIN,IAAI;IAUJ,IAAI;IAIJ,UAAU;CAKV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tool-tip/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export type TriggerTypes = 'hover' | 'click' | 'manual';
|
|
3
|
+
export declare const styles: import("lit").CSSResult;
|
|
4
|
+
export declare class ToolTip extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult;
|
|
6
|
+
contentEl?: HTMLParagraphElement;
|
|
7
|
+
display: boolean;
|
|
8
|
+
text: string;
|
|
9
|
+
trigger: TriggerTypes;
|
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
/**
|
|
12
|
+
* Clamps the tooltip position to within the bounds
|
|
13
|
+
*/
|
|
14
|
+
clampPosition: (pos: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}, bounds: DOMRect) => {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
setClampedPosition({ x, y }: client, bounds: DOMRect): void;
|
|
22
|
+
setPosition({ x, y }: client): void;
|
|
23
|
+
}
|
|
24
|
+
declare global {
|
|
25
|
+
interface HTMLElementTagNameMap {
|
|
26
|
+
'tool-tip': ToolTip;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=tool-tip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-tip.d.ts","sourceRoot":"","sources":["../../../src/components/tool-tip/tool-tip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAG5C,MAAM,MAAM,YAAY,GACtB,OAAO,GACP,OAAO,GACP,QAAQ,CAAA;AAEV,eAAO,MAAM,MAAM,yBAgDlB,CAAA;AAED,qBACa,OAAQ,SAAQ,UAAU;IACtC,MAAM,CAAC,MAAM,0BAAU;IAGvB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IAGjC,OAAO,UAAS;IAGhB,IAAI,SAAM;IAGV,OAAO,EAAE,YAAY,CAAY;IAEjC,MAAM;IAcN;;OAEG;IACH,aAAa,QAAS;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,UAAU,OAAO;;;MAsB7D;IAEK,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IAIpD,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM;CAInC;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,UAAU,EAAE,OAAO,CAAC;KACpB;CACD"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { css as h, LitElement as y, html as f } from "lit";
|
|
2
|
+
import { query as d, property as a, customElement as c } from "lit/decorators.js";
|
|
3
|
+
var g = Object.defineProperty, x = Object.getOwnPropertyDescriptor, n = (i, t, o, l) => {
|
|
4
|
+
for (var e = l > 1 ? void 0 : l ? x(t, o) : t, s = i.length - 1, r; s >= 0; s--)
|
|
5
|
+
(r = i[s]) && (e = (l ? r(t, o, e) : r(e)) || e);
|
|
6
|
+
return l && e && g(t, o, e), e;
|
|
7
|
+
};
|
|
8
|
+
const m = h`
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
position: relative;
|
|
12
|
+
--tooltip-x: 0;
|
|
13
|
+
--tooltip-y: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([display]:hover) {
|
|
17
|
+
& > p {
|
|
18
|
+
display: flex;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
p {
|
|
23
|
+
display: none;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
|
|
27
|
+
position: absolute;
|
|
28
|
+
background: #000000C0;
|
|
29
|
+
width: max-content;
|
|
30
|
+
min-width: 100px;
|
|
31
|
+
height: 40px;
|
|
32
|
+
text-align: center;
|
|
33
|
+
vertical-align: middle;
|
|
34
|
+
font-size: 18px;
|
|
35
|
+
font-weight: var(--font-medium);
|
|
36
|
+
color: #FAFAFA;
|
|
37
|
+
padding: 0;
|
|
38
|
+
margin: 0;
|
|
39
|
+
transform: translateX(-50%);
|
|
40
|
+
|
|
41
|
+
left: var(--tooltip-x);
|
|
42
|
+
top: var(--tooltip-y);
|
|
43
|
+
|
|
44
|
+
/* Obsidian Styling */
|
|
45
|
+
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
animation: pop-down 200ms forwards ease-in-out;
|
|
48
|
+
box-shadow: 0 2px 8px var(--background-modifier-box-shadow);
|
|
49
|
+
border-radius: var(--radius-s);
|
|
50
|
+
line-height: var(--line-height-tight);
|
|
51
|
+
z-index: var(--layer-tooltip);
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
word-break: normal;
|
|
54
|
+
overflow-wrap: anywhere;
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
let p = class extends y {
|
|
58
|
+
constructor() {
|
|
59
|
+
super(...arguments), this.display = !1, this.text = "", this.trigger = "manual", this.clampPosition = (i, t) => {
|
|
60
|
+
if (!this.contentEl || !t) return { x: 0, y: 0 };
|
|
61
|
+
let o = this.contentEl.offsetWidth, l = this.contentEl.offsetHeight, e = i.x - t.left > t.width / 2 ? i.x - t.left - 56 : i.x - t.left + 64, s = o / 2;
|
|
62
|
+
e < 0 + s ? e = 0 + s : e + o > t.width + s && (e = t.width - o + s);
|
|
63
|
+
let r = i.y - t.top - l / 4;
|
|
64
|
+
return r < 0 ? r = 0 : r + l > t.height && (r = t.height - l), { x: e, y: r };
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
return f`
|
|
69
|
+
<slot
|
|
70
|
+
@pointerover=${() => this.display = this.trigger === "hover" ? !0 : this.display}
|
|
71
|
+
@pointerout=${() => this.display = this.trigger === "hover" ? !1 : this.display}
|
|
72
|
+
@click=${() => this.trigger === "click" ? this.display = !this.display : null}
|
|
73
|
+
>
|
|
74
|
+
</slot>
|
|
75
|
+
<p id='content'>
|
|
76
|
+
${this.text}
|
|
77
|
+
</p>
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
setClampedPosition({ x: i, y: t }, o) {
|
|
81
|
+
this.setPosition(this.clampPosition({ x: i, y: t }, o));
|
|
82
|
+
}
|
|
83
|
+
setPosition({ x: i, y: t }) {
|
|
84
|
+
this.style.setProperty("--tooltip-x", `${i}px`), this.style.setProperty("--tooltip-y", `${t}px`);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
p.styles = m;
|
|
88
|
+
n([
|
|
89
|
+
d("#content")
|
|
90
|
+
], p.prototype, "contentEl", 2);
|
|
91
|
+
n([
|
|
92
|
+
a({ type: Boolean, reflect: !0 })
|
|
93
|
+
], p.prototype, "display", 2);
|
|
94
|
+
n([
|
|
95
|
+
a({ type: String })
|
|
96
|
+
], p.prototype, "text", 2);
|
|
97
|
+
n([
|
|
98
|
+
a({ type: String })
|
|
99
|
+
], p.prototype, "trigger", 2);
|
|
100
|
+
p = n([
|
|
101
|
+
c("tool-tip")
|
|
102
|
+
], p);
|
|
103
|
+
export {
|
|
104
|
+
p as ToolTip,
|
|
105
|
+
m as styles
|
|
106
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
+
import { TriggerTypes } from './tool-tip';
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Props = {
|
|
6
|
+
content: string;
|
|
7
|
+
trigger: TriggerTypes;
|
|
8
|
+
};
|
|
9
|
+
type Story = StoryObj<Props>;
|
|
10
|
+
export declare const Hover: Story;
|
|
11
|
+
export declare const Click: Story;
|
|
12
|
+
//# sourceMappingURL=tool-tip.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-tip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/tool-tip/tool-tip.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC;AAExD,KAAK,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;AAY7B,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAC9B,OAAO,2BAA2B,CAAA;AAClC,OAAO,gCAAgC,CAAA;AACvC,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAC5B,OAAO,iCAAiC,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "./components/tool-tip/tool-tip.js";
|
|
2
|
+
import "./components/bottom-sheet/bottom-sheet.js";
|
|
3
|
+
import "./components/carousel-scroller/carousel-scroller.js";
|
|
4
|
+
import "./components/color-palette/color-palette.js";
|
|
5
|
+
import "./components/color-palette/item/color-palette-item.js";
|
|
6
|
+
import "./components/color-palette/item/color-palette-item-edit.js";
|
|
7
|
+
import "./components/color-palette/menu/color-palette-menu.js";
|
|
8
|
+
import "./components/color-palette/menu/color-palette-reorder.js";
|
|
9
|
+
import "./components/color-palette/component/color-palette-component.js";
|
|
10
|
+
import "./components/color-palette/editor/color-palette-editor.js";
|
|
11
|
+
import "./components/canvas/canvas-gradient.js";
|
|
12
|
+
import "./components/canvas/canvas-image.js";
|
|
13
|
+
import "./components/absolute-container/absolute-container.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type Listener<T extends Array<any>> = (...args: T) => void;
|
|
2
|
+
export declare class EventEmitter<EventMap extends Record<string, Array<any>>> {
|
|
3
|
+
private eventListeners;
|
|
4
|
+
on<K extends keyof EventMap>(eventName: K, listener: Listener<EventMap[K]>): void;
|
|
5
|
+
off<K extends keyof EventMap>(eventName: K, listener: Listener<EventMap[K]>): void;
|
|
6
|
+
emit<K extends keyof EventMap>(eventName: K, ...args: EventMap[K]): void;
|
|
7
|
+
clear(): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=EventEmitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../../src/utils/EventEmitter.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;AAElE,qBAAa,YAAY,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACpE,OAAO,CAAC,cAAc,CAA8D;IAE7E,EAAE,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAM1E,GAAG,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAM3E,IAAI,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAOjE,KAAK;CAGZ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
class r {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.eventListeners = {};
|
|
4
|
+
}
|
|
5
|
+
on(e, s) {
|
|
6
|
+
const t = this.eventListeners[e] ?? /* @__PURE__ */ new Set();
|
|
7
|
+
t.add(s), this.eventListeners[e] = t;
|
|
8
|
+
}
|
|
9
|
+
off(e, s) {
|
|
10
|
+
const t = this.eventListeners[e] ?? /* @__PURE__ */ new Set();
|
|
11
|
+
t.delete(s), this.eventListeners[e] = t;
|
|
12
|
+
}
|
|
13
|
+
emit(e, ...s) {
|
|
14
|
+
const t = this.eventListeners[e] ?? /* @__PURE__ */ new Set();
|
|
15
|
+
for (const n of t)
|
|
16
|
+
n(...s);
|
|
17
|
+
}
|
|
18
|
+
clear() {
|
|
19
|
+
this.eventListeners = {};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
r as EventEmitter
|
|
24
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { PaletteSettings, ColorPaletteSettings, CopyFormat } from "../components/color-palette/color-palette-utils";
|
|
2
|
+
/**
|
|
3
|
+
* Get settings without their default values
|
|
4
|
+
*/
|
|
5
|
+
export declare function getModifiedSettings(settings: PaletteSettings): Partial<PaletteSettings> | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Checks if all settings are set to their default values
|
|
8
|
+
*/
|
|
9
|
+
export declare function areSettingsDefault(settings: PaletteSettings | ColorPaletteSettings): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Gets the modified settings as a string
|
|
12
|
+
*/
|
|
13
|
+
export declare function getModifiedSettingsAsString(settings: PaletteSettings): string | undefined;
|
|
14
|
+
export declare function convertStringSettings(settings: PaletteSettings): any;
|
|
15
|
+
/**
|
|
16
|
+
* Parse input url & extract colors
|
|
17
|
+
* @param url URL from color input
|
|
18
|
+
* @returns Array of colors
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseUrl(url: string): string[];
|
|
21
|
+
/**
|
|
22
|
+
* Converts ColorPalette plugin settings to Palette settings
|
|
23
|
+
*/
|
|
24
|
+
export declare function pluginToPaletteSettings(pluginSettings: ColorPaletteSettings): PaletteSettings;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a codeblock palette
|
|
27
|
+
* @param input Either palette input or colors & settings object
|
|
28
|
+
* @returns palette block string
|
|
29
|
+
*/
|
|
30
|
+
export declare function createPaletteBlock(input: {
|
|
31
|
+
colors: string[];
|
|
32
|
+
settings?: Partial<PaletteSettings>;
|
|
33
|
+
} | string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Gets the appropriate foreground contrast color
|
|
36
|
+
*/
|
|
37
|
+
export declare function getForegroundColor(color: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Converts string array to newline separated string
|
|
40
|
+
*/
|
|
41
|
+
export declare function toNString(array: string[]): string;
|
|
42
|
+
export declare function copyToClipboard(text: string, copyFormat?: CopyFormat): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Calculate font size based on number of colors
|
|
45
|
+
*/
|
|
46
|
+
export declare function getAdjustedFontSize(colorsCount: number): number;
|
|
47
|
+
//# sourceMappingURL=basicUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basicUtils.d.ts","sourceRoot":"","sources":["../../src/utils/basicUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,UAAU,EAAmB,MAAM,iDAAiD,CAAC;AAErI;;GAEG;AACH,wBAAgB,mBAAmB,CAAE,QAAQ,EAAE,eAAe,wCAsB7D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAE,QAAQ,EAAE,eAAe,GAAG,oBAAoB,WAUnF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAE,QAAQ,EAAE,eAAe,sBAGrE;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,OAW9D;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,YAQnC;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,oBAAoB,GAAG,eAAe,CAU7F;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAA,QAAQ,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAAE,GAAG,MAAM,GAAG,MAAM,CAGnH;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,UAMxC;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU,iBAU1E;AAED;;EAEE;AACF,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,UAItD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import n from "colorsea";
|
|
2
|
+
import { CopyFormat as o } from "../components/color-palette/color-palette-utils.js";
|
|
3
|
+
function a(t) {
|
|
4
|
+
var i;
|
|
5
|
+
return t.includes("-") ? t.substring(t.lastIndexOf("/") + 1).split("-").map((e) => "#" + e) : ((i = t.substring(t.lastIndexOf("/") + 1).match(/.{1,6}/g)) == null ? void 0 : i.map((e) => "#" + e)) || [];
|
|
6
|
+
}
|
|
7
|
+
function c(t) {
|
|
8
|
+
const i = n(t);
|
|
9
|
+
return i.rgb()[0] * 0.299 + i.rgb()[1] * 0.587 + i.rgb()[2] * 0.114 > 186 ? "#000000" : "#ffffff";
|
|
10
|
+
}
|
|
11
|
+
async function f(t, i) {
|
|
12
|
+
let e = t;
|
|
13
|
+
i === o.Value && !t.includes("`") && (e.includes("#") ? e = e.split("#")[1] : e.includes("(") && (e = e.split("(")[1].split(")")[0])), await navigator.clipboard.writeText(e);
|
|
14
|
+
}
|
|
15
|
+
function l(t) {
|
|
16
|
+
return Math.max(10, 16 - t);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
f as copyToClipboard,
|
|
20
|
+
l as getAdjustedFontSize,
|
|
21
|
+
c as getForegroundColor,
|
|
22
|
+
a as parseUrl
|
|
23
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
interface Result {
|
|
2
|
+
beforeElement: HTMLElement | null;
|
|
3
|
+
insertedElement: HTMLElement | null;
|
|
4
|
+
afterElement: HTMLElement | null;
|
|
5
|
+
order: HTMLElement[];
|
|
6
|
+
}
|
|
7
|
+
export declare class DragDrop {
|
|
8
|
+
dropzones: HTMLElement[];
|
|
9
|
+
draggables: HTMLElement[];
|
|
10
|
+
result: Result;
|
|
11
|
+
onDrop: (e: DragEvent, res: Result) => void;
|
|
12
|
+
constructor(dropzones: HTMLElement[], draggables: HTMLElement[], onDrop: (e: DragEvent, res: Result) => void);
|
|
13
|
+
private dragStart;
|
|
14
|
+
private dragOver;
|
|
15
|
+
private dragEnd;
|
|
16
|
+
load(): void;
|
|
17
|
+
unload(): void;
|
|
18
|
+
/**
|
|
19
|
+
* @returns The element which is being dragged
|
|
20
|
+
*/
|
|
21
|
+
getDraggingElement(): HTMLElement;
|
|
22
|
+
/**
|
|
23
|
+
* @returns All draggable elements not being dragged
|
|
24
|
+
*/
|
|
25
|
+
getDraggableElements(): HTMLElement[];
|
|
26
|
+
/**
|
|
27
|
+
* Gets the closest element before the dragged element
|
|
28
|
+
*/
|
|
29
|
+
private getDragBeforeElement;
|
|
30
|
+
/**
|
|
31
|
+
* Gets the closest element after the dragged element
|
|
32
|
+
*/
|
|
33
|
+
private getDragAfterElement;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=dragDropUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dragDropUtils.d.ts","sourceRoot":"","sources":["../../src/utils/dragDropUtils.ts"],"names":[],"mappings":"AAAA,UAAU,MAAM;IACf,aAAa,EAAE,WAAW,GAAG,IAAI,CAAA;IACjC,eAAe,EAAE,WAAW,GAAG,IAAI,CAAA;IACnC,YAAY,EAAE,WAAW,GAAG,IAAI,CAAA;IAChC,KAAK,EAAE,WAAW,EAAE,CAAA;CACpB;AAID,qBAAa,QAAQ;IACpB,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;gBAEhC,SAAS,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI;IAS5G,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,QAAQ;IAqChB,OAAO,CAAC,OAAO;IAMR,IAAI;IAcJ,MAAM;IAWb;;OAEG;IACI,kBAAkB;IAIzB;;OAEG;IACI,oBAAoB;IAI3B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAkB5B;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAiB3B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import colorsea from "colorsea";
|
|
2
|
+
import { PaletteSettings } from "../components/color-palette/color-palette-utils";
|
|
3
|
+
export declare enum Combination {
|
|
4
|
+
Complimentary = "Complimentary",
|
|
5
|
+
Monochromatic = "Monochromatic",
|
|
6
|
+
Analogous = "Analogous",
|
|
7
|
+
Triadic = "Triadic",
|
|
8
|
+
Tetradic = "Tetradic",
|
|
9
|
+
Random = "Random"
|
|
10
|
+
}
|
|
11
|
+
type OptionalParams = {
|
|
12
|
+
baseColor?: ReturnType<typeof colorsea>;
|
|
13
|
+
settings?: PaletteSettings;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Generate colors based on color theory
|
|
17
|
+
* @param baseColor Initial color to generate the rest from
|
|
18
|
+
* @param combination The type of color theory combination to use
|
|
19
|
+
* @param settings The settings for the palette
|
|
20
|
+
* @returns Generated colors & settings
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateColors(combination: Combination, optional?: OptionalParams): {
|
|
23
|
+
colors: string[];
|
|
24
|
+
settings: PaletteSettings | undefined;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=generateUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateUtils.d.ts","sourceRoot":"","sources":["../../src/utils/generateUtils.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAElF,oBAAY,WAAW;IACnB,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,MAAM,WAAW;CACpB;AAED,KAAK,cAAc,GAAG;IAClB,SAAS,CAAC,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;IACvC,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC7B,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,GAAE,cAAiD;;;EAmDnH"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import o from "colorsea";
|
|
2
|
+
var M = /* @__PURE__ */ ((s) => (s.Complimentary = "Complimentary", s.Monochromatic = "Monochromatic", s.Analogous = "Analogous", s.Triadic = "Triadic", s.Tetradic = "Tetradic", s.Random = "Random", s))(M || {});
|
|
3
|
+
function B(s, c = { baseColor: o.random() }) {
|
|
4
|
+
let { baseColor: e, settings: a } = c;
|
|
5
|
+
e || (e = o.random());
|
|
6
|
+
let r = [];
|
|
7
|
+
switch (s) {
|
|
8
|
+
case "Complimentary":
|
|
9
|
+
r = [e.hex(), e.complement().hex()], a && (a.aliases = ["Base", "Complimentary Color"]);
|
|
10
|
+
break;
|
|
11
|
+
case "Monochromatic":
|
|
12
|
+
const n = e.lighten(20), h = e.lighten(10), l = e.darken(10), d = e.darken(20);
|
|
13
|
+
r = [n.hex(), h.hex(), e.hex(), l.hex(), d.hex()], a && (a.aliases = ["Lightest", "Lighter", "Base", "Darker", "Darkest"]);
|
|
14
|
+
break;
|
|
15
|
+
case "Analogous":
|
|
16
|
+
const x = e.adjustHue(-25), m = e.adjustHue(25);
|
|
17
|
+
r = [x.hex(), e.hex(), m.hex()], a && (a.aliases = ["Analogous East", "Base", "Analogous West"]);
|
|
18
|
+
break;
|
|
19
|
+
case "Triadic":
|
|
20
|
+
const u = e.spin(120), g = e.spin(240);
|
|
21
|
+
r = [e.hex(), u.hex(), g.hex()], a && (a.aliases = ["Triadic First", "Base", "Triadic Third"]);
|
|
22
|
+
break;
|
|
23
|
+
case "Tetradic":
|
|
24
|
+
const p = e.spin(90), T = e.spin(180), k = e.spin(270);
|
|
25
|
+
r = [e.hex(), p.hex(), T.hex(), k.hex()], a && (a.aliases = ["Base", "Tetradic Second", "Tetradic Third", "Tetradic Fourth"]);
|
|
26
|
+
break;
|
|
27
|
+
case "Random":
|
|
28
|
+
const f = Math.max(Math.round(Math.random() * 10), 2);
|
|
29
|
+
let t = [];
|
|
30
|
+
for (let i = 0; i < f; i++)
|
|
31
|
+
t.push(o.random().hex());
|
|
32
|
+
r = t, a && (a.aliases = []);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
return { colors: r, settings: a };
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
M as Combination,
|
|
39
|
+
B as generateColors
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,KAAK,MAAM,GAAG;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAA;CACT,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": false,
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"name": "@alegendstale/holly-components",
|
|
5
|
+
"description": "Reusable UI components created using lit",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/holly-components.js",
|
|
8
|
+
"module": "./dist/holly-components.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/index/*.js",
|
|
13
|
+
"types": "./dist/index/*.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./components/*": {
|
|
16
|
+
"import": "./dist/holly-components/*.js",
|
|
17
|
+
"types": "./dist/holly-components/*.d.ts"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"types"
|
|
23
|
+
],
|
|
24
|
+
"keywords": [
|
|
25
|
+
"web",
|
|
26
|
+
"component",
|
|
27
|
+
"lit"
|
|
28
|
+
],
|
|
29
|
+
"author": "ALegendsTale",
|
|
30
|
+
"license": "GPL-3.0",
|
|
31
|
+
"scripts": {
|
|
32
|
+
"dev": "vite",
|
|
33
|
+
"build": "vite build && tsc",
|
|
34
|
+
"preview": "vite preview",
|
|
35
|
+
"storybook": "storybook dev -p 6006",
|
|
36
|
+
"build-storybook": "storybook build",
|
|
37
|
+
"wdio": "wdio run ./wdio.conf.ts --watch"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"colorsea": "^1.2.2",
|
|
41
|
+
"lucide": "^0.471.0",
|
|
42
|
+
"quantize": "^1.0.2",
|
|
43
|
+
"validate-color": "^2.2.4"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@chromatic-com/storybook": "^1.7.0",
|
|
47
|
+
"@storybook/addon-essentials": "^8.2.9",
|
|
48
|
+
"@storybook/addon-links": "^8.2.9",
|
|
49
|
+
"@storybook/blocks": "^8.2.9",
|
|
50
|
+
"@storybook/test": "^8.2.9",
|
|
51
|
+
"@storybook/web-components": "^8.2.9",
|
|
52
|
+
"@storybook/web-components-vite": "^8.2.9",
|
|
53
|
+
"@types/quantize": "^1.0.2",
|
|
54
|
+
"@wdio/browser-runner": "^9.5.7",
|
|
55
|
+
"@wdio/cli": "^9.5.7",
|
|
56
|
+
"@wdio/mocha-framework": "^9.5.0",
|
|
57
|
+
"@wdio/spec-reporter": "^9.5.0",
|
|
58
|
+
"lit": "^3.2.1",
|
|
59
|
+
"storybook": "^8.2.9",
|
|
60
|
+
"typescript": "latest",
|
|
61
|
+
"vite": "^5.4.1"
|
|
62
|
+
}
|
|
63
|
+
}
|