-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Design tokens / Theme support (with dark mode) (#146)
* Squash all theme changes into single commit * Add changeset * Enter prerelease mode and version packages * Add Kbd component. Show keyboard shortcuts on ThemeButton menu * Read themes/colors from tailwind config, including Daisy UI (with mapping). Supports generating optional colors and further extension and flexability. * Process daisy themes to generate lightThemes/darkThemes based on color-scheme value * Add changeset * Version bump to 0.58.0-next.1 * Add styles (with daisy) as top-level export * Version bump to 0.58.0-next.2 * Add commonjs and esm versions of daisy module * Version bump to 0.58.0-next.3 * Remove daisy from top-level exports * Version bump to 0.58.0-next.4 * Rename `error` / `error-content` to `danger` / `danger-content` * Fix pnpm-lock.yaml using `pnpm install` (ERR_PNPM_ERR_PNPM_UNEXPECTED_PKG_CONTENT_IN_STORE The lockfile is broken! Resolution step will be performed to fix it.) * Add `accent` and `neutral` theme colors * Cleanup * Update some leftover `error` => `danger` color references * Extra tailwind plugin into multiple files for better readability * Use darker "-content" color for default `fill` variant (distinguish from `fill-light`) * Simplify naming and impl. of foregroundColor() and add lightenColor() (to match darkenColor()) * Register 100-900 shades for all semantic and state colors. Replace color-mix() usage (including Tailwind *-mix-* utils) with new shades * Use lib/styles/themes for types as well * Replace SvelteComponentTyped with SvelteComponent * Version bump to 0.58.0-next.5 * Cleanup * Remove unused css files * Simplify * Support changing colorSpace (rgb, hsl, or oklch) * Improve theme page preview and add menu item * Improve default border color * Fix handling of hsl() color space by clamping to RGB values (to not exceed 100% saturation or lightness). Matches rgb() color * Version bump to 0.58.0-next.6 * Use same surface-content/20% outline color as border color * Remove explicit border colors that match default (border-surface-content/20) and replace some border-surface-### with default (surface-content/20) * Version bump to 0.58.0-next.7
- Loading branch information
Showing
147 changed files
with
2,666 additions
and
1,875 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte-ux': patch | ||
--- | ||
|
||
Add styles (with daisy) as top-level export |
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,14 @@ | ||
{ | ||
"mode": "pre", | ||
"tag": "next", | ||
"initialVersions": { | ||
"create-svelte-ux": "0.2.1", | ||
"svelte-ux": "0.57.1" | ||
}, | ||
"changesets": [ | ||
"angry-zebras-remember", | ||
"quick-avocados-hope", | ||
"strong-flies-provide", | ||
"yellow-oranges-fly" | ||
] | ||
} |
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,5 @@ | ||
--- | ||
'svelte-ux': minor | ||
--- | ||
|
||
Support `ux.themes` tailwind config, including Daisy UI |
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,6 @@ | ||
--- | ||
'create-svelte-ux': minor | ||
'svelte-ux': minor | ||
--- | ||
|
||
Theme support |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"author": "Sean Lynch <[email protected]>", | ||
"license": "MIT", | ||
"repository": "techniq/svelte-ux", | ||
"version": "0.57.3", | ||
"version": "0.58.0-next.7", | ||
"scripts": { | ||
"dev": "vite dev", | ||
"build": "vite build", | ||
|
@@ -21,48 +21,50 @@ | |
}, | ||
"devDependencies": { | ||
"@sveltejs/adapter-auto": "^2.1.1", | ||
"@sveltejs/kit": "^1.27.6", | ||
"@sveltejs/package": "^2.2.2", | ||
"@sveltejs/kit": "^1.30.3", | ||
"@sveltejs/package": "^2.2.5", | ||
"@tailwindcss/typography": "^0.5.10", | ||
"@types/d3-array": "^3.2.1", | ||
"@types/d3-scale": "^4.0.8", | ||
"@types/lodash-es": "^4.17.11", | ||
"@types/lodash-es": "^4.17.12", | ||
"@types/marked": "^6.0.0", | ||
"@types/prismjs": "^1.26.3", | ||
"@vitest/coverage-v8": "^0.34.6", | ||
"autoprefixer": "^10.4.16", | ||
"culori": "^3.3.0", | ||
"daisyui": "^4.5.0", | ||
"execa": "^8.0.1", | ||
"marked": "^10.0.0", | ||
"mdsvex": "^0.11.0", | ||
"prettier": "^3.1.0", | ||
"prettier-plugin-svelte": "^3.1.0", | ||
"prettier": "^3.1.1", | ||
"prettier-plugin-svelte": "^3.1.2", | ||
"sveld": "^0.19.1", | ||
"svelte": "^4.2.7", | ||
"svelte-check": "^3.6.0", | ||
"svelte-preprocess": "^5.1.0", | ||
"svelte2tsx": "^0.6.25", | ||
"tailwindcss": "^3.3.5", | ||
"svelte": "^4.2.8", | ||
"svelte-check": "^3.6.2", | ||
"svelte-preprocess": "^5.1.3", | ||
"svelte2tsx": "^0.6.27", | ||
"tailwindcss": "^3.4.0", | ||
"tslib": "^2.6.2", | ||
"typedoc-json-parser": "^9.0.1", | ||
"typescript": "^5.2.2", | ||
"typescript": "^5.3.3", | ||
"unist-util-visit": "^5.0.0", | ||
"vite": "^4.5.0", | ||
"vite": "^4.5.1", | ||
"vitest": "^0.33.0" | ||
}, | ||
"type": "module", | ||
"dependencies": { | ||
"@changesets/cli": "^2.26.2", | ||
"@changesets/cli": "^2.27.1", | ||
"@floating-ui/dom": "^1.5.3", | ||
"@fortawesome/fontawesome-common-types": "^6.4.2", | ||
"clsx": "^2.0.0", | ||
"@fortawesome/fontawesome-common-types": "^6.5.1", | ||
"clsx": "^2.1.0", | ||
"d3-array": "^3.2.4", | ||
"d3-scale": "^4.0.2", | ||
"date-fns": "^3.0.5", | ||
"date-fns": "^3.0.6", | ||
"immer": "^10.0.3", | ||
"lodash-es": "^4.17.21", | ||
"posthog-js": "^1.95.1", | ||
"posthog-js": "^1.96.1", | ||
"rehype-slug": "^6.0.0", | ||
"tailwind-merge": "^2.0.0", | ||
"tailwind-merge": "^2.2.0", | ||
"zod": "^3.22.4" | ||
}, | ||
"peerDependencies": { | ||
|
@@ -85,7 +87,8 @@ | |
"types": "./dist/utils/*.d.ts", | ||
"svelte": "./dist/utils/*.js" | ||
}, | ||
"./plugins/*": "./dist/plugins/*" | ||
"./plugins/*": "./dist/plugins/*", | ||
"./styles/*": "./dist/styles/*" | ||
}, | ||
"files": [ | ||
"dist" | ||
|
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,11 +1,15 @@ | ||
<script lang="ts"> | ||
import { mdiInformation } from '@mdi/js'; | ||
import Icon from '../lib/components/Icon.svelte'; | ||
import { cls } from '$lib/utils/styles'; | ||
</script> | ||
|
||
<div | ||
class="bg-accent-500/10 border-l-[6px] border-l-accent-500 border-accent-500/30 text-accent-900 px-4 py-2 border my-4 rounded flex items-center gap-2 text-sm" | ||
class={cls( | ||
'bg-primary/10 border border-l-[6px] border-primary/30 border-l-primary text-primary px-4 py-2 my-4 rounded flex items-center gap-2 text-sm', | ||
'[&>a]:font-medium [&>a]:underline [&>a]:decoration-dashed [&>a]:decoration-primary/50 [&>a]:underline-offset-2' | ||
)} | ||
> | ||
<Icon data={mdiInformation} class="text-accent-500" /> | ||
<Icon data={mdiInformation} class="text-primary" /> | ||
<slot /> | ||
</div> |
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,3 +1,3 @@ | ||
<a class="text-accent-500 font-medium" {...$$restProps}> | ||
<a class="text-primary font-medium" {...$$restProps}> | ||
<slot /> | ||
</a> |
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
Oops, something went wrong.