Skip to content

Commit 9532ead

Browse files
chore(release): v1.0.0
# 1.0.0 (2024-05-02) ### Bug Fixes * **core:** [styled] `as` does not take effect ([9f143b2](9f143b2)) ### Features * **core:** [styled] add `.attrs` api ([f01d60b](f01d60b)) * **core:** [styled] support reactive style value ([8624512](8624512)) * **core:** [styled] support styling vue component ([c76478a](c76478a)) * **helper:** add apis of `keyframes` and `createGlobalStyle` ([5c2a422](5c2a422)) * **hooks:** [use-styled-calss-name] add hook to get styled class name ([0952efa](0952efa)) * **provider:** add `theme provider` ([d4fb106](d4fb106)) ### Performance Improvements * **core:** [styled] improve watch effect ([74ca1f1](74ca1f1)) * **helper:** [keyframes] generate unique name for `keyframes` ([669e7ec](669e7ec))
1 parent c271c4f commit 9532ead

26 files changed

+567
-1
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
# 1.0.0 (2024-05-02)
2+
3+
4+
### Bug Fixes
5+
6+
* **core:** [styled] `as` does not take effect ([9f143b2](https://github.com/v-vibe/vue-styled-components/commit/9f143b2e534e4155d5593f450a1bb01287d82cdc))
7+
8+
9+
### Features
10+
11+
* **core:** [styled] add `.attrs` api ([f01d60b](https://github.com/v-vibe/vue-styled-components/commit/f01d60b07812233da7372c3ed990f92d0a0c5ec3))
12+
* **core:** [styled] support reactive style value ([8624512](https://github.com/v-vibe/vue-styled-components/commit/862451212c4d917ac6238e2bd4e52a7f454e226d))
13+
* **core:** [styled] support styling vue component ([c76478a](https://github.com/v-vibe/vue-styled-components/commit/c76478a8836f2ba6de7494596b56da7ac180a740))
14+
* **helper:** add apis of `keyframes` and `createGlobalStyle` ([5c2a422](https://github.com/v-vibe/vue-styled-components/commit/5c2a422a68cbdc8cd135121df39a08f4958cc143))
15+
* **hooks:** [use-styled-calss-name] add hook to get styled class name ([0952efa](https://github.com/v-vibe/vue-styled-components/commit/0952efa81fee1494923eebe60e54a85de7402051))
16+
* **provider:** add `theme provider` ([d4fb106](https://github.com/v-vibe/vue-styled-components/commit/d4fb106370ca594b6efa8001bc3c4d2d135b7a66))
17+
18+
19+
### Performance Improvements
20+
21+
* **core:** [styled] improve watch effect ([74ca1f1](https://github.com/v-vibe/vue-styled-components/commit/74ca1f1819ed1575546ccdca817ab1c94a30ff81))
22+
* **helper:** [keyframes] generate unique name for `keyframes` ([669e7ec](https://github.com/v-vibe/vue-styled-components/commit/669e7ec0e841d9ce2fe124fbace290ecf2ed7a11))
23+
124
# [1.0.0-beta.2](https://github.com/v-vibe/vue-styled-components/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2024-04-29)
225

326

dist/commitlint.config.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare const _default: {
2+
extends: string[];
3+
};
4+
export default _default;

dist/core/constants/constants.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export declare const CLASS_PREFIX = "styled";
2+
export declare const COMPONENT_PREFIX = "styled";

dist/core/constants/domElements.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare const elements: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "g", "image", "line", "linearGradient", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"];
2+
declare const _default: Set<"object" | "div" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "big" | "keygen" | "menuitem" | "param" | "circle" | "clipPath" | "defs" | "ellipse" | "g" | "image" | "line" | "linearGradient" | "mask" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "text" | "tspan">;
3+
export default _default;
4+
export type SupportedHTMLElements = (typeof elements)[number];
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { DefineSetupFnComponent } from 'vue';
2+
import { ExpressionType } from '../utils';
3+
4+
export declare const createGlobalStyle: (styles: TemplateStringsArray, ...expressions: ExpressionType[]) => DefineSetupFnComponent<any>;

dist/core/helper/css.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { ExpressionType } from '../utils';
2+
3+
export declare function css(strings: TemplateStringsArray, ...interpolations: ExpressionType[]): ExpressionType[];

dist/core/helper/index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export * from './withAttrs';
2+
export * from './is';
3+
export * from './create-global-style';
4+
export * from './keyframes';
5+
export * from './css';

dist/core/helper/is.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { SupportedHTMLElements } from '../constants/domElements';
2+
3+
export declare function isTag(target: any): target is SupportedHTMLElements;
4+
export declare function isStyledComponent(target: any): boolean;
5+
export declare function isVueComponent(target: any): boolean;
6+
export declare function isValidElementType(target: any): boolean;

dist/core/helper/keyframes.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export declare function keyframes(kfString: TemplateStringsArray): string;

dist/core/helper/withAttrs.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { ComponentInstance, DefineSetupFnComponent } from 'vue';
2+
3+
export declare function withAttrs<T extends Record<string, unknown>>(target: string | ComponentInstance<any>, attrs: T): DefineSetupFnComponent<any>;

dist/core/hooks/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './useStyledClassName';
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { ComponentInstance } from 'vue';
2+
3+
export declare function useStyledClassName(): {
4+
getStyledClassName: (target: ComponentInstance<any>) => string;
5+
styledClassNameMap: Record<string, string>;
6+
};

dist/core/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * from './providers';
2+
export * from './helper';
3+
export * from './hooks';
4+
export * from './styled';

dist/core/providers/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './theme';

dist/core/providers/theme.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export declare const ThemeProvider: import('vue').DefineSetupFnComponent<{
2+
theme: void | Record<string, string | number>;
3+
}, {}, {}, {
4+
theme: void | Record<string, string | number>;
5+
} & {}, import('vue').PublicProps>;

dist/core/styled.d.ts

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
import { ExpressionType } from './utils';
2+
import { SupportedHTMLElements } from './constants/domElements';
3+
import { DefineSetupFnComponent, PublicProps, SlotsType } from 'vue';
4+
5+
interface IProps {
6+
as?: SupportedHTMLElements;
7+
}
8+
type ComponentCustomProps = PublicProps & {
9+
styled: boolean;
10+
};
11+
export type StyledComponentType = DefineSetupFnComponent<IProps, any, SlotsType, any, ComponentCustomProps>;
12+
type StyledFactory = (styles: TemplateStringsArray, ...expressions: (ExpressionType | ExpressionType[])[]) => StyledComponentType;
13+
type StyledComponent = StyledFactory & {
14+
attrs: <T extends Record<string, unknown>>(attrs: T) => StyledFactory;
15+
};
16+
declare function baseStyled(target: string | InstanceType<any>, propsDefinition?: Record<string, unknown>): StyledComponent;
17+
/** Append all the supported HTML elements to the styled properties */
18+
declare const styled: typeof baseStyled & {
19+
object: StyledComponent;
20+
div: StyledComponent;
21+
a: StyledComponent;
22+
abbr: StyledComponent;
23+
address: StyledComponent;
24+
area: StyledComponent;
25+
article: StyledComponent;
26+
aside: StyledComponent;
27+
audio: StyledComponent;
28+
b: StyledComponent;
29+
base: StyledComponent;
30+
bdi: StyledComponent;
31+
bdo: StyledComponent;
32+
blockquote: StyledComponent;
33+
body: StyledComponent;
34+
br: StyledComponent;
35+
button: StyledComponent;
36+
canvas: StyledComponent;
37+
caption: StyledComponent;
38+
cite: StyledComponent;
39+
code: StyledComponent;
40+
col: StyledComponent;
41+
colgroup: StyledComponent;
42+
data: StyledComponent;
43+
datalist: StyledComponent;
44+
dd: StyledComponent;
45+
del: StyledComponent;
46+
details: StyledComponent;
47+
dfn: StyledComponent;
48+
dialog: StyledComponent;
49+
dl: StyledComponent;
50+
dt: StyledComponent;
51+
em: StyledComponent;
52+
embed: StyledComponent;
53+
fieldset: StyledComponent;
54+
figcaption: StyledComponent;
55+
figure: StyledComponent;
56+
footer: StyledComponent;
57+
form: StyledComponent;
58+
h1: StyledComponent;
59+
h2: StyledComponent;
60+
h3: StyledComponent;
61+
h4: StyledComponent;
62+
h5: StyledComponent;
63+
h6: StyledComponent;
64+
head: StyledComponent;
65+
header: StyledComponent;
66+
hgroup: StyledComponent;
67+
hr: StyledComponent;
68+
html: StyledComponent;
69+
i: StyledComponent;
70+
iframe: StyledComponent;
71+
img: StyledComponent;
72+
input: StyledComponent;
73+
ins: StyledComponent;
74+
kbd: StyledComponent;
75+
label: StyledComponent;
76+
legend: StyledComponent;
77+
li: StyledComponent;
78+
link: StyledComponent;
79+
main: StyledComponent;
80+
map: StyledComponent;
81+
mark: StyledComponent;
82+
menu: StyledComponent;
83+
meta: StyledComponent;
84+
meter: StyledComponent;
85+
nav: StyledComponent;
86+
noscript: StyledComponent;
87+
ol: StyledComponent;
88+
optgroup: StyledComponent;
89+
option: StyledComponent;
90+
output: StyledComponent;
91+
p: StyledComponent;
92+
picture: StyledComponent;
93+
pre: StyledComponent;
94+
progress: StyledComponent;
95+
q: StyledComponent;
96+
rp: StyledComponent;
97+
rt: StyledComponent;
98+
ruby: StyledComponent;
99+
s: StyledComponent;
100+
samp: StyledComponent;
101+
script: StyledComponent;
102+
section: StyledComponent;
103+
select: StyledComponent;
104+
small: StyledComponent;
105+
source: StyledComponent;
106+
span: StyledComponent;
107+
strong: StyledComponent;
108+
style: StyledComponent;
109+
sub: StyledComponent;
110+
summary: StyledComponent;
111+
sup: StyledComponent;
112+
table: StyledComponent;
113+
tbody: StyledComponent;
114+
td: StyledComponent;
115+
textarea: StyledComponent;
116+
tfoot: StyledComponent;
117+
th: StyledComponent;
118+
thead: StyledComponent;
119+
time: StyledComponent;
120+
title: StyledComponent;
121+
tr: StyledComponent;
122+
track: StyledComponent;
123+
u: StyledComponent;
124+
ul: StyledComponent;
125+
var: StyledComponent;
126+
video: StyledComponent;
127+
wbr: StyledComponent;
128+
big: StyledComponent;
129+
keygen: StyledComponent;
130+
menuitem: StyledComponent;
131+
param: StyledComponent;
132+
circle: StyledComponent;
133+
clipPath: StyledComponent;
134+
defs: StyledComponent;
135+
ellipse: StyledComponent;
136+
g: StyledComponent;
137+
image: StyledComponent;
138+
line: StyledComponent;
139+
linearGradient: StyledComponent;
140+
mask: StyledComponent;
141+
path: StyledComponent;
142+
pattern: StyledComponent;
143+
polygon: StyledComponent;
144+
polyline: StyledComponent;
145+
radialGradient: StyledComponent;
146+
rect: StyledComponent;
147+
stop: StyledComponent;
148+
svg: StyledComponent;
149+
text: StyledComponent;
150+
tspan: StyledComponent;
151+
};
152+
export { styled };

dist/core/utils/applyExpressions.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export declare function applyExpressions(chunks: any[], executionContext: Record<string, any>): string[];

dist/core/utils/generateName.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export declare const generateUniqueName: () => string;
2+
export declare function generateComponentName(target: string): string;
3+
export declare function generateClassName(): string;

dist/core/utils/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './generateName';
2+
export * from './insertExpressions';
3+
export * from './applyExpressions';

dist/core/utils/injectStyle.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { ExpressionType } from './index';
2+
3+
export declare function injectStyle(className: string, cssWithExpression: ExpressionType[], context: Record<string, any>): void;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export type ExpressionType = ((props: Record<string, any>) => string | number) | string;
2+
export declare function insertExpressions(strings: TemplateStringsArray, expressions: (ExpressionType | ExpressionType[])[]): ExpressionType[];

dist/example/main.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare const app: import('vue').App<Element>;
2+
export default app;

0 commit comments

Comments
 (0)