@globalbrain/sefirot 2.0.0-draft.7 → 2.0.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.
Files changed (95) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +6 -6
  3. package/lib/components/SAvatar.vue +17 -17
  4. package/lib/components/SButton.vue +512 -267
  5. package/lib/components/SButtonGroup.vue +149 -0
  6. package/lib/components/SDropdown.vue +26 -150
  7. package/lib/components/SDropdownSection.vue +48 -0
  8. package/lib/components/SDropdownSectionFilter.vue +189 -0
  9. package/lib/components/SDropdownSectionFilterItem.vue +21 -0
  10. package/lib/components/SDropdownSectionFilterItemAvatar.vue +31 -0
  11. package/lib/components/SDropdownSectionFilterItemText.vue +20 -0
  12. package/lib/components/SDropdownSectionMenu.vue +39 -0
  13. package/lib/components/SIcon.vue +13 -0
  14. package/lib/components/SInputBase.vue +31 -31
  15. package/lib/components/SInputCheckbox.vue +1 -1
  16. package/lib/components/SInputCheckboxes.vue +74 -0
  17. package/lib/components/SInputDate.vue +182 -0
  18. package/lib/components/SInputDropdown.vue +158 -157
  19. package/lib/components/SInputDropdownItem.vue +46 -48
  20. package/lib/components/{SInputDropdownItemUserTag.vue → SInputDropdownItemAvatar.vue} +43 -44
  21. package/lib/components/SInputDropdownItemText.vue +79 -16
  22. package/lib/components/SInputFile.vue +55 -60
  23. package/lib/components/SInputHMS.vue +120 -110
  24. package/lib/components/SInputNumber.vue +38 -9
  25. package/lib/components/SInputRadio.vue +39 -36
  26. package/lib/components/SInputRadios.vue +40 -53
  27. package/lib/components/SInputSelect.vue +3 -3
  28. package/lib/components/SInputSwitch.vue +193 -0
  29. package/lib/components/SInputSwitches.vue +88 -0
  30. package/lib/components/SInputText.vue +206 -62
  31. package/lib/components/SInputTextarea.vue +46 -32
  32. package/lib/components/SInputYMD.vue +123 -126
  33. package/lib/components/SMarkdown.vue +52 -0
  34. package/lib/components/SModal.vue +25 -63
  35. package/lib/components/SMount.vue +19 -0
  36. package/lib/components/SSheet.vue +49 -55
  37. package/lib/components/SSheetFooter.vue +1 -1
  38. package/lib/components/SSheetFooterAction.vue +24 -17
  39. package/lib/components/SSheetFooterActions.vue +1 -4
  40. package/lib/components/SSheetForm.vue +15 -0
  41. package/lib/components/SSheetMedium.vue +8 -10
  42. package/lib/components/SSheetTitle.vue +7 -14
  43. package/lib/components/SSnackbar.vue +55 -45
  44. package/lib/components/{SPortalSnackbars.vue → SSnackbars.vue} +17 -20
  45. package/lib/components/SStep.vue +106 -0
  46. package/lib/components/SSteps.vue +59 -0
  47. package/lib/components/STable.vue +241 -0
  48. package/lib/components/STableCell.vue +82 -0
  49. package/lib/components/STableCellAvatar.vue +69 -0
  50. package/lib/components/STableCellAvatars.vue +93 -0
  51. package/lib/components/STableCellDay.vue +40 -0
  52. package/lib/components/STableCellPill.vue +84 -0
  53. package/lib/components/STableCellText.vue +102 -0
  54. package/lib/components/STableColumn.vue +255 -0
  55. package/lib/components/STableFooter.vue +115 -0
  56. package/lib/components/STableHeader.vue +74 -0
  57. package/lib/components/STableItem.vue +38 -0
  58. package/lib/components/STooltip.vue +112 -0
  59. package/lib/composables/Dropdown.ts +40 -99
  60. package/lib/composables/Form.ts +21 -18
  61. package/lib/composables/Grid.ts +117 -0
  62. package/lib/composables/Markdown.ts +138 -0
  63. package/lib/composables/Step.ts +7 -0
  64. package/lib/composables/Table.ts +103 -0
  65. package/lib/composables/Tooltip.ts +91 -0
  66. package/lib/composables/Validation.ts +6 -7
  67. package/lib/composables/markdown/LinkPlugin.ts +45 -0
  68. package/lib/mixins/Sheet.ts +5 -3
  69. package/lib/stores/Snackbars.ts +48 -0
  70. package/lib/{assets/styles → styles}/base.css +0 -0
  71. package/lib/{assets/styles → styles}/bootstrap.css +1 -0
  72. package/lib/{assets/styles → styles}/variables.css +55 -48
  73. package/lib/support/Day.ts +8 -0
  74. package/lib/support/Num.ts +3 -0
  75. package/lib/support/Time.ts +5 -2
  76. package/lib/support/Utils.ts +4 -3
  77. package/lib/types/shims.d.ts +3 -0
  78. package/lib/validation/validators/requiredYmd.ts +1 -1
  79. package/lib/validation/validators/ymd.ts +4 -4
  80. package/package.json +62 -43
  81. package/CHANGELOG.md +0 -41
  82. package/lib/components/SDialog.vue +0 -140
  83. package/lib/components/SDropdownItem.vue +0 -78
  84. package/lib/components/SDropdownItemText.vue +0 -22
  85. package/lib/components/SDropdownItemUser.vue +0 -40
  86. package/lib/components/SInputDropdownItemTextTag.vue +0 -94
  87. package/lib/components/SInputDropdownItemUser.vue +0 -41
  88. package/lib/components/SPortalModals.vue +0 -74
  89. package/lib/composables/Dialog.ts +0 -38
  90. package/lib/composables/Modal.ts +0 -34
  91. package/lib/composables/Snackbar.ts +0 -18
  92. package/lib/store/Sefirot.ts +0 -17
  93. package/lib/store/dialog/index.ts +0 -42
  94. package/lib/store/modal/index.ts +0 -61
  95. package/lib/store/snackbars/index.ts +0 -70
@@ -1,70 +0,0 @@
1
- import { ActionTree, ActionContext, MutationTree } from 'vuex'
2
-
3
- let nextId: number = 0
4
-
5
- const maxItemSize: number = 4
6
-
7
- export interface State {
8
- items: SnackbarWithId[]
9
- }
10
-
11
- export interface Snackbar {
12
- text: string
13
- timeout?: number
14
- actions?: Action[]
15
- }
16
-
17
- export interface SnackbarWithId extends Snackbar {
18
- id: number
19
- }
20
-
21
- export interface Action {
22
- type: 'primary' | 'secondary' | 'tertiary' | 'text' | 'mute'
23
- label: string
24
- callback: Function
25
- }
26
-
27
- export function state(): State {
28
- return {
29
- items: []
30
- }
31
- }
32
-
33
- export const actions: ActionTree<State, any> = {
34
- push(context: ActionContext<State, any>, payload: Snackbar): void {
35
- const id = nextId++
36
-
37
- context.commit('push', {
38
- id,
39
- text: payload.text,
40
- actions: payload.actions
41
- })
42
-
43
- setTimeout(() => { context.commit('pop', id) }, payload.timeout ?? 10000)
44
- },
45
-
46
- pop(context: ActionContext<State, any>, id: number): void {
47
- context.commit('pop', id)
48
- }
49
- }
50
-
51
- export const mutations: MutationTree<State> = {
52
- push(state: State, item: SnackbarWithId): void {
53
- if (state.items.length > maxItemSize) {
54
- state.items.shift()
55
- }
56
-
57
- state.items.push(item)
58
- },
59
-
60
- pop(state: State, id: number): void {
61
- state.items = state.items.filter(item => item.id !== id)
62
- }
63
- }
64
-
65
- export default {
66
- namespaced: true,
67
- state,
68
- actions,
69
- mutations
70
- }