@globalbrain/sefirot 2.0.0-draft.8 → 2.1.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/README.md +6 -6
- package/lib/components/SAvatar.vue +17 -17
- package/lib/components/SButton.vue +520 -276
- package/lib/components/SButtonGroup.vue +149 -0
- package/lib/components/SDropdown.vue +26 -150
- package/lib/components/SDropdownSection.vue +48 -0
- package/lib/components/SDropdownSectionFilter.vue +190 -0
- package/lib/components/SDropdownSectionFilterItem.vue +21 -0
- package/lib/components/SDropdownSectionFilterItemAvatar.vue +31 -0
- package/lib/components/SDropdownSectionFilterItemText.vue +20 -0
- package/lib/components/SDropdownSectionMenu.vue +39 -0
- package/lib/components/SIcon.vue +13 -0
- package/lib/components/SInputBase.vue +31 -31
- package/lib/components/SInputCheckbox.vue +4 -3
- package/lib/components/SInputCheckboxes.vue +74 -0
- package/lib/components/SInputDate.vue +182 -0
- package/lib/components/SInputDropdown.vue +159 -157
- package/lib/components/SInputDropdownItem.vue +46 -48
- package/lib/components/SInputDropdownItemAvatar.vue +99 -0
- package/lib/components/SInputDropdownItemText.vue +79 -16
- package/lib/components/SInputFile.vue +56 -60
- package/lib/components/SInputHMS.vue +120 -110
- package/lib/components/SInputNumber.vue +38 -9
- package/lib/components/SInputRadio.vue +39 -36
- package/lib/components/SInputRadios.vue +40 -53
- package/lib/components/SInputSelect.vue +7 -6
- package/lib/components/SInputSwitch.vue +193 -0
- package/lib/components/SInputSwitches.vue +88 -0
- package/lib/components/SInputText.vue +207 -62
- package/lib/components/SInputTextarea.vue +46 -32
- package/lib/components/SInputYMD.vue +123 -126
- package/lib/components/SMarkdown.vue +52 -0
- package/lib/components/SModal.vue +33 -57
- package/lib/components/SMount.vue +19 -0
- package/lib/components/SSheet.vue +50 -55
- package/lib/components/SSheetFooter.vue +1 -1
- package/lib/components/SSheetFooterAction.vue +24 -17
- package/lib/components/SSheetFooterActions.vue +1 -4
- package/lib/components/SSheetForm.vue +15 -0
- package/lib/components/SSheetMedium.vue +8 -10
- package/lib/components/SSheetTitle.vue +7 -14
- package/lib/components/SSnackbar.vue +58 -47
- package/lib/components/{SPortalSnackbars.vue → SSnackbars.vue} +17 -20
- package/lib/components/{icons/SIconPreloader.vue → SSpinner.vue} +5 -4
- package/lib/components/SStep.vue +107 -0
- package/lib/components/SSteps.vue +59 -0
- package/lib/components/STable.vue +242 -0
- package/lib/components/STableCell.vue +82 -0
- package/lib/components/STableCellAvatar.vue +69 -0
- package/lib/components/STableCellAvatars.vue +93 -0
- package/lib/components/STableCellDay.vue +40 -0
- package/lib/components/STableCellPill.vue +84 -0
- package/lib/components/STableCellText.vue +103 -0
- package/lib/components/STableColumn.vue +255 -0
- package/lib/components/STableFooter.vue +115 -0
- package/lib/components/STableHeader.vue +74 -0
- package/lib/components/STableItem.vue +38 -0
- package/lib/components/STooltip.vue +112 -0
- package/lib/composables/Dropdown.ts +40 -99
- package/lib/composables/Form.ts +21 -18
- package/lib/composables/Grid.ts +117 -0
- package/lib/composables/Markdown.ts +138 -0
- package/lib/composables/Step.ts +7 -0
- package/lib/composables/Table.ts +103 -0
- package/lib/composables/Tooltip.ts +91 -0
- package/lib/composables/Validation.ts +5 -9
- package/lib/composables/markdown/LinkPlugin.ts +45 -0
- package/lib/mixins/Sheet.ts +5 -3
- package/lib/stores/Snackbars.ts +48 -0
- package/lib/{assets/styles → styles}/base.css +0 -0
- package/lib/{assets/styles → styles}/bootstrap.css +1 -0
- package/lib/{assets/styles → styles}/variables.css +55 -48
- package/lib/support/Day.ts +8 -0
- package/lib/support/Num.ts +3 -0
- package/lib/support/Time.ts +5 -2
- package/lib/support/Utils.ts +4 -3
- package/lib/types/shims.d.ts +3 -0
- package/lib/validation/validators/requiredYmd.ts +1 -1
- package/lib/validation/validators/ymd.ts +4 -4
- package/package.json +59 -37
- package/CHANGELOG.md +0 -47
- package/lib/.DS_Store +0 -0
- package/lib/components/.DS_Store +0 -0
- package/lib/components/SDialog.vue +0 -140
- package/lib/components/SDropdownItem.vue +0 -78
- package/lib/components/SDropdownItemText.vue +0 -22
- package/lib/components/SDropdownItemUser.vue +0 -40
- package/lib/components/SInputDropdownItemTextTag.vue +0 -94
- package/lib/components/SInputDropdownItemUser.vue +0 -41
- package/lib/components/SInputDropdownItemUserTag.vue +0 -100
- package/lib/components/SPortalModals.vue +0 -74
- package/lib/components/icons/.DS_Store +0 -0
- package/lib/components/icons/SIconActivity.vue +0 -5
- package/lib/components/icons/SIconArrowDown.vue +0 -5
- package/lib/components/icons/SIconArrowLeft.vue +0 -5
- package/lib/components/icons/SIconArrowRight.vue +0 -5
- package/lib/components/icons/SIconArrowUp.vue +0 -5
- package/lib/components/icons/SIconBarChart.vue +0 -7
- package/lib/components/icons/SIconBriefcase.vue +0 -5
- package/lib/components/icons/SIconBuilding.vue +0 -5
- package/lib/components/icons/SIconCalendar.vue +0 -5
- package/lib/components/icons/SIconCheck.vue +0 -5
- package/lib/components/icons/SIconCheckCircle.vue +0 -6
- package/lib/components/icons/SIconCheckCircleThin.vue +0 -6
- package/lib/components/icons/SIconCheckSquare.vue +0 -6
- package/lib/components/icons/SIconChevronDown.vue +0 -5
- package/lib/components/icons/SIconChevronLeft.vue +0 -5
- package/lib/components/icons/SIconChevronRight.vue +0 -5
- package/lib/components/icons/SIconChevronUp.vue +0 -5
- package/lib/components/icons/SIconClock.vue +0 -6
- package/lib/components/icons/SIconCode.vue +0 -6
- package/lib/components/icons/SIconDatabase.vue +0 -5
- package/lib/components/icons/SIconDollarSign.vue +0 -5
- package/lib/components/icons/SIconDownload.vue +0 -6
- package/lib/components/icons/SIconDownloadCloud.vue +0 -6
- package/lib/components/icons/SIconEdit.vue +0 -6
- package/lib/components/icons/SIconEdit2.vue +0 -5
- package/lib/components/icons/SIconEdit3.vue +0 -6
- package/lib/components/icons/SIconEdit3Off.vue +0 -6
- package/lib/components/icons/SIconExternalLink.vue +0 -6
- package/lib/components/icons/SIconEye.vue +0 -6
- package/lib/components/icons/SIconFile.vue +0 -5
- package/lib/components/icons/SIconFilePlus.vue +0 -6
- package/lib/components/icons/SIconFileText.vue +0 -8
- package/lib/components/icons/SIconFlag.vue +0 -5
- package/lib/components/icons/SIconGitBranch.vue +0 -5
- package/lib/components/icons/SIconGitCommit.vue +0 -5
- package/lib/components/icons/SIconGitPullRequest.vue +0 -6
- package/lib/components/icons/SIconGlobe.vue +0 -5
- package/lib/components/icons/SIconGrab.vue +0 -10
- package/lib/components/icons/SIconGrid.vue +0 -8
- package/lib/components/icons/SIconHome.vue +0 -5
- package/lib/components/icons/SIconImage.vue +0 -6
- package/lib/components/icons/SIconInbox.vue +0 -5
- package/lib/components/icons/SIconInfo.vue +0 -7
- package/lib/components/icons/SIconLayout.vue +0 -5
- package/lib/components/icons/SIconList.vue +0 -10
- package/lib/components/icons/SIconLock.vue +0 -5
- package/lib/components/icons/SIconLogout.vue +0 -6
- package/lib/components/icons/SIconMail.vue +0 -6
- package/lib/components/icons/SIconMapPin.vue +0 -6
- package/lib/components/icons/SIconMoon.vue +0 -5
- package/lib/components/icons/SIconMoreHorizontal.vue +0 -7
- package/lib/components/icons/SIconMoreVertical.vue +0 -7
- package/lib/components/icons/SIconPauseFill.vue +0 -6
- package/lib/components/icons/SIconPlayCircle.vue +0 -6
- package/lib/components/icons/SIconPlayFill.vue +0 -5
- package/lib/components/icons/SIconPlus.vue +0 -5
- package/lib/components/icons/SIconPlusCircle.vue +0 -8
- package/lib/components/icons/SIconPlusOff.vue +0 -7
- package/lib/components/icons/SIconPreloaderDark.vue +0 -52
- package/lib/components/icons/SIconPreloaderLight.vue +0 -52
- package/lib/components/icons/SIconProgress.vue +0 -5
- package/lib/components/icons/SIconRadio.vue +0 -6
- package/lib/components/icons/SIconSave.vue +0 -5
- package/lib/components/icons/SIconSearch.vue +0 -5
- package/lib/components/icons/SIconSend.vue +0 -5
- package/lib/components/icons/SIconSettings.vue +0 -6
- package/lib/components/icons/SIconShare2.vue +0 -5
- package/lib/components/icons/SIconSkipBackFill.vue +0 -6
- package/lib/components/icons/SIconSliders.vue +0 -12
- package/lib/components/icons/SIconSun.vue +0 -13
- package/lib/components/icons/SIconTelescope.vue +0 -5
- package/lib/components/icons/SIconTrash.vue +0 -5
- package/lib/components/icons/SIconTrash2.vue +0 -7
- package/lib/components/icons/SIconTrash2Off.vue +0 -6
- package/lib/components/icons/SIconTrello.vue +0 -7
- package/lib/components/icons/SIconUser.vue +0 -6
- package/lib/components/icons/SIconUsers.vue +0 -8
- package/lib/components/icons/SIconWarning.vue +0 -7
- package/lib/components/icons/SIconX.vue +0 -5
- package/lib/components/icons/SIconXCircle.vue +0 -6
- package/lib/components/icons/SIconXCircleThin.vue +0 -6
- package/lib/components/icons/SIconXSquare.vue +0 -6
- package/lib/components/icons/SIconZap.vue +0 -5
- package/lib/composables/Dialog.ts +0 -38
- package/lib/composables/Modal.ts +0 -34
- package/lib/composables/Snackbar.ts +0 -18
- package/lib/store/Sefirot.ts +0 -17
- package/lib/store/dialog/index.ts +0 -42
- package/lib/store/modal/index.ts +0 -61
- package/lib/store/snackbars/index.ts +0 -70
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Ref, ToRefs } from 'vue'
|
|
2
1
|
import {
|
|
3
2
|
Validation,
|
|
4
3
|
ValidationArgs,
|
|
@@ -6,6 +5,7 @@ import {
|
|
|
6
5
|
ErrorObject,
|
|
7
6
|
useVuelidate
|
|
8
7
|
} from '@vuelidate/core'
|
|
8
|
+
import { Ref, ToRefs } from 'vue'
|
|
9
9
|
|
|
10
10
|
export type { Validation, ValidationArgs, GlobalConfig }
|
|
11
11
|
|
|
@@ -16,17 +16,13 @@ export interface Validatable {
|
|
|
16
16
|
readonly $touch: () => void
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export interface ValidationNotification {
|
|
20
|
-
notify(): Promise<boolean>
|
|
21
|
-
}
|
|
22
|
-
|
|
23
19
|
export function useValidation<
|
|
24
|
-
T extends { [key in keyof
|
|
25
|
-
|
|
20
|
+
T extends { [key in keyof R]: any },
|
|
21
|
+
R extends ValidationArgs = ValidationArgs
|
|
26
22
|
>(
|
|
27
23
|
state: T | Ref<T> | ToRefs<T>,
|
|
28
|
-
rules: Ref<
|
|
24
|
+
rules: Ref<R> | R,
|
|
29
25
|
config?: GlobalConfig
|
|
30
|
-
): Ref<Validation<
|
|
26
|
+
): Ref<Validation<R, T>> {
|
|
31
27
|
return useVuelidate(rules, state, config)
|
|
32
28
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import MarkdownIt from 'markdown-it'
|
|
2
|
+
|
|
3
|
+
export type LinkAttrs = Record<string, string>
|
|
4
|
+
|
|
5
|
+
const EXTERNAL_REGEX = /^https?:/
|
|
6
|
+
const CALLBACK_REGEX = /\{([\d}]+)\}/
|
|
7
|
+
const CALLBACK_HREF = '#callback'
|
|
8
|
+
|
|
9
|
+
export function linkPlugin(md: MarkdownIt, linkAttrs: LinkAttrs = {}): void {
|
|
10
|
+
md.renderer.rules.link_open = (tokens, idx, options, _env, self) => {
|
|
11
|
+
const token = tokens[idx]
|
|
12
|
+
const hrefIndex = token.attrIndex('href')
|
|
13
|
+
|
|
14
|
+
if (hrefIndex >= 0) {
|
|
15
|
+
const hrefAttr = token.attrs![hrefIndex]
|
|
16
|
+
const url = decodeURIComponent(hrefAttr[1])
|
|
17
|
+
|
|
18
|
+
if (isExternalUrl(url)) {
|
|
19
|
+
Object.entries(linkAttrs).forEach(([key, val]) => {
|
|
20
|
+
token.attrSet(key, val)
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (isCallbackUrl(url)) {
|
|
25
|
+
const matched = url.match(CALLBACK_REGEX)![1]
|
|
26
|
+
|
|
27
|
+
token.attrSet('data-callback-id', matched)
|
|
28
|
+
|
|
29
|
+
hrefAttr[1] = CALLBACK_HREF
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
token.attrSet('class', 'SMarkdown-link')
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return self.renderToken(tokens, idx, options)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function isExternalUrl(url: string): boolean {
|
|
40
|
+
return EXTERNAL_REGEX.test(url)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function isCallbackUrl(url: string): boolean {
|
|
44
|
+
return url === CALLBACK_HREF || CALLBACK_REGEX.test(decodeURIComponent(url))
|
|
45
|
+
}
|
package/lib/mixins/Sheet.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { App } from 'vue'
|
|
2
2
|
import SSheet from '../components/SSheet.vue'
|
|
3
|
-
import SSheetTitle from '../components/SSheetTitle.vue'
|
|
4
|
-
import SSheetMedium from '../components/SSheetMedium.vue'
|
|
5
3
|
import SSheetFooter from '../components/SSheetFooter.vue'
|
|
6
|
-
import SSheetFooterActions from '../components/SSheetFooterActions.vue'
|
|
7
4
|
import SSheetFooterAction from '../components/SSheetFooterAction.vue'
|
|
5
|
+
import SSheetFooterActions from '../components/SSheetFooterActions.vue'
|
|
6
|
+
import SSheetForm from '../components/SSheetForm.vue'
|
|
7
|
+
import SSheetMedium from '../components/SSheetMedium.vue'
|
|
8
|
+
import SSheetTitle from '../components/SSheetTitle.vue'
|
|
8
9
|
|
|
9
10
|
export function mixin(app: App): void {
|
|
10
11
|
app.mixin({
|
|
@@ -12,6 +13,7 @@ export function mixin(app: App): void {
|
|
|
12
13
|
SSheet,
|
|
13
14
|
SSheetTitle,
|
|
14
15
|
SSheetMedium,
|
|
16
|
+
SSheetForm,
|
|
15
17
|
SSheetFooter,
|
|
16
18
|
SSheetFooterActions,
|
|
17
19
|
SSheetFooterAction
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineStore } from 'pinia'
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
export interface Snackbar {
|
|
5
|
+
text: string
|
|
6
|
+
mode?: 'neutral' | 'info' | 'warning' | 'danger'
|
|
7
|
+
actions?: SnackbarAction[]
|
|
8
|
+
timeout?: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface SnackbarWithId extends Snackbar {
|
|
12
|
+
id: number
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface SnackbarAction {
|
|
16
|
+
label: string
|
|
17
|
+
onClick(): void
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const useSnackbars = defineStore('snackbars', () => {
|
|
21
|
+
const maxItemSize = 4
|
|
22
|
+
|
|
23
|
+
let nextId = 0
|
|
24
|
+
|
|
25
|
+
const items = ref<SnackbarWithId[]>([])
|
|
26
|
+
|
|
27
|
+
function push(snackbar: Snackbar): void {
|
|
28
|
+
if (items.value.length > maxItemSize) {
|
|
29
|
+
items.value.shift()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const id = nextId++
|
|
33
|
+
|
|
34
|
+
items.value.push({ id, ...snackbar })
|
|
35
|
+
|
|
36
|
+
setTimeout(() => { pop(id) }, snackbar.timeout ?? 10000)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function pop(id: number): void {
|
|
40
|
+
items.value = items.value.filter(item => item.id !== id)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
items,
|
|
45
|
+
push,
|
|
46
|
+
pop
|
|
47
|
+
}
|
|
48
|
+
})
|
|
File without changes
|
|
@@ -11,16 +11,19 @@
|
|
|
11
11
|
--c-white-soft: #fafafa;
|
|
12
12
|
--c-white-mute: #f2f2f2;
|
|
13
13
|
|
|
14
|
+
--c-white-elv: #fafafa;
|
|
15
|
+
--c-white-elv-up: #ffffff;
|
|
16
|
+
--c-white-elv-down: #f2f2f2;
|
|
17
|
+
|
|
14
18
|
--c-black: #000000;
|
|
15
|
-
--c-black-
|
|
16
|
-
--c-black-
|
|
17
|
-
--c-black-mute: #2c2c2e;
|
|
19
|
+
--c-black-soft: #171717;
|
|
20
|
+
--c-black-mute: #1c1c1e;
|
|
18
21
|
|
|
19
|
-
--c-black-
|
|
20
|
-
--c-black-
|
|
21
|
-
--c-black-
|
|
22
|
+
--c-black-elv: #171717;
|
|
23
|
+
--c-black-elv-up: #1c1c1e;
|
|
24
|
+
--c-black-elv-down: #000000;
|
|
22
25
|
|
|
23
|
-
--c-gray: #
|
|
26
|
+
--c-gray: #8e8e93;
|
|
24
27
|
|
|
25
28
|
--c-gray-dark-1: #636366;
|
|
26
29
|
--c-gray-dark-2: #48484a;
|
|
@@ -55,25 +58,28 @@
|
|
|
55
58
|
--c-info-lighter: #50a2ff;
|
|
56
59
|
--c-info-dark: #3468a3;
|
|
57
60
|
--c-info-darker: #255489;
|
|
61
|
+
--c-info-bg: rgba(59, 142, 237, 0.1);
|
|
58
62
|
|
|
59
63
|
--c-success: #00b489;
|
|
60
64
|
--c-success-light: #0fcea0;
|
|
61
65
|
--c-success-lighter: #27e8ba;
|
|
62
66
|
--c-success-dark: #068f6e;
|
|
63
67
|
--c-success-darker: #086b53;
|
|
68
|
+
--c-success-bg: rgba(0, 180, 137, 0.1);
|
|
64
69
|
|
|
65
|
-
--c-warning: #
|
|
70
|
+
--c-warning: #f0ba17;
|
|
66
71
|
--c-warning-light: #ffe417;
|
|
67
72
|
--c-warning-lighter: #ffff17;
|
|
68
73
|
--c-warning-dark: #e0ad15;
|
|
69
74
|
--c-warning-darker: #bc9112;
|
|
70
|
-
--c-warning-bg: rgba(255, 197, 23, .1);
|
|
75
|
+
--c-warning-bg: rgba(255, 197, 23, 0.1);
|
|
71
76
|
|
|
72
77
|
--c-danger: #ed3c50;
|
|
73
78
|
--c-danger-light: #f43771;
|
|
74
79
|
--c-danger-lighter: #fd1d7c;
|
|
75
80
|
--c-danger-dark: #cd2d3f;
|
|
76
81
|
--c-danger-darker: #ab2131;
|
|
82
|
+
--c-danger-bg: rgba(237, 60, 80, 0.1);
|
|
77
83
|
|
|
78
84
|
--c-alternative: #de41e0;
|
|
79
85
|
--c-alternative-light: #e936eb;
|
|
@@ -91,6 +97,10 @@
|
|
|
91
97
|
--c-bg-soft: var(--c-white-soft);
|
|
92
98
|
--c-bg-mute: var(--c-white-mute);
|
|
93
99
|
|
|
100
|
+
--c-bg-elv: var(--c-white-elv);
|
|
101
|
+
--c-bg-elv-up: var(--c-white-elv-up);
|
|
102
|
+
--c-bg-elv-down: var(--c-white-elv-down);
|
|
103
|
+
|
|
94
104
|
--c-divider: var(--c-divider-light-1);
|
|
95
105
|
--c-divider-light: var(--c-divider-light-2);
|
|
96
106
|
|
|
@@ -106,10 +116,14 @@
|
|
|
106
116
|
}
|
|
107
117
|
|
|
108
118
|
.dark {
|
|
109
|
-
--c-bg: var(--c-black
|
|
119
|
+
--c-bg: var(--c-black);
|
|
110
120
|
--c-bg-soft: var(--c-black-soft);
|
|
111
121
|
--c-bg-mute: var(--c-black-mute);
|
|
112
122
|
|
|
123
|
+
--c-bg-elv: var(--c-black-elv);
|
|
124
|
+
--c-bg-elv-up: var(--c-black-elv-up);
|
|
125
|
+
--c-bg-elv-down: var(--c-black-elv-down);
|
|
126
|
+
|
|
113
127
|
--c-divider: var(--c-divider-dark-1);
|
|
114
128
|
--c-divider-light: var(--c-divider-dark-2);
|
|
115
129
|
|
|
@@ -129,7 +143,8 @@
|
|
|
129
143
|
* -------------------------------------------------------------------------- */
|
|
130
144
|
|
|
131
145
|
:root {
|
|
132
|
-
--font-family-base: "
|
|
146
|
+
--font-family-base: "Inter", "Noto Sans JP", "-apple-system", "BlinkMacSystemFont", "Roboto", "Segoe UI", "Helvetica Neue", "Arial", "sans-serif";
|
|
147
|
+
--font-family-number: "Roboto", "Noto Sans JP", "-apple-system", "BlinkMacSystemFont", "Roboto", "Segoe UI", "Helvetica Neue", "Arial", "sans-serif";
|
|
133
148
|
--font-family-mono: "source-code-pro", "Menlo", "Monaco", "Consolas", "Courier New", monospace;
|
|
134
149
|
}
|
|
135
150
|
|
|
@@ -188,6 +203,21 @@
|
|
|
188
203
|
* -------------------------------------------------------------------------- */
|
|
189
204
|
|
|
190
205
|
:root {
|
|
206
|
+
--button-fill-text: var(--c-text-inverse-1);
|
|
207
|
+
--button-fill-bg: var(--c-black);
|
|
208
|
+
--button-fill-bg-hover: var(--c-gray-dark-4);
|
|
209
|
+
--button-fill-bg-focus: var(--c-gray-dark-3);
|
|
210
|
+
|
|
211
|
+
--button-outline-text: var(--c-text-1);
|
|
212
|
+
--button-outline-border: var(--c-black);
|
|
213
|
+
--button-outline-bg-hover: var(--c-white-mute);
|
|
214
|
+
--button-outline-bg-focus: var(--c-gray-light-4);
|
|
215
|
+
|
|
216
|
+
--button-text-text: var(--c-text-1);
|
|
217
|
+
--button-text-bg-hover: var(--c-white-mute);
|
|
218
|
+
--button-text-bg-focus: var(--c-gray-light-4);
|
|
219
|
+
|
|
220
|
+
/* Deprecated */
|
|
191
221
|
--button-primary-text: var(--c-text-inverse-1);
|
|
192
222
|
--button-primary-bg: var(--c-black);
|
|
193
223
|
--button-primary-bg-hover: var(--c-gray-dark-4);
|
|
@@ -234,6 +264,20 @@
|
|
|
234
264
|
}
|
|
235
265
|
|
|
236
266
|
.dark {
|
|
267
|
+
--button-fill-text: var(--c-text-inverse-1);
|
|
268
|
+
--button-fill-bg: var(--c-white);
|
|
269
|
+
--button-fill-bg-hover: var(--c-gray-light-3);
|
|
270
|
+
--button-fill-bg-focus: var(--c-gray-light-1);
|
|
271
|
+
|
|
272
|
+
--button-outline-border: var(--c-white);
|
|
273
|
+
--button-outline-bg-hover: var(--c-black-mute);
|
|
274
|
+
--button-outline-bg-focus: var(--c-gray-dark-3);
|
|
275
|
+
|
|
276
|
+
--button-text-text: var(--c-text-1);
|
|
277
|
+
--button-text-bg-hover: var(--c-gray-dark-4);
|
|
278
|
+
--button-text-bg-focus: var(--c-bg-soft);
|
|
279
|
+
|
|
280
|
+
/* Deprecated */
|
|
237
281
|
--button-primary-text: var(--c-text-inverse-1);
|
|
238
282
|
--button-primary-bg: var(--c-white);
|
|
239
283
|
--button-primary-bg-hover: var(--c-gray-light-3);
|
|
@@ -260,14 +304,6 @@
|
|
|
260
304
|
--button-tertiary-inverse-bg-hover: var(--c-gray-dark-3);
|
|
261
305
|
--button-tertiary-inverse-bg-focus: var(--c-gray-dark-2);
|
|
262
306
|
|
|
263
|
-
--button-text-text: var(--c-text-1);
|
|
264
|
-
--button-text-bg-hover: var(--c-black-mute);
|
|
265
|
-
--button-text-bg-focus: var(--c-gray-dark-3);
|
|
266
|
-
--button-text-inverse-text: var(--c-text-inverse-1);
|
|
267
|
-
--button-text-inverse-bg: var(--c-black-mute);
|
|
268
|
-
--button-text-inverse-bg-hover: var(--c-gray-dark-3);
|
|
269
|
-
--button-text-inverse-bg-focus: var(--c-gray-dark-2);
|
|
270
|
-
|
|
271
307
|
--button-mute-text: var(--c-text-2);
|
|
272
308
|
--button-mute-text-hover: var(--c-text-1);
|
|
273
309
|
--button-mute-bg-hover: var(--c-black-mute);
|
|
@@ -278,35 +314,6 @@
|
|
|
278
314
|
--button-mute-inverse-bg-focus: var(--c-gray-dark-2);
|
|
279
315
|
}
|
|
280
316
|
|
|
281
|
-
/**
|
|
282
|
-
* Component: Inputs
|
|
283
|
-
* -------------------------------------------------------------------------- */
|
|
284
|
-
|
|
285
|
-
:root {
|
|
286
|
-
--input-label: var(--c-text-1);
|
|
287
|
-
--input-note: var(--c-text-2);
|
|
288
|
-
--input-text: var(--c-text-1);
|
|
289
|
-
--input-placeholder: var(--c-text-3);
|
|
290
|
-
--input-help: var(--c-text-2);
|
|
291
|
-
|
|
292
|
-
--input-border: var(--c-divider);
|
|
293
|
-
|
|
294
|
-
--input-hover-border: var(--c-black);
|
|
295
|
-
|
|
296
|
-
--input-focus-border: var(--c-black);
|
|
297
|
-
--input-focus-bg: var(--c-white);
|
|
298
|
-
|
|
299
|
-
--input-disabled-bg: var(--c-white-mute);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.dark {
|
|
303
|
-
--input-hover-border: var(--c-gray);
|
|
304
|
-
|
|
305
|
-
--input-focus-border: var(--c-gray);
|
|
306
|
-
|
|
307
|
-
--input-disabled-bg: var(--c-black-mute);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
317
|
/**
|
|
311
318
|
* Component: Dropdown
|
|
312
319
|
* -------------------------------------------------------------------------- */
|
package/lib/support/Time.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
type Awaited<T> = T extends undefined ? T : T extends PromiseLike<infer U> ? U : T
|
|
2
2
|
|
|
3
|
-
export function sleep(ms
|
|
3
|
+
export function sleep(ms = 500): Promise<undefined> {
|
|
4
4
|
return new Promise<undefined>(resolve => setTimeout(resolve, ms))
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export function delay<T extends any[]>(
|
|
7
|
+
export function delay<T extends any[]>(
|
|
8
|
+
iterable: T,
|
|
9
|
+
ms?: number
|
|
10
|
+
): Promise<{ [P in keyof T]: Awaited<T[P]> }> {
|
|
8
11
|
return Promise.all([...iterable, sleep(ms)]) as any
|
|
9
12
|
}
|
package/lib/support/Utils.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export { default as isEqual } from 'lodash-es/isEqual'
|
|
2
|
-
export { default as cloneDeep } from 'lodash-es/cloneDeep'
|
|
3
|
-
|
|
4
1
|
export function isNullish(value: unknown): value is undefined | null {
|
|
5
2
|
return value === null || value === undefined
|
|
6
3
|
}
|
|
@@ -9,6 +6,10 @@ export function isString(value: unknown): value is string {
|
|
|
9
6
|
return typeof value === 'string'
|
|
10
7
|
}
|
|
11
8
|
|
|
9
|
+
export function isNumber(value: unknown): value is number {
|
|
10
|
+
return typeof value === 'number'
|
|
11
|
+
}
|
|
12
|
+
|
|
12
13
|
export function isArray(value: unknown): value is unknown[] {
|
|
13
14
|
return Array.isArray(value)
|
|
14
15
|
}
|
|
@@ -3,5 +3,5 @@ import { Ymd, YmdType, YmdMap } from './ymd'
|
|
|
3
3
|
export type { Ymd, YmdType, YmdMap }
|
|
4
4
|
|
|
5
5
|
export function requiredYmd(ymd: Ymd, required: YmdType[] = ['y', 'm', 'd']): boolean {
|
|
6
|
-
return required.every(r => ymd[YmdMap[r]] !==
|
|
6
|
+
return required.every(r => ymd[YmdMap[r]] !== null)
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import day from 'dayjs'
|
|
2
2
|
|
|
3
3
|
export interface Ymd {
|
|
4
|
-
year
|
|
5
|
-
month
|
|
6
|
-
date
|
|
4
|
+
year: number | null
|
|
5
|
+
month: number | null
|
|
6
|
+
date: number | null
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export type YmdType = 'y' | 'm' | 'd'
|
|
@@ -18,7 +18,7 @@ export function ymd(ymd: Ymd, required: YmdType[] = ['y', 'm', 'd']): boolean {
|
|
|
18
18
|
return required.every((r) => {
|
|
19
19
|
const value = ymd[YmdMap[r]]
|
|
20
20
|
|
|
21
|
-
if (value ===
|
|
21
|
+
if (value === null) {
|
|
22
22
|
return true
|
|
23
23
|
}
|
|
24
24
|
|
package/package.json
CHANGED
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@globalbrain/sefirot",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Vue Components for Global Brain Design System.",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib"
|
|
7
7
|
],
|
|
8
|
-
"scripts": {
|
|
9
|
-
"type": "vue-tsc --noEmit",
|
|
10
|
-
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix './{lib,tests}/**/*.{ts,vue}'",
|
|
11
|
-
"lint:fail": "eslint --ext .js,.vue --ignore-path .gitignore './{lib,tests}/**/*.{ts,vue}'",
|
|
12
|
-
"vitest": "vitest",
|
|
13
|
-
"coverage": "vitest run --coverage",
|
|
14
|
-
"test": "yarn type && yarn lint && yarn coverage",
|
|
15
|
-
"test:fail": "yarn type && yarn lint:fail && yarn coverage",
|
|
16
|
-
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
17
|
-
"release": "node scripts/release.js"
|
|
18
|
-
},
|
|
19
8
|
"repository": {
|
|
20
9
|
"type": "git",
|
|
21
10
|
"url": "git@github.com:globalbrain/sefirot.git"
|
|
@@ -31,52 +20,85 @@
|
|
|
31
20
|
"url": "https://github.com/globalbrain/sefirot/issues"
|
|
32
21
|
},
|
|
33
22
|
"peerDependencies": {
|
|
23
|
+
"@iconify-icons/ph": "^1.2.2",
|
|
24
|
+
"@iconify/vue": "^4.0.0",
|
|
34
25
|
"@types/body-scroll-lock": "^3.1.0",
|
|
35
26
|
"@types/lodash-es": "^4.17.6",
|
|
36
27
|
"@vuelidate/core": "^2.0.0-alpha.38",
|
|
37
28
|
"@vuelidate/validators": "^2.0.0-alpha.28",
|
|
29
|
+
"@vueuse/core": "^9.1.0",
|
|
38
30
|
"body-scroll-lock": "^4.0.0-beta.0",
|
|
39
31
|
"dayjs": "^1.11.0",
|
|
40
32
|
"fuse.js": "^6.5.3",
|
|
41
33
|
"lodash-es": "^4.17.21",
|
|
42
34
|
"normalize.css": "^8.0.1",
|
|
35
|
+
"pinia": "^2.0.22",
|
|
43
36
|
"postcss": "^8.4.12",
|
|
44
37
|
"postcss-nested": "^5.0.6",
|
|
45
|
-
"typescript": "^4.
|
|
38
|
+
"typescript": "^4.7.4",
|
|
39
|
+
"v-calendar": "^3.0.0-alpha.8",
|
|
46
40
|
"vue": "^3.2.31",
|
|
47
|
-
"vue-router": "^4.0.14"
|
|
48
|
-
"vuex": "^4.0.2"
|
|
41
|
+
"vue-router": "^4.0.14"
|
|
49
42
|
},
|
|
50
43
|
"devDependencies": {
|
|
51
|
-
"@
|
|
44
|
+
"@histoire/plugin-vue": "^0.10.7",
|
|
45
|
+
"@iconify-icons/ph": "^1.2.2",
|
|
46
|
+
"@iconify/vue": "^4.0.0",
|
|
52
47
|
"@types/body-scroll-lock": "^3.1.0",
|
|
53
48
|
"@types/lodash-es": "^4.17.6",
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
49
|
+
"@types/markdown-it": "^12.2.3",
|
|
50
|
+
"@types/node": "^18.7.18",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^5.38.0",
|
|
52
|
+
"@typescript-eslint/parser": "^5.38.0",
|
|
53
|
+
"@vitejs/plugin-vue": "^3.1.0",
|
|
54
|
+
"@vitest/coverage-c8": "^0.23.4",
|
|
55
|
+
"@vue/test-utils": "^2.0.2",
|
|
56
|
+
"@vuelidate/core": "^2.0.0-alpha.44",
|
|
57
|
+
"@vuelidate/validators": "^2.0.0-alpha.31",
|
|
58
|
+
"@vueuse/core": "^9.2.0",
|
|
59
59
|
"body-scroll-lock": "^4.0.0-beta.0",
|
|
60
|
-
"
|
|
61
|
-
"codecov": "^3.8.3",
|
|
60
|
+
"chalk": "^4.1.2",
|
|
62
61
|
"conventional-changelog-cli": "^2.2.2",
|
|
63
|
-
"dayjs": "^1.11.
|
|
62
|
+
"dayjs": "^1.11.5",
|
|
64
63
|
"enquirer": "^2.3.6",
|
|
65
|
-
"eslint": "^8.
|
|
66
|
-
"eslint-plugin-
|
|
64
|
+
"eslint": "^8.23.1",
|
|
65
|
+
"eslint-plugin-import": "^2.26.0",
|
|
66
|
+
"eslint-plugin-vue": "^9.5.1",
|
|
67
67
|
"execa": "^5.1.1",
|
|
68
|
-
"fuse.js": "^6.
|
|
69
|
-
"happy-dom": "^
|
|
68
|
+
"fuse.js": "^6.6.2",
|
|
69
|
+
"happy-dom": "^6.0.4",
|
|
70
|
+
"histoire": "^0.10.7",
|
|
70
71
|
"lodash-es": "^4.17.21",
|
|
72
|
+
"markdown-it": "^13.0.1",
|
|
71
73
|
"normalize.css": "^8.0.1",
|
|
72
|
-
"
|
|
74
|
+
"pinia": "^2.0.22",
|
|
75
|
+
"postcss": "^8.4.16",
|
|
73
76
|
"postcss-nested": "^5.0.6",
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
77
|
+
"semver": "^7.3.7",
|
|
78
|
+
"typescript": "^4.8.3",
|
|
79
|
+
"v-calendar": "3.0.0-alpha.8",
|
|
80
|
+
"vite": "^3.1.3",
|
|
81
|
+
"vitepress": "1.0.0-alpha.15",
|
|
82
|
+
"vitest": "^0.23.4",
|
|
83
|
+
"vue": "^3.2.39",
|
|
84
|
+
"vue-router": "^4.1.5",
|
|
85
|
+
"vue-tsc": "^0.40.13"
|
|
86
|
+
},
|
|
87
|
+
"scripts": {
|
|
88
|
+
"docs": "vitepress dev docs --port 3000",
|
|
89
|
+
"docs:build": "vitepress build docs",
|
|
90
|
+
"docs:preview": "vitepress serve docs --port 3000",
|
|
91
|
+
"story": "histoire dev --port 3000",
|
|
92
|
+
"story:build": "histoire build",
|
|
93
|
+
"story:preview": "histoire preview --port 3000",
|
|
94
|
+
"type": "vue-tsc --noEmit",
|
|
95
|
+
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix './{lib,tests}/**/*.{ts,vue}'",
|
|
96
|
+
"lint:fail": "eslint --ext .js,.vue --ignore-path .gitignore './{lib,tests}/**/*.{ts,vue}'",
|
|
97
|
+
"vitest": "vitest",
|
|
98
|
+
"coverage": "vitest run --coverage",
|
|
99
|
+
"test": "pnpm run type && pnpm run lint && pnpm run coverage",
|
|
100
|
+
"test:fail": "pnpm run type && pnpm run lint:fail && pnpm run coverage",
|
|
101
|
+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
102
|
+
"release": "node scripts/release.js"
|
|
81
103
|
}
|
|
82
|
-
}
|
|
104
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# [2.0.0-draft.8](https://github.com/globalbrain/sefirot/compare/v2.0.0-draft.7...v2.0.0-draft.8) (2022-04-21)
|
|
2
|
-
|
|
3
|
-
### Features
|
|
4
|
-
|
|
5
|
-
* **validation:** update types
|
|
6
|
-
|
|
7
|
-
# [2.0.0-draft.7](https://github.com/globalbrain/sefirot/compare/v2.0.0-draft.6...v2.0.0-draft.7) (2022-02-21)
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* **validation:** vuelidate import ([1c2e547](https://github.com/globalbrain/sefirot/commit/1c2e547d2ef5fa31ab36ba65882c54085cc4a991))
|
|
12
|
-
|
|
13
|
-
# [2.0.0-draft.6](https://github.com/globalbrain/sefirot/compare/v2.0.0-draft.5...v2.0.0-draft.6) (2022-02-21)
|
|
14
|
-
|
|
15
|
-
### Features
|
|
16
|
-
|
|
17
|
-
* **input-select:** add SInputSelect component ([1d0608e](https://github.com/globalbrain/sefirot/commit/1d0608e8aaa3f7007bb4aff18255ce2b528a7d76))
|
|
18
|
-
* **validation:** add custom error message support ([acb0894](https://github.com/globalbrain/sefirot/commit/acb0894ec5fdcc052100e3623525fbf030854a2f))
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
# [2.0.0-draft.5](https://github.com/globalbrain/sefirot/compare/v2.0.0-draft.4...v2.0.0-draft.5) (2022-02-16)
|
|
22
|
-
|
|
23
|
-
### Features
|
|
24
|
-
|
|
25
|
-
* **icon:** add a mail icon ([#115](https://github.com/globalbrain/sefirot/issues/115)) ([b3c24a7](https://github.com/globalbrain/sefirot/commit/b3c24a7602936fcba3fdc5ea51a8600adb15ec2c))
|
|
26
|
-
|
|
27
|
-
# [2.0.0-draft.4](https://github.com/globalbrain/sefirot/compare/v2.0.0-draft.3...v2.0.0-draft.4) (2021-12-22)
|
|
28
|
-
|
|
29
|
-
### Features
|
|
30
|
-
|
|
31
|
-
* refactor modals ([36d0d1e](https://github.com/globalbrain/sefirot/commit/36d0d1e7747935aff4d909d4023751002875d6c8))
|
|
32
|
-
|
|
33
|
-
# [2.0.0-draft.3](https://github.com/globalbrain/sefirot/compare/v2.0.0-draft.2...v2.0.0-draft.3) (2021-12-17)
|
|
34
|
-
|
|
35
|
-
### Features
|
|
36
|
-
|
|
37
|
-
* **input-text:** emit "enter" and "blur" event ([a7b2b38](https://github.com/globalbrain/sefirot/commit/a7b2b38dc5f4880e7b680601be6e607d9b180c68))
|
|
38
|
-
|
|
39
|
-
# [2.0.0-draft.2](https://github.com/globalbrain/sefirot/compare/v2.0.0-draft.1...v2.0.0-draft.2) (2021-12-14)
|
|
40
|
-
|
|
41
|
-
### Bug Fixes
|
|
42
|
-
|
|
43
|
-
* **input-number:** emit null when empty is input ([#111](https://github.com/globalbrain/sefirot/issues/111)) ([d417960](https://github.com/globalbrain/sefirot/commit/d417960884b5c3b09c793058b80fcbc17351ecd3))
|
|
44
|
-
|
|
45
|
-
# [2.0.0-draft.1](https://github.com/globalbrain/sefirot/compare/v0.71.0...v2.0.0-draft.1) (2021-12-13)
|
|
46
|
-
|
|
47
|
-
Initial release.
|
package/lib/.DS_Store
DELETED
|
Binary file
|
package/lib/components/.DS_Store
DELETED
|
Binary file
|