-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
1 parent
9b1890b
commit 18a66b3
Showing
10 changed files
with
184 additions
and
10 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,29 @@ | ||
<script> | ||
import { ActionsClasses } from '../../shared/esm/classes/ActionsClasses.js'; | ||
import { useThemeClasses } from '../shared/use-theme-classes.js'; | ||
let className = undefined; | ||
export { className as class }; | ||
export let ios = undefined; | ||
export let material = undefined; | ||
export let opened = undefined; | ||
export let backdrop = true; | ||
export let onBackdropClick = undefined; | ||
$: state = opened ? 'opened' : 'closed'; | ||
$: c = useThemeClasses( | ||
{ ios, material }, | ||
ActionsClasses({}), | ||
className, | ||
(v) => (c = v) | ||
); | ||
</script> | ||
|
||
{#if backdrop} | ||
<div class={c.backdrop[state]} on:click={onBackdropClick} /> | ||
{/if} | ||
<div class={c.base[state]} {...$$restProps}> | ||
<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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<script> | ||
import { ActionsButtonClasses } from '../../shared/esm/classes/ActionsButtonClasses.js'; | ||
import { useThemeClasses } from '../shared/use-theme-classes.js'; | ||
import { useDarkClasses } from '../shared/use-dark-classes.js'; | ||
import { cls } from '../../shared/esm/cls.js'; | ||
import { useTouchRipple } from '../shared/use-touch-ripple.js'; | ||
let className = undefined; | ||
export { className as class }; | ||
let colorsProp = undefined; | ||
export { colorsProp as colors }; | ||
export let ios = undefined; | ||
export let material = undefined; | ||
export let component = 'button'; | ||
export let href = undefined; | ||
export let bold = false; | ||
export let fontSizeIos = 'text-xl'; | ||
export let fontSizeMaterial = 'text-base'; | ||
export let touchRipple = true; | ||
export let hairlines = true; | ||
export let onClick = undefined; | ||
const rippleEl = { current: null }; | ||
const dark = useDarkClasses(); | ||
$: useTouchRipple(rippleEl, touchRipple); | ||
$: attrs = { | ||
href, | ||
...$$restProps, | ||
}; | ||
let Component = component; | ||
if (typeof component === 'undefined' && (href || href === '')) { | ||
Component = 'a'; | ||
} else if (typeof component === 'undefined') { | ||
Component = 'button'; | ||
} | ||
$: colors = { | ||
bg: cls('bg-white', dark('dark:bg-neutral-800')), | ||
activeBg: cls('active:bg-neutral-200', dark('dark:active:bg-neutral-700')), | ||
text: 'text-primary', | ||
...colorsProp, | ||
}; | ||
$: c = useThemeClasses( | ||
{ ios, material }, | ||
ActionsButtonClasses( | ||
{ bold, fontSizeIos, fontSizeMaterial, hairlines }, | ||
colors, | ||
dark | ||
), | ||
className, | ||
(v) => (c = v) | ||
); | ||
</script> | ||
|
||
<svelte:element | ||
this={Component} | ||
bind:this={rippleEl.current} | ||
class={c.base} | ||
on:click={onClick} | ||
{...attrs} | ||
> | ||
<slot /> | ||
</svelte:element> |
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,22 @@ | ||
<script> | ||
import { ActionsGroupClasses } from '../../shared/esm/classes/ActionsGroupClasses.js'; | ||
import { useThemeClasses } from '../shared/use-theme-classes.js'; | ||
let className = undefined; | ||
export { className as class }; | ||
export let ios = undefined; | ||
export let material = undefined; | ||
export let hairlines = true; | ||
$: c = useThemeClasses( | ||
{ ios, material }, | ||
ActionsGroupClasses({ hairlines }), | ||
className, | ||
(v) => (c = v) | ||
); | ||
</script> | ||
|
||
<div class={c.base} {...$$restProps}> | ||
<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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<script> | ||
import { ActionsLabelClasses } from '../../shared/esm/classes/ActionsLabelClasses.js'; | ||
import { useThemeClasses } from '../shared/use-theme-classes.js'; | ||
import { useDarkClasses } from '../shared/use-dark-classes.js'; | ||
import { cls } from '../../shared/esm/cls.js'; | ||
let className = undefined; | ||
export { className as class }; | ||
let colorsProp = undefined; | ||
export { colorsProp as colors }; | ||
export let ios = undefined; | ||
export let material = undefined; | ||
export let fontSizeIos = 'text-sm'; | ||
export let fontSizeMaterial = 'text-base'; | ||
export let hairlines = true; | ||
const dark = useDarkClasses(); | ||
$: attrs = { | ||
...$$restProps, | ||
}; | ||
$: colors = { | ||
bg: cls('bg-white', dark('dark:bg-neutral-800')), | ||
activeBg: cls('active:bg-neutral-200', dark('dark:active:bg-neutral-700')), | ||
text: cls( | ||
'text-black text-opacity-55', | ||
dark('dark:text-white dark:text-opacity-55') | ||
), | ||
...colorsProp, | ||
}; | ||
$: c = useThemeClasses( | ||
{ ios, material }, | ||
ActionsLabelClasses( | ||
{ fontSizeIos, fontSizeMaterial, hairlines }, | ||
colors, | ||
dark | ||
), | ||
className, | ||
(v) => (c = v) | ||
); | ||
</script> | ||
|
||
<div class={c.base} {...attrs}> | ||
<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