This repository has been archived by the owner on Mar 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
131 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { TPreset, TStyle } from "../"; | ||
|
||
export type TButton = { | ||
preset?: TPreset; | ||
styles?: TStyle[]; | ||
}; | ||
|
||
const defaultButton: TButton = { | ||
preset: { | ||
type: "button", | ||
name: "default", | ||
}, | ||
styles: [ | ||
{ | ||
state: "default", | ||
presets: [ | ||
{ | ||
type: "border", | ||
name: "default", | ||
}, | ||
], | ||
}, | ||
], | ||
}; | ||
|
||
const buttons: TButton[] = [defaultButton]; | ||
|
||
export default buttons; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,22 @@ | ||
import type { TBorder, TBorderPresetNames } from "./borders"; | ||
import type { TBorder } from "./borders"; | ||
import { default as borders } from "./borders"; | ||
|
||
import type { TPatternify, TPatternifyPresetNames } from "./patternify"; | ||
import { default as patternify } from "./patternify"; | ||
import type { TButton } from "./buttons"; | ||
import { default as buttons } from "./buttons"; | ||
|
||
import type { TLinkStyle } from "./link"; | ||
import { default as linkStyles } from "./link"; | ||
|
||
/** | ||
* // NOTE: Experimental | ||
* Tries to achieve something like `useDecoration('link', 'default')` and `useDecoration('borders', 'heavy')` | ||
* However link styling is so complex it needs a special hook `useLinkStyle` to put together the styles. | ||
* For simple styling it works for now. | ||
*/ | ||
export type TDecoration = { | ||
type?: "borders" | "patternify"; | ||
preset?: TBorderPresetNames & TPatternifyPresetNames; | ||
}; | ||
import type { TLink } from "./links"; | ||
import { default as links } from "./links"; | ||
|
||
export type TDecorations = { | ||
borders?: TBorder[]; | ||
patternify?: TPatternify[]; | ||
links?: TLinkStyle[]; | ||
links?: TLink[]; | ||
buttons?: TButton[]; | ||
}; | ||
|
||
const decorations: TDecorations = { | ||
borders: borders, | ||
patternify: patternify, | ||
links: linkStyles, | ||
links: links, | ||
buttons: buttons, | ||
}; | ||
|
||
export default decorations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
export type { TDecorations, TDecoration } from "./decorations"; | ||
export { default as decorations } from "./decorations"; | ||
export type { TBorder } from "./borders"; | ||
export { default as borders } from "./borders"; | ||
|
||
export type { TButton } from "./buttons"; | ||
export { default as buttons } from "./buttons"; | ||
|
||
export type { | ||
TLinkStylePresetNames, | ||
TLinkStyle, | ||
TLinkTypePresetNames, | ||
} from "./link"; | ||
export type { TLink } from "./links"; | ||
export { default as links } from "./links"; | ||
|
||
export type { TDecorations } from "./decorations"; | ||
export { default as decorations } from "./decorations"; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import type { TPreset, TStyle } from "../"; | ||
|
||
export type TLink = { | ||
preset?: TPreset; | ||
styles?: TStyle[]; | ||
}; | ||
|
||
/** | ||
* Defines the default link style. | ||
*/ | ||
const defaultLink: TLink = { | ||
preset: { | ||
type: "link", | ||
name: "default", | ||
}, | ||
styles: [ | ||
{ | ||
state: "default", | ||
presets: [ | ||
{ | ||
type: "colorPair", | ||
name: "default", | ||
}, | ||
], | ||
css: { | ||
textDecoration: "underline", | ||
}, | ||
}, | ||
{ | ||
state: "active", | ||
presets: [ | ||
{ | ||
type: "colorPair", | ||
name: "inverted", | ||
}, | ||
], | ||
css: { | ||
textDecoration: "line-through", | ||
}, | ||
}, | ||
{ | ||
state: "visited", | ||
presets: [ | ||
{ | ||
type: "colorPair", | ||
name: "default", | ||
}, | ||
], | ||
css: { | ||
textDecorationColor: "red", | ||
}, | ||
}, | ||
{ | ||
state: "hidden", | ||
css: { | ||
display: "none", | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
/** | ||
* Defines the available link styles. | ||
*/ | ||
const links: TLink[] = [defaultLink]; | ||
|
||
export default links; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters