@furystack/shades-common-components 5.0.17 → 5.0.19
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/esm/components/app-bar-link.d.ts +1 -1
- package/esm/components/app-bar-link.d.ts.map +1 -1
- package/esm/components/app-bar-link.js +1 -3
- package/esm/components/app-bar-link.js.map +1 -1
- package/esm/components/app-bar.d.ts +3 -1
- package/esm/components/app-bar.d.ts.map +1 -1
- package/esm/components/avatar.d.ts +6 -1
- package/esm/components/avatar.d.ts.map +1 -1
- package/esm/components/button.d.ts +6 -1
- package/esm/components/button.d.ts.map +1 -1
- package/esm/components/command-palette/command-palette-input.d.ts +3 -1
- package/esm/components/command-palette/command-palette-input.d.ts.map +1 -1
- package/esm/components/command-palette/command-palette-suggestion-list.d.ts +3 -1
- package/esm/components/command-palette/command-palette-suggestion-list.d.ts.map +1 -1
- package/esm/components/command-palette/index.d.ts +3 -1
- package/esm/components/command-palette/index.d.ts.map +1 -1
- package/esm/components/data-grid/body.d.ts.map +1 -1
- package/esm/components/data-grid/body.js +4 -2
- package/esm/components/data-grid/body.js.map +1 -1
- package/esm/components/data-grid/footer.d.ts +3 -1
- package/esm/components/data-grid/footer.d.ts.map +1 -1
- package/esm/components/data-grid/header.d.ts +3 -1
- package/esm/components/data-grid/header.d.ts.map +1 -1
- package/esm/components/data-grid/selection-cell.d.ts +3 -1
- package/esm/components/data-grid/selection-cell.d.ts.map +1 -1
- package/esm/components/fab.d.ts +2 -2
- package/esm/components/fab.d.ts.map +1 -1
- package/esm/components/fab.js +15 -20
- package/esm/components/fab.js.map +1 -1
- package/esm/components/inputs/autocomplete.d.ts +3 -1
- package/esm/components/inputs/autocomplete.d.ts.map +1 -1
- package/esm/components/inputs/autocomplete.js +6 -2
- package/esm/components/inputs/autocomplete.js.map +1 -1
- package/esm/components/inputs/input.d.ts +3 -1
- package/esm/components/inputs/input.d.ts.map +1 -1
- package/esm/components/inputs/text-area.d.ts +3 -1
- package/esm/components/inputs/text-area.d.ts.map +1 -1
- package/esm/components/loader.d.ts +3 -1
- package/esm/components/loader.d.ts.map +1 -1
- package/esm/components/loader.js +5 -3
- package/esm/components/loader.js.map +1 -1
- package/esm/components/modal.d.ts +3 -1
- package/esm/components/modal.d.ts.map +1 -1
- package/esm/components/noty-list.d.ts +6 -2
- package/esm/components/noty-list.d.ts.map +1 -1
- package/esm/components/noty-list.js +28 -25
- package/esm/components/noty-list.js.map +1 -1
- package/esm/components/paper.d.ts +4 -4
- package/esm/components/paper.d.ts.map +1 -1
- package/esm/components/paper.js +9 -7
- package/esm/components/paper.js.map +1 -1
- package/esm/components/skeleton.d.ts +3 -1
- package/esm/components/skeleton.d.ts.map +1 -1
- package/esm/components/skeleton.js +10 -12
- package/esm/components/skeleton.js.map +1 -1
- package/esm/components/suggest/index.d.ts.map +1 -1
- package/esm/components/suggest/index.js +3 -1
- package/esm/components/suggest/index.js.map +1 -1
- package/esm/components/suggest/suggest-input.d.ts +3 -1
- package/esm/components/suggest/suggest-input.d.ts.map +1 -1
- package/esm/components/suggest/suggest-input.js +4 -2
- package/esm/components/suggest/suggest-input.js.map +1 -1
- package/esm/components/tabs.d.ts +3 -1
- package/esm/components/tabs.d.ts.map +1 -1
- package/esm/components/tabs.js +5 -3
- package/esm/components/tabs.js.map +1 -1
- package/esm/components/wizard/index.d.ts +3 -1
- package/esm/components/wizard/index.d.ts.map +1 -1
- package/esm/services/{default-variable-theme.d.ts → css-variable-theme.d.ts} +2 -2
- package/esm/services/css-variable-theme.d.ts.map +1 -0
- package/esm/services/{default-variable-theme.js → css-variable-theme.js} +3 -3
- package/esm/services/css-variable-theme.js.map +1 -0
- package/esm/services/index.d.ts +1 -1
- package/esm/services/index.d.ts.map +1 -1
- package/esm/services/index.js +1 -1
- package/esm/services/index.js.map +1 -1
- package/esm/services/theme-provider-service.d.ts.map +1 -1
- package/esm/services/theme-provider-service.js +2 -2
- package/esm/services/theme-provider-service.js.map +1 -1
- package/package.json +6 -6
- package/src/components/app-bar-link.tsx +1 -6
- package/src/components/data-grid/body.tsx +4 -3
- package/src/components/fab.tsx +16 -22
- package/src/components/inputs/autocomplete.tsx +6 -3
- package/src/components/loader.tsx +5 -3
- package/src/components/noty-list.tsx +29 -26
- package/src/components/paper.tsx +10 -10
- package/src/components/skeleton.tsx +11 -12
- package/src/components/suggest/index.tsx +3 -1
- package/src/components/suggest/suggest-input.tsx +4 -3
- package/src/components/tabs.tsx +5 -3
- package/src/services/{default-variable-theme.ts → css-variable-theme.ts} +2 -2
- package/src/services/index.ts +1 -1
- package/src/services/theme-provider-service.ts +2 -2
- package/esm/services/default-variable-theme.d.ts.map +0 -1
- package/esm/services/default-variable-theme.js.map +0 -1
package/src/components/paper.tsx
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { attachProps } from '@furystack/shades'
|
|
1
|
+
import { attachStyles } from '@furystack/shades'
|
|
3
2
|
import { Shade, createComponent } from '@furystack/shades'
|
|
4
3
|
import { ThemeProviderService } from '../services/theme-provider-service.js'
|
|
5
4
|
|
|
6
|
-
export const Paper = Shade<
|
|
5
|
+
export const Paper = Shade<{ elevation?: 1 | 2 | 3 }>({
|
|
7
6
|
shadowDomName: 'shade-paper',
|
|
8
|
-
|
|
7
|
+
elementBase: HTMLDivElement,
|
|
8
|
+
elementBaseName: 'div',
|
|
9
|
+
style: {
|
|
10
|
+
borderRadius: '3px',
|
|
11
|
+
margin: '8px',
|
|
12
|
+
padding: '6px 16px',
|
|
13
|
+
},
|
|
9
14
|
render: ({ injector, props, children, element }) => {
|
|
10
15
|
const themeProvider = injector.getInstance(ThemeProviderService)
|
|
11
16
|
const { elevation = 1 } = props
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
...props,
|
|
18
|
+
attachStyles(element, {
|
|
15
19
|
style: {
|
|
16
|
-
borderRadius: '3px',
|
|
17
20
|
boxShadow: elevation ? `1px ${elevation}px ${elevation}px rgba(0,0,0,0.3)` : '',
|
|
18
21
|
backgroundColor: themeProvider.theme.background.paper,
|
|
19
22
|
color: themeProvider.theme.text.secondary,
|
|
20
|
-
margin: '8px',
|
|
21
|
-
padding: '6px 16px',
|
|
22
|
-
...props?.style,
|
|
23
23
|
},
|
|
24
24
|
})
|
|
25
25
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Shade } from '@furystack/shades'
|
|
2
2
|
import { promisifyAnimation } from '../utils/promisify-animation.js'
|
|
3
3
|
|
|
4
4
|
export type SkeletonProps = {
|
|
@@ -10,6 +10,15 @@ export type SkeletonProps = {
|
|
|
10
10
|
|
|
11
11
|
export const Skeleton = Shade<SkeletonProps>({
|
|
12
12
|
shadowDomName: 'shade-skeleton',
|
|
13
|
+
style: {
|
|
14
|
+
opacity: '0',
|
|
15
|
+
display: 'inline-block',
|
|
16
|
+
background: 'linear-gradient(-45deg, rgba(128,128,128,0.1), rgba(128,128,128,0.3), rgba(128,128,128,0.1))',
|
|
17
|
+
backgroundSize: '400% 400%',
|
|
18
|
+
width: '100%',
|
|
19
|
+
height: '100%',
|
|
20
|
+
minHeight: '1em',
|
|
21
|
+
},
|
|
13
22
|
render: ({ element, props }) => {
|
|
14
23
|
const { delay = 1500 } = props
|
|
15
24
|
setTimeout(() => {
|
|
@@ -29,17 +38,7 @@ export const Skeleton = Shade<SkeletonProps>({
|
|
|
29
38
|
)
|
|
30
39
|
})
|
|
31
40
|
})
|
|
32
|
-
|
|
33
|
-
style: {
|
|
34
|
-
opacity: '0',
|
|
35
|
-
display: 'inline-block',
|
|
36
|
-
background: 'linear-gradient(-45deg, rgba(128,128,128,0.1), rgba(128,128,128,0.3), rgba(128,128,128,0.1))',
|
|
37
|
-
backgroundSize: '400% 400%',
|
|
38
|
-
width: '100%',
|
|
39
|
-
height: '100%',
|
|
40
|
-
minHeight: '1em',
|
|
41
|
-
},
|
|
42
|
-
})
|
|
41
|
+
|
|
43
42
|
return null
|
|
44
43
|
},
|
|
45
44
|
})
|
|
@@ -25,8 +25,10 @@ export const Suggest: <T>(props: SuggestProps<T>, children: ChildrenList) => JSX
|
|
|
25
25
|
SuggestProps<any>
|
|
26
26
|
>({
|
|
27
27
|
shadowDomName: 'shade-suggest',
|
|
28
|
+
style: {
|
|
29
|
+
flexGrow: '1',
|
|
30
|
+
},
|
|
28
31
|
render: ({ props, injector, element, useDisposable, useObservable }) => {
|
|
29
|
-
element.style.flexGrow = '1'
|
|
30
32
|
const manager = useDisposable('manager', () => new SuggestManager(props.getEntries, props.getSuggestionEntry))
|
|
31
33
|
const { theme } = injector.getInstance(ThemeProviderService)
|
|
32
34
|
const inputContainer = element.querySelector('.input-container') as HTMLDivElement
|
|
@@ -4,12 +4,13 @@ import type { SuggestManager } from './suggest-manager.js'
|
|
|
4
4
|
|
|
5
5
|
export const SuggestInput = Shade<{ manager: SuggestManager<any> }>({
|
|
6
6
|
shadowDomName: 'shades-suggest-input',
|
|
7
|
+
style: {
|
|
8
|
+
width: '100%',
|
|
9
|
+
overflow: 'hidden',
|
|
10
|
+
},
|
|
7
11
|
render: ({ element, props, useObservable, injector }) => {
|
|
8
12
|
const { theme } = injector.getInstance(ThemeProviderService)
|
|
9
13
|
|
|
10
|
-
element.style.width = '100%'
|
|
11
|
-
element.style.overflow = 'hidden'
|
|
12
|
-
|
|
13
14
|
useObservable(
|
|
14
15
|
'isOpened',
|
|
15
16
|
props.manager.isOpened,
|
package/src/components/tabs.tsx
CHANGED
|
@@ -9,15 +9,17 @@ export interface Tab {
|
|
|
9
9
|
|
|
10
10
|
const TabHeader = Shade<{ isActive?: boolean; onActivate: () => void }>({
|
|
11
11
|
shadowDomName: 'shade-tab-header',
|
|
12
|
+
style: {
|
|
13
|
+
padding: '1em 2.5em',
|
|
14
|
+
cursor: 'pointer',
|
|
15
|
+
transition: 'box-shadow 1s linear',
|
|
16
|
+
},
|
|
12
17
|
render: ({ children, element, injector, props }) => {
|
|
13
18
|
const { theme } = injector.getInstance(ThemeProviderService)
|
|
14
19
|
const { isActive } = props
|
|
15
20
|
|
|
16
21
|
attachProps(element, {
|
|
17
22
|
style: {
|
|
18
|
-
padding: '1em 2.5em',
|
|
19
|
-
cursor: 'pointer',
|
|
20
|
-
transition: 'box-shadow 1s linear',
|
|
21
23
|
fontWeight: isActive ? 'bolder' : 'inherit',
|
|
22
24
|
background: isActive ? theme.background.paper : theme.background.default,
|
|
23
25
|
color: isActive ? theme.text.primary : theme.text.secondary,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DeepPartial } from '@furystack/utils'
|
|
2
2
|
import type { Theme } from './theme-provider-service.js'
|
|
3
|
-
export const
|
|
3
|
+
export const cssVariableTheme: Theme = {
|
|
4
4
|
text: {
|
|
5
5
|
primary: 'var(--shades-theme-text-primary)',
|
|
6
6
|
secondary: 'var(--shades-theme-text-secondary)',
|
|
@@ -79,5 +79,5 @@ const assignValue = <T extends object>(
|
|
|
79
79
|
|
|
80
80
|
export const useThemeCssVariables = (theme: DeepPartial<Theme>) => {
|
|
81
81
|
const root = document.querySelector(':root') as HTMLElement
|
|
82
|
-
assignValue(
|
|
82
|
+
assignValue(cssVariableTheme, theme, root)
|
|
83
83
|
}
|
package/src/services/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Injectable } from '@furystack/inject'
|
|
2
2
|
import type { DeepPartial } from '@furystack/utils'
|
|
3
|
-
import {
|
|
3
|
+
import { cssVariableTheme, getCssVariable, useThemeCssVariables } from './css-variable-theme.js'
|
|
4
4
|
|
|
5
5
|
export type Color = string // `#${string}` | `rgba(${number},${number},${number},${number})` |
|
|
6
6
|
|
|
@@ -122,7 +122,7 @@ export class ThemeProviderService {
|
|
|
122
122
|
throw Error(`Color format '${color}' is not supported.'`)
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
public readonly theme =
|
|
125
|
+
public readonly theme = cssVariableTheme
|
|
126
126
|
|
|
127
127
|
public set(change: DeepPartial<Theme>) {
|
|
128
128
|
useThemeCssVariables(change)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-variable-theme.d.ts","sourceRoot":"","sources":["../../src/services/default-variable-theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAA;AACxD,eAAO,MAAM,oBAAoB,EAAE,KAkDlC,CAAA;AAED,eAAO,MAAM,cAAc,QAAS,MAAM,SAAS,MAAM,QAAQ,WAAW,SAE3E,CAAA;AAED,eAAO,MAAM,cAAc,QAAS,MAAM,SAAQ,WAAW,WAE5D,CAAA;AAmBD,eAAO,MAAM,oBAAoB,UAAW,YAAY,KAAK,CAAC,SAG7D,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-variable-theme.js","sourceRoot":"","sources":["../../src/services/default-variable-theme.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAU;IACzC,IAAI,EAAE;QACJ,OAAO,EAAE,kCAAkC;QAC3C,SAAS,EAAE,oCAAoC;QAC/C,QAAQ,EAAE,mCAAmC;KAC9C;IACD,MAAM,EAAE;QACN,MAAM,EAAE,mCAAmC;QAC3C,KAAK,EAAE,kCAAkC;QACzC,QAAQ,EAAE,qCAAqC;QAC/C,QAAQ,EAAE,qCAAqC;QAC/C,kBAAkB,EAAE,gDAAgD;KACrE;IACD,UAAU,EAAE;QACV,OAAO,EAAE,wCAAwC;QACjD,KAAK,EAAE,sCAAsC;KAC9C;IACD,OAAO,EAAE;QACP,OAAO,EAAE;YACP,KAAK,EAAE,2CAA2C;YAClD,IAAI,EAAE,0CAA0C;YAChD,IAAI,EAAE,0CAA0C;SACjD;QACD,SAAS,EAAE;YACT,KAAK,EAAE,6CAA6C;YACpD,IAAI,EAAE,4CAA4C;YAClD,IAAI,EAAE,4CAA4C;SACnD;QACD,KAAK,EAAE;YACL,KAAK,EAAE,yCAAyC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