@startupjs/docs 0.54.12 → 0.55.0-alpha.0
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/client/app/Layout/Sidebar/Content/Docs/index.styl +1 -1
- package/client/app/Layout/Sidebar/Content/Options/index.js +31 -9
- package/client/app/Layout/Sidebar/Content/Options/index.styl +1 -1
- package/client/app/Layout/Sidebar/Content/index.styl +3 -3
- package/client/app/Layout/index.js +4 -3
- package/client/app/Layout/index.styl +5 -8
- package/client/components/Props/Constructor/Table/index.styl +0 -2
- package/client/components/Props/Constructor/Tr/index.styl +2 -5
- package/client/components/Props/Constructor/index.styl +12 -17
- package/client/components/Props/index.styl +4 -5
- package/client/components/Sandbox/index.styl +1 -1
- package/package.json +5 -5
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { pug, observer, useValue } from 'startupjs'
|
|
3
|
-
import { Br, Input, Button, Modal } from '@startupjs/ui'
|
|
2
|
+
import { pug, observer, useValue, $ } from 'startupjs'
|
|
3
|
+
import { Br, Input, Button, Modal, CssVariables, Palette, Colors } from '@startupjs/ui'
|
|
4
4
|
import { faSlidersH } from '@fortawesome/free-solid-svg-icons'
|
|
5
5
|
import {
|
|
6
6
|
useShowGrid,
|
|
7
|
-
useShowSizes
|
|
8
|
-
// useValidateWidth
|
|
9
|
-
useDarkTheme
|
|
7
|
+
useShowSizes
|
|
8
|
+
// useValidateWidth
|
|
10
9
|
} from '../../../../../clientHelpers'
|
|
11
10
|
import './index.styl'
|
|
12
11
|
|
|
12
|
+
const palette = new Palette()
|
|
13
|
+
const { Color, generateColors } = palette
|
|
14
|
+
|
|
15
|
+
const THEMES = {
|
|
16
|
+
dark: generateColors({
|
|
17
|
+
[Colors.bg]: Color('coolGray', 0),
|
|
18
|
+
[Colors.text]: Color('coolGray', 9),
|
|
19
|
+
[Colors.border]: Color('coolGray', 2),
|
|
20
|
+
[Colors.secondary]: Color('coolGray', 9)
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
|
|
13
24
|
export default observer(function Options ({
|
|
14
25
|
style
|
|
15
26
|
}) {
|
|
@@ -19,13 +30,24 @@ export default observer(function Options ({
|
|
|
19
30
|
// initially. While $showSizes.get() works fine for some reason.
|
|
20
31
|
const [, $showSizes] = useShowSizes()
|
|
21
32
|
// const [, $validateWidth] = useValidateWidth()
|
|
22
|
-
const
|
|
33
|
+
const $theme = $.session.theme
|
|
34
|
+
const theme = $theme.get() || 'light'
|
|
35
|
+
|
|
36
|
+
function toggleTheme () {
|
|
37
|
+
if (theme === 'light') {
|
|
38
|
+
$theme.set('dark')
|
|
39
|
+
} else {
|
|
40
|
+
$theme.set('light')
|
|
41
|
+
}
|
|
42
|
+
}
|
|
23
43
|
|
|
24
44
|
return pug`
|
|
45
|
+
if theme !== 'light'
|
|
46
|
+
CssVariables(meta=THEMES[theme])
|
|
25
47
|
Button(
|
|
26
48
|
style=style
|
|
27
49
|
icon=faSlidersH
|
|
28
|
-
color='
|
|
50
|
+
color='text-description'
|
|
29
51
|
variant='text'
|
|
30
52
|
onPress=() => $open.set(true)
|
|
31
53
|
)
|
|
@@ -33,12 +55,12 @@ export default observer(function Options ({
|
|
|
33
55
|
title='Settings'
|
|
34
56
|
$visible=$open
|
|
35
57
|
)
|
|
36
|
-
Input.input(type='checkbox' label='Dark theme'
|
|
58
|
+
Input.input(type='checkbox' label='Dark theme' value=theme === 'dark' onChange=toggleTheme)
|
|
37
59
|
if $showSizes.get()
|
|
38
60
|
//- TODO: Maybe bring width check back in future
|
|
39
61
|
// Input.input(type='checkbox' label='Validate width' $value=$validateWidth)
|
|
40
62
|
Input.input(type='checkbox' label='Show grid' $value=$showGrid)
|
|
41
63
|
Input.input(type='checkbox' label='Show sizes' $value=$showSizes)
|
|
42
|
-
Br
|
|
64
|
+
Br
|
|
43
65
|
`
|
|
44
66
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.root
|
|
2
|
-
background-color
|
|
2
|
+
background-color var(--color-bg)
|
|
3
3
|
flex 1
|
|
4
4
|
|
|
5
5
|
.main
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
margin-bottom 4u
|
|
17
17
|
|
|
18
18
|
.hr
|
|
19
|
-
border-bottom-color
|
|
19
|
+
border-bottom-color var(--color-border)
|
|
20
20
|
|
|
21
21
|
.footer
|
|
22
22
|
padding-top 1u
|
|
23
23
|
padding-bottom 1u
|
|
24
24
|
padding-left 2u
|
|
25
25
|
padding-right 0.5u
|
|
26
|
-
background-color
|
|
26
|
+
background-color var(--color-bg-dim)
|
|
27
27
|
|
|
28
28
|
.lang
|
|
29
29
|
// TODO: flex-grow 1 for some reason gets removed. Research.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import { pug, emit, observer, useModel } from 'startupjs'
|
|
2
|
+
import { pug, emit, observer, useModel, $ } from 'startupjs'
|
|
3
3
|
import { pathFor, useLocation } from 'startupjs/app'
|
|
4
4
|
import { AutoSuggest, Button, Div, Layout, Menu, Row, Span } from '@startupjs/ui'
|
|
5
5
|
import { MDXProvider } from '@startupjs/mdx'
|
|
@@ -51,6 +51,7 @@ const Search = observer(function Search () {
|
|
|
51
51
|
}, [])
|
|
52
52
|
|
|
53
53
|
function onChange (value) {
|
|
54
|
+
if (!value) return
|
|
54
55
|
setValue({})
|
|
55
56
|
// TODO: replaced from Menu.Item 'to' property
|
|
56
57
|
emit('url', value.value)
|
|
@@ -87,7 +88,7 @@ const Topbar = observer(function Topbar () {
|
|
|
87
88
|
|
|
88
89
|
return pug`
|
|
89
90
|
Row.topbar
|
|
90
|
-
Button(testID='button' variant='text' icon=faBars onPress=toggleSidebar color='
|
|
91
|
+
Button(testID='button' variant='text' icon=faBars onPress=toggleSidebar color='text-description')
|
|
91
92
|
Div.searchWrapper
|
|
92
93
|
Search
|
|
93
94
|
`
|
|
@@ -97,7 +98,7 @@ export default observer(function StyleguideLayout ({ children }) {
|
|
|
97
98
|
// Note: Topbar height is compensated in PDoc
|
|
98
99
|
// to achieve a semi-transparent effect
|
|
99
100
|
return pug`
|
|
100
|
-
MDXProvider
|
|
101
|
+
MDXProvider(key=$.session.theme.get())
|
|
101
102
|
Layout.layout(testID="Layout")
|
|
102
103
|
Sidebar
|
|
103
104
|
Topbar
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
@require '../constants.styl'
|
|
2
2
|
|
|
3
|
-
$separatorColor = #ddd
|
|
4
|
-
$topbarBorderColor = #eee
|
|
5
|
-
|
|
6
3
|
.layout
|
|
7
|
-
background-color
|
|
4
|
+
background-color var(--color-bg-strong)
|
|
8
5
|
|
|
9
6
|
.topbar
|
|
10
7
|
align-items center
|
|
11
8
|
justify-content space-between
|
|
12
9
|
border-bottom-width 1px
|
|
13
|
-
border-bottom-color
|
|
10
|
+
border-bottom-color var(--color-border-strong-alt)
|
|
14
11
|
height $TOPBAR_HEIGHT
|
|
15
12
|
padding 0 1u
|
|
16
13
|
|
|
17
14
|
.searchWrapper
|
|
18
15
|
width 32u
|
|
19
16
|
border-left-width 1px
|
|
20
|
-
border-left-color
|
|
17
|
+
border-left-color var(--color-border)
|
|
21
18
|
padding-left 2u
|
|
22
19
|
|
|
23
20
|
+tablet()
|
|
@@ -28,7 +25,7 @@ $topbarBorderColor = #eee
|
|
|
28
25
|
&:part(input)
|
|
29
26
|
border none
|
|
30
27
|
&:part(icon)
|
|
31
|
-
color
|
|
28
|
+
color var(--color-text-description)
|
|
32
29
|
|
|
33
30
|
.active
|
|
34
|
-
color
|
|
31
|
+
color var(--color-text-primary)
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
$border = #eaeaea
|
|
2
|
-
$darkBorder = lighten($UI.colors.dark, 0%)
|
|
3
|
-
|
|
4
1
|
.root
|
|
5
2
|
flex-direction row
|
|
6
|
-
border-color
|
|
3
|
+
border-color var(--color-border)
|
|
7
4
|
border-bottom-width 1px
|
|
8
5
|
padding-left 1u
|
|
9
6
|
padding-right 1u
|
|
10
7
|
|
|
11
8
|
.dark
|
|
12
9
|
&.root
|
|
13
|
-
border-color
|
|
10
|
+
border-color var(--color-border-inverse)
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
$input =
|
|
2
|
-
$
|
|
3
|
-
$
|
|
4
|
-
$
|
|
5
|
-
$
|
|
6
|
-
$
|
|
7
|
-
|
|
8
|
-
.input
|
|
9
|
-
background-color white
|
|
10
|
-
border-color $input
|
|
11
|
-
border-width 1px
|
|
12
|
-
padding 0 0.5u
|
|
1
|
+
$input = var(--color-border)
|
|
2
|
+
$header = var(--color-text-description)
|
|
3
|
+
$darkHeader = var(--color-text-inverse)
|
|
4
|
+
$value = var(--color-text-success)
|
|
5
|
+
$type = var(--color-text-info)
|
|
6
|
+
$valueDark = var(--color-text-success-strong)
|
|
7
|
+
$typeDark = var(--color-text-info-strong)
|
|
13
8
|
|
|
14
9
|
.header
|
|
15
10
|
font-size 12px
|
|
@@ -34,19 +29,19 @@ $type = $UI.colors.additional1
|
|
|
34
29
|
&.header
|
|
35
30
|
color $darkHeader
|
|
36
31
|
&.value
|
|
37
|
-
color
|
|
32
|
+
color $valueDark
|
|
38
33
|
&.type
|
|
39
|
-
color
|
|
34
|
+
color $typeDark
|
|
40
35
|
|
|
41
36
|
.checkbox
|
|
42
37
|
align-self flex-end
|
|
43
38
|
|
|
44
39
|
.unsupported
|
|
45
|
-
color
|
|
40
|
+
color var(--color-text-description)
|
|
46
41
|
text-align right
|
|
47
42
|
|
|
48
43
|
.separator
|
|
49
|
-
color
|
|
44
|
+
color var(--color-text-placeholder)
|
|
50
45
|
|
|
51
46
|
.vCenter
|
|
52
47
|
justify-content center
|
|
@@ -56,4 +51,4 @@ $type = $UI.colors.additional1
|
|
|
56
51
|
align-self flex-start
|
|
57
52
|
|
|
58
53
|
.badJSON
|
|
59
|
-
color
|
|
54
|
+
color var(--color-text-error)
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
$
|
|
2
|
-
$
|
|
3
|
-
$darkBottomBg = #333333
|
|
1
|
+
$darkTopBg = var(--color-bg-inverse)
|
|
2
|
+
$darkBottomBg = var(--color-bg-inverse-alt)
|
|
4
3
|
|
|
5
4
|
.root
|
|
6
5
|
margin-top 2u
|
|
7
6
|
|
|
8
7
|
.top
|
|
9
|
-
background-color
|
|
8
|
+
background-color var(--color-bg)
|
|
10
9
|
border-top-left-radius 1u
|
|
11
10
|
border-top-right-radius 1u
|
|
12
11
|
padding-top 1u
|
|
13
12
|
|
|
14
13
|
.bottom
|
|
15
14
|
padding-top 4u
|
|
16
|
-
background-color
|
|
15
|
+
background-color var(--color-bg-dim)
|
|
17
16
|
border-bottom-left-radius 1u
|
|
18
17
|
border-bottom-right-radius 1u
|
|
19
18
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
.error
|
|
2
|
-
color
|
|
2
|
+
color var(--color-text-error)
|
package/package.json
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"description": "MDX documentation generator",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.55.0-alpha.0",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "index.js",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@fortawesome/free-solid-svg-icons": "^5.12.0",
|
|
12
|
-
"@startupjs/mdx": "^0.
|
|
13
|
-
"@startupjs/scrollable-anchors": "^0.
|
|
14
|
-
"@startupjs/ui": "^0.
|
|
12
|
+
"@startupjs/mdx": "^0.55.0-alpha.0",
|
|
13
|
+
"@startupjs/scrollable-anchors": "^0.55.0-alpha.0",
|
|
14
|
+
"@startupjs/ui": "^0.55.0-alpha.0",
|
|
15
15
|
"parse-prop-types": "^0.3.0"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"react-native": "*",
|
|
20
20
|
"startupjs": "*"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "5b9f342065345c91ee4e11d9a44d66a9a73665ad"
|
|
23
23
|
}
|