@globalbrain/sefirot 0.72.0 → 2.0.0-draft.4

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 (175) hide show
  1. package/CHANGELOG.md +8 -808
  2. package/README.md +1 -1
  3. package/lib/assets/styles/bootstrap.css +1 -2
  4. package/lib/assets/styles/variables.css +14 -47
  5. package/lib/components/SAvatar.vue +9 -18
  6. package/lib/components/SButton.vue +35 -48
  7. package/lib/components/SDialog.vue +16 -34
  8. package/lib/components/SDropdown.vue +36 -55
  9. package/lib/components/SDropdownItem.vue +27 -39
  10. package/lib/components/SDropdownItemText.vue +4 -9
  11. package/lib/components/SDropdownItemUser.vue +4 -12
  12. package/lib/components/SInputBase.vue +33 -45
  13. package/lib/components/SInputCheckbox.vue +17 -37
  14. package/lib/components/SInputDropdown.vue +109 -171
  15. package/lib/components/SInputDropdownItem.vue +26 -32
  16. package/lib/components/SInputDropdownItemText.vue +6 -11
  17. package/lib/components/SInputDropdownItemTextTag.vue +10 -17
  18. package/lib/components/SInputDropdownItemUser.vue +5 -13
  19. package/lib/components/SInputDropdownItemUserTag.vue +9 -16
  20. package/lib/components/SInputFile.vue +38 -53
  21. package/lib/components/SInputHMS.vue +91 -114
  22. package/lib/components/SInputNumber.vue +27 -106
  23. package/lib/components/SInputRadio.vue +21 -34
  24. package/lib/components/SInputRadios.vue +36 -46
  25. package/lib/components/SInputText.vue +72 -628
  26. package/lib/components/SInputTextarea.vue +54 -113
  27. package/lib/components/SInputYMD.vue +94 -105
  28. package/lib/components/SLink.vue +16 -52
  29. package/lib/components/SModal.vue +39 -98
  30. package/lib/components/SPortalModals.vue +37 -54
  31. package/lib/components/SPortalSnackbars.vue +9 -24
  32. package/lib/components/SSheet.vue +73 -28
  33. package/lib/components/SSheetFooter.vue +5 -3
  34. package/lib/components/SSheetFooterAction.vue +10 -15
  35. package/lib/components/SSheetFooterActions.vue +2 -4
  36. package/lib/components/SSheetMedium.vue +14 -22
  37. package/lib/components/SSheetTitle.vue +20 -0
  38. package/lib/components/SSnackbar.vue +18 -28
  39. package/lib/composables/Dialog.ts +9 -17
  40. package/lib/composables/Dropdown.ts +2 -2
  41. package/lib/composables/{Menu.ts → Flyout.ts} +11 -4
  42. package/lib/composables/Form.ts +42 -44
  43. package/lib/composables/Modal.ts +11 -19
  44. package/lib/composables/Snackbar.ts +18 -0
  45. package/lib/composables/Validation.ts +28 -0
  46. package/lib/mixins/Sheet.ts +5 -7
  47. package/lib/store/Sefirot.ts +8 -13
  48. package/lib/store/dialog/index.ts +20 -10
  49. package/lib/store/modal/index.ts +11 -18
  50. package/lib/store/snackbars/index.ts +3 -4
  51. package/lib/support/{Util.ts → Utils.ts} +0 -2
  52. package/lib/types/Utils.ts +0 -7
  53. package/lib/types/vue-shims.d.ts +7 -0
  54. package/lib/validation/rules/checked.ts +6 -10
  55. package/lib/validation/rules/fileExtension.ts +9 -9
  56. package/lib/validation/rules/hms.ts +9 -9
  57. package/lib/validation/rules/index.ts +10 -74
  58. package/lib/validation/rules/maxLength.ts +10 -9
  59. package/lib/validation/rules/minLength.ts +12 -0
  60. package/lib/validation/rules/required.ts +2 -10
  61. package/lib/validation/rules/requiredHms.ts +11 -0
  62. package/lib/validation/rules/requiredIf.ts +3 -11
  63. package/lib/validation/rules/requiredYmd.ts +11 -0
  64. package/lib/validation/rules/ymd.ts +11 -0
  65. package/lib/validation/validators/checked.ts +1 -1
  66. package/lib/validation/validators/fileExtension.ts +1 -1
  67. package/lib/validation/validators/hms.ts +5 -5
  68. package/lib/validation/validators/requiredHms.ts +17 -0
  69. package/lib/validation/validators/requiredYmd.ts +7 -0
  70. package/lib/validation/validators/ymd.ts +41 -0
  71. package/package.json +45 -50
  72. package/lib/components/SAction.vue +0 -37
  73. package/lib/components/SActionAvatar.vue +0 -25
  74. package/lib/components/SActionButton.vue +0 -40
  75. package/lib/components/SActionPill.vue +0 -35
  76. package/lib/components/SActionSwitch.vue +0 -37
  77. package/lib/components/SAlert.vue +0 -145
  78. package/lib/components/SButtonGroup.vue +0 -160
  79. package/lib/components/SCard.vue +0 -111
  80. package/lib/components/SCardFooter.vue +0 -74
  81. package/lib/components/SCardHeader.vue +0 -213
  82. package/lib/components/SGrid.vue +0 -237
  83. package/lib/components/SGridActionLink.vue +0 -53
  84. package/lib/components/SGridActionMulti.vue +0 -139
  85. package/lib/components/SGridActionSingle.vue +0 -64
  86. package/lib/components/SHeader.vue +0 -180
  87. package/lib/components/SInputCheckboxes.vue +0 -87
  88. package/lib/components/SInputDate.vue +0 -192
  89. package/lib/components/SInputDay.vue +0 -87
  90. package/lib/components/SInputMonth.vue +0 -86
  91. package/lib/components/SInputSelect.vue +0 -298
  92. package/lib/components/SInputSwitch.vue +0 -212
  93. package/lib/components/SInputSwitches.vue +0 -108
  94. package/lib/components/SInputTime.vue +0 -255
  95. package/lib/components/SInputYear.vue +0 -60
  96. package/lib/components/SMarkdown.vue +0 -56
  97. package/lib/components/SPlaceholderBlank.vue +0 -113
  98. package/lib/components/SPlaceholderImage.vue +0 -83
  99. package/lib/components/SPortalScreens.vue +0 -62
  100. package/lib/components/SProgressBar.vue +0 -89
  101. package/lib/components/SResponsive.vue +0 -46
  102. package/lib/components/SScreen.vue +0 -81
  103. package/lib/components/SSheetHeader.vue +0 -75
  104. package/lib/components/SSheetHeaderTitle.vue +0 -17
  105. package/lib/components/SStep.vue +0 -107
  106. package/lib/components/SSteps.vue +0 -75
  107. package/lib/components/STag.vue +0 -67
  108. package/lib/components/STooltip.vue +0 -134
  109. package/lib/components/SWindow.vue +0 -158
  110. package/lib/components/icons/SIconCopy.vue +0 -6
  111. package/lib/composables/Action.ts +0 -141
  112. package/lib/composables/Alert.ts +0 -50
  113. package/lib/composables/Card.ts +0 -46
  114. package/lib/composables/FormValidation.ts +0 -150
  115. package/lib/composables/Header.ts +0 -72
  116. package/lib/composables/InputDropdown.ts +0 -6
  117. package/lib/composables/Markdown.ts +0 -138
  118. package/lib/composables/Router.ts +0 -20
  119. package/lib/composables/Step.ts +0 -7
  120. package/lib/composables/Store.ts +0 -9
  121. package/lib/composables/Tag.ts +0 -32
  122. package/lib/composables/Tooltip.ts +0 -91
  123. package/lib/composables/Utils.ts +0 -115
  124. package/lib/composables/markdown/LinkPlugin.ts +0 -45
  125. package/lib/compositions/useForm.ts +0 -17
  126. package/lib/compositions/useResizeObserver.ts +0 -25
  127. package/lib/compositions/useTime.ts +0 -26
  128. package/lib/store/alert/index.ts +0 -32
  129. package/lib/store/screen/index.ts +0 -46
  130. package/lib/types/v-calendar.d.ts +0 -5
  131. package/lib/validation/Validation.ts +0 -151
  132. package/lib/validation/rules/day.ts +0 -11
  133. package/lib/validation/rules/email.ts +0 -11
  134. package/lib/validation/rules/every.ts +0 -38
  135. package/lib/validation/rules/include.ts +0 -11
  136. package/lib/validation/rules/includeSome.ts +0 -11
  137. package/lib/validation/rules/integer.ts +0 -11
  138. package/lib/validation/rules/maxValue.ts +0 -11
  139. package/lib/validation/rules/minValue.ts +0 -11
  140. package/lib/validation/rules/month.ts +0 -11
  141. package/lib/validation/rules/not.ts +0 -10
  142. package/lib/validation/rules/regex.ts +0 -11
  143. package/lib/validation/rules/requiredHMS.ts +0 -11
  144. package/lib/validation/rules/requiredMonthDate.ts +0 -11
  145. package/lib/validation/rules/requiredYearMonth.ts +0 -11
  146. package/lib/validation/rules/requiredYearMonthDate.ts +0 -11
  147. package/lib/validation/rules/rule.ts +0 -5
  148. package/lib/validation/rules/sameAs.ts +0 -11
  149. package/lib/validation/rules/url.ts +0 -11
  150. package/lib/validation/rules/validateIf.ts +0 -27
  151. package/lib/validation/rules/year.ts +0 -11
  152. package/lib/validation/rules/yearMonth.ts +0 -11
  153. package/lib/validation/rules/yearMonthDate.ts +0 -11
  154. package/lib/validation/validators/day.ts +0 -29
  155. package/lib/validation/validators/email.ts +0 -5
  156. package/lib/validation/validators/include.ts +0 -5
  157. package/lib/validation/validators/includeSome.ts +0 -5
  158. package/lib/validation/validators/index.ts +0 -51
  159. package/lib/validation/validators/integer.ts +0 -6
  160. package/lib/validation/validators/maxLength.ts +0 -3
  161. package/lib/validation/validators/maxValue.ts +0 -3
  162. package/lib/validation/validators/minValue.ts +0 -3
  163. package/lib/validation/validators/month.ts +0 -3
  164. package/lib/validation/validators/monthDate.ts +0 -20
  165. package/lib/validation/validators/regex.ts +0 -3
  166. package/lib/validation/validators/required.ts +0 -27
  167. package/lib/validation/validators/requiredHMS.ts +0 -17
  168. package/lib/validation/validators/requiredMonthDate.ts +0 -8
  169. package/lib/validation/validators/requiredYearMonth.ts +0 -8
  170. package/lib/validation/validators/requiredYearMonthDate.ts +0 -9
  171. package/lib/validation/validators/sameAs.ts +0 -5
  172. package/lib/validation/validators/url.ts +0 -5
  173. package/lib/validation/validators/year.ts +0 -3
  174. package/lib/validation/validators/yearMonth.ts +0 -20
  175. package/lib/validation/validators/yearMonthDate.ts +0 -21
@@ -1,99 +1,45 @@
1
1
  <template>
2
- <transition name="fade" :duration="250" appear>
3
- <div ref="el" class="SModal" @click="closeIfClosable">
4
- <transition name="fade">
5
- <div
6
- v-show="show"
7
- class="SModal-content"
8
- :style="contentStyles"
9
- @click="closeIfClosable"
10
- >
11
- <component
12
- :is="resolvedComponent"
13
- :if="resolvedComponent"
14
- v-bind="data"
15
- @close="close"
16
- />
17
- </div>
18
- </transition>
2
+ <div v-show="show" class="SModal" ref="el">
3
+ <div class="content">
4
+ <component :is="component" v-bind="data ?? {}" @close="close" />
19
5
  </div>
20
- </transition>
6
+ </div>
21
7
  </template>
22
8
 
23
- <script lang="ts">
9
+ <script setup lang="ts">
10
+ import { ref, onMounted, onBeforeUnmount } from 'vue'
24
11
  import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock'
25
- import { defineComponent, ref, computed, onMounted, onUnmounted } from '@vue/composition-api'
26
- import { SyntheticMouseEvent } from '../types/Utils'
27
12
 
28
- export default defineComponent({
29
- props: {
30
- component: { type: [Object, Function], default: () => ({}) },
31
- data: { type: Object, default: () => ({}) },
32
- uid: { type: Number, default: null },
33
- show: { type: Boolean, required: true },
34
- width: { type: String, default: 'auto' },
35
- closable: { type: Boolean, default: true }
36
- },
13
+ const props = defineProps<{
14
+ id?: number
15
+ component: any
16
+ data?: Record<string, any>
17
+ show: boolean
18
+ }>()
37
19
 
38
- setup(props, { emit }) {
39
- const el = ref<Element | null>(null)
40
- const resolvedComponent = ref<any>(null)
20
+ const emit = defineEmits<{
21
+ (e: 'close', id?: number): void
22
+ }>()
41
23
 
42
- props.component instanceof Function
43
- ? props.component().then((module: any) => { resolvedComponent.value = module.default })
44
- : (resolvedComponent.value = props.component)
24
+ const el = ref<any>(null)
45
25
 
46
- const contentStyles = computed(() => ({
47
- maxWidth: props.width
48
- }))
26
+ onMounted(lock)
27
+ onBeforeUnmount(release)
49
28
 
50
- onMounted(lock)
51
- onUnmounted(release)
52
-
53
- function close() {
54
- emit('close', props.uid)
55
- }
56
-
57
- function closeIfClosable(e: SyntheticMouseEvent): void {
58
- if (props.closable) {
59
- if (!isDescendant(e.target)) {
60
- close()
61
- }
62
- }
63
- }
64
-
65
- function isDescendant(el: Element): boolean {
66
- if (el.classList && el.classList.contains('SModal-content')) {
67
- return false
68
- }
69
-
70
- const parent = document.getElementsByClassName('SModal-content')[0]
71
-
72
- return parent && parent.contains(el)
73
- }
74
-
75
- function lock(): void {
76
- disableBodyScroll(el.value!, { reserveScrollBarGap: true })
77
- }
29
+ function close() {
30
+ emit('close', props.id)
31
+ }
78
32
 
79
- function release(): void {
80
- enableBodyScroll(el.value!)
81
- }
33
+ function lock() {
34
+ disableBodyScroll(el.value!, { reserveScrollBarGap: true })
35
+ }
82
36
 
83
- return {
84
- el,
85
- contentStyles,
86
- resolvedComponent,
87
- close,
88
- closeIfClosable
89
- }
90
- }
91
- })
37
+ function release() {
38
+ enableBodyScroll(el.value!)
39
+ }
92
40
  </script>
93
41
 
94
- <style lang="postcss" scoped>
95
- @import "@/assets/styles/variables";
96
-
42
+ <style scoped lang="postcss">
97
43
  .SModal {
98
44
  position: absolute;
99
45
  top: 0;
@@ -101,40 +47,35 @@ export default defineComponent({
101
47
  bottom: 0;
102
48
  left: 0;
103
49
  height: 100vh;
104
- padding: 32px 16px 96px;
105
50
  overflow: hidden;
106
51
  overflow-y: auto;
107
-
108
- @media (min-width: 768px) {
109
- padding: 48px 24px 96px;
110
- }
111
52
  }
112
53
 
113
- .SModal.fade-enter-active .SModal-content,
114
- .SModal.fade-leave-active .SModal-content,
115
- .SModal-content.fade-enter-active,
116
- .SModal-content.fade-leave-active {
54
+ .SModal.fade-enter-active .content,
55
+ .SModal.fade-leave-active .content,
56
+ .content.fade-enter-active,
57
+ .content.fade-leave-active {
117
58
  transition: opacity .25s, transform .25s;
118
59
  }
119
60
 
120
- .SModal.fade-enter-active .SModal-content,
121
- .SModal-content.fade-enter-active {
61
+ .SModal.fade-enter-active .content,
62
+ .content.fade-enter-active {
122
63
  transition-delay: .15s;
123
64
  }
124
65
 
125
- .SModal.fade-enter .SModal-content,
126
- .SModal-content.fade-enter {
66
+ .SModal.fade-enter-from .content,
67
+ .content.fade-enter-from {
127
68
  opacity: 0;
128
69
  transform: translateY(8px);
129
70
  }
130
71
 
131
- .SModal.fade-leave-to .SModal-content,
132
- .SModal-content.fade-leave-to {
72
+ .SModal.fade-leave-to .content,
73
+ .content.fade-leave-to {
133
74
  opacity: 0;
134
75
  transform: translateY(-8px);
135
76
  }
136
77
 
137
- .SModal-content {
78
+ .content {
138
79
  margin: 0 auto;
139
80
  transition: opacity .25s, transform .25s;
140
81
  }
@@ -1,74 +1,57 @@
1
1
  <template>
2
2
  <transition name="fade">
3
3
  <div v-if="isActive" class="SPortalModals">
4
- <SModal
5
- v-for="(item, index) in items"
6
- :key="index"
7
- :uid="item.uid"
8
- :show="index === items.length - 1"
9
- :component="item.component"
10
- :data="item.data"
11
- :width="item.options && item.options.width"
12
- :closable="item.options && item.options.closable"
13
- @close="uid => close(uid)"
14
- />
4
+ <transition-group name="fade" :duration="250" appear>
5
+ <SModal
6
+ v-for="(item, index) in items"
7
+ :key="item.id"
8
+ :id="item.id"
9
+ :show="index === items.length - 1"
10
+ :component="item.component"
11
+ :data="item.data"
12
+ @close="id => close(id)"
13
+ />
14
+ </transition-group>
15
15
  </div>
16
16
  </transition>
17
17
  </template>
18
18
 
19
- <script lang="ts">
20
- import { defineComponent, ref, computed, watch } from '@vue/composition-api'
21
- import { useRoute } from '../composables/Router'
22
- import { useStore } from '../composables/Store'
19
+ <script setup lang="ts">
20
+ import { ref, computed, watch } from 'vue'
21
+ import { useRoute } from 'vue-router'
22
+ import { useStore } from 'vuex'
23
23
  import SModal from './SModal.vue'
24
24
 
25
- export default defineComponent({
26
- components: {
27
- SModal
28
- },
25
+ const route = useRoute()
26
+ const store = useStore()
29
27
 
30
- setup() {
31
- const route = useRoute()
32
- const store = useStore()
28
+ const items = computed(() => store.state.modal.items)
29
+ const hasItem = computed(() => items.value.length > 0)
33
30
 
34
- const items = computed(() => store.state.modal.items)
35
- const hasItem = computed(() => items.value.length > 0)
31
+ const isActive = ref(false)
36
32
 
37
- const isActive = ref(false)
33
+ let timer: any
38
34
 
39
- let timer: any
35
+ watch(hasItem, (value) => {
36
+ clearTimeout(timer)
40
37
 
41
- watch(hasItem, (value) => {
42
- clearTimeout(timer)
43
-
44
- value
45
- ? (isActive.value = true)
46
- : (timer = setTimeout(() => { isActive.value = false }, 250))
47
- })
48
-
49
- watch(route, closeAll)
38
+ value
39
+ ? (isActive.value = true)
40
+ : (timer = setTimeout(() => { isActive.value = false }, 250))
41
+ })
50
42
 
51
- function close(uid: number) {
52
- store.dispatch('modal/close', uid)
53
- }
43
+ watch(route, closeAll)
54
44
 
55
- function closeAll() {
56
- store.dispatch('modal/closeAll')
57
- }
45
+ function close(id?: number) {
46
+ store.dispatch('modal/close', id)
47
+ }
58
48
 
59
- return {
60
- items,
61
- hasItem,
62
- isActive,
63
- close
64
- }
65
- }
66
- })
49
+ function closeAll() {
50
+ store.dispatch('modal/closeAll')
51
+ }
67
52
  </script>
68
53
 
69
- <style lang="postcss" scoped>
70
- @import "@/assets/styles/variables";
71
-
54
+ <style scoped lang="postcss">
72
55
  .SPortalModals {
73
56
  position: fixed;
74
57
  top: 0;
@@ -84,8 +67,8 @@ export default defineComponent({
84
67
  transition: opacity .25s;
85
68
  }
86
69
 
87
- .SPortalModals.fade-enter,
88
- .SPortalModals.fade-leave-active {
70
+ .SPortalModals.fade-enter-from,
71
+ .SPortalModals.fade-leave-to {
89
72
  opacity: 0;
90
73
  }
91
74
  </style>
@@ -14,33 +14,18 @@
14
14
  </transition>
15
15
  </template>
16
16
 
17
- <script lang="ts">
18
- import { defineComponent, computed } from '@vue/composition-api'
19
- import { useStore } from '../composables/Store'
17
+ <script setup lang="ts">
18
+ import { computed } from 'vue'
19
+ import { useStore } from 'vuex'
20
20
  import SSnackbar from './SSnackbar.vue'
21
21
 
22
- export default defineComponent({
23
- components: {
24
- SSnackbar
25
- },
22
+ const store = useStore()
26
23
 
27
- setup() {
28
- const store = useStore()
29
-
30
- const items = computed(() => store.state.snackbars.items)
31
- const hasItem = computed(() => items.value.length > 0)
32
-
33
- return {
34
- items,
35
- hasItem
36
- }
37
- }
38
- })
24
+ const items = computed(() => store.state.snackbars.items)
25
+ const hasItem = computed(() => items.value.length > 0)
39
26
  </script>
40
27
 
41
28
  <style lang="postcss" scoped>
42
- @import "@/assets/styles/variables";
43
-
44
29
  .SPortalSnackbars {
45
30
  position: fixed;
46
31
  bottom: 0;
@@ -56,7 +41,7 @@ export default defineComponent({
56
41
  }
57
42
  }
58
43
 
59
- .SPortalSnackbars.fade-enter {
44
+ .SPortalSnackbars.fade-enter-from {
60
45
  opacity: 0;
61
46
  transform: translateY(48px);
62
47
  }
@@ -79,12 +64,12 @@ export default defineComponent({
79
64
  position: absolute;
80
65
  }
81
66
 
82
- .item.fade-up-enter,
67
+ .item.fade-up-enter-from,
83
68
  .item.fade-up-leave-to {
84
69
  opacity: 0;
85
70
  }
86
71
 
87
- .item.fade-up-enter {
72
+ .item.fade-up-enter-from {
88
73
  transform: translateY(48px);
89
74
  }
90
75
  </style>
@@ -1,47 +1,92 @@
1
1
  <template>
2
- <article class="SSheet" :class="[size]">
3
- <slot :close="close" />
4
- </article>
2
+ <div class="SSheet" :class="[size ?? 'medium']" @click="closeIfClosable">
3
+ <article class="box" @click.stop>
4
+ <div v-if="closable !== false" class="close">
5
+ <button class="close-button" @click="$emit('close')">
6
+ <SIconX class="close-icon" />
7
+ </button>
8
+ </div>
9
+
10
+ <slot :close="() => emit('close')" />
11
+ </article>
12
+ </div>
5
13
  </template>
6
14
 
7
- <script lang="ts">
8
- import { PropType, defineComponent } from '@vue/composition-api'
9
- import { useStore } from '../composables/Store'
15
+ <script setup lang="ts">
16
+ import SIconX from './icons/SIconX.vue'
17
+
18
+ const props = defineProps<{
19
+ size?: 'small' | 'medium' | 'large'
20
+ closable?: boolean
21
+ }>()
10
22
 
11
- type Size = 'small' | 'medium' | 'large'
23
+ const emit = defineEmits<{
24
+ (e: 'close'): void
25
+ }>()
12
26
 
13
- export default defineComponent({
14
- props: {
15
- size: { type: String as PropType<Size>, default: 'medium' }
16
- },
27
+ function closeIfClosable() {
28
+ if (props.closable !== false) {
29
+ emit('close')
30
+ }
31
+ }
32
+ </script>
17
33
 
18
- setup() {
19
- const store = useStore()
34
+ <style scoped lang="postcss">
35
+ .SSheet {
36
+ padding: 16px 16px 96px;
37
+ min-height: 100vh;
20
38
 
21
- function close() {
22
- store.dispatch('modal/close')
23
- }
39
+ @media (min-width: 512px) {
40
+ padding: 32px 24px 96px;
41
+ }
24
42
 
25
- return {
26
- close
27
- }
43
+ @media (min-width: 768px) {
44
+ padding: 48px 32px 128px;
28
45
  }
29
- })
30
- </script>
46
+ }
31
47
 
32
- <style lang="postcss" scoped>
33
- @import "@/assets/styles/variables";
48
+ .SSheet.small .box { max-width: 392px; }
49
+ .SSheet.medium .box { max-width: 512px; }
50
+ .SSheet.large .box { max-width: 768px; }
34
51
 
35
- .SSheet {
52
+ .box {
53
+ position: relative;
36
54
  margin: 0 auto;
37
55
  border: 1px solid var(--c-divider-light);
38
56
  border-radius: 8px;
39
57
  background-color: var(--c-bg);
40
58
  box-shadow: var(--shadow-depth-3);
41
- overflow: hidden;
42
59
  }
43
60
 
44
- .SSheet.small { max-width: 392px; }
45
- .SSheet.medium { max-width: 512px; }
46
- .SSheet.large { max-width: 768px; }
61
+ .close {
62
+ position: absolute;
63
+ top: 10px;
64
+ right: 4px;
65
+ z-index: 10;
66
+
67
+ @media (min-width: 512px) {
68
+ top: 14px;
69
+ right: 12px;
70
+ }
71
+ }
72
+
73
+ .close-button {
74
+ display: flex;
75
+ justify-content: center;
76
+ align-items: center;
77
+ width: 48px;
78
+ height: 48px;
79
+ color: var(--c-text-3);
80
+ transition: color .25s;
81
+
82
+ &:hover {
83
+ color: var(--c-text-1);
84
+ }
85
+ }
86
+
87
+ .close-icon {
88
+ width: 20px;
89
+ height: 20px;
90
+ fill: currentColor;
91
+ }
47
92
  </style>
@@ -4,11 +4,13 @@
4
4
  </footer>
5
5
  </template>
6
6
 
7
- <style lang="postcss" scoped>
8
- @import "@/assets/styles/variables";
9
-
7
+ <style scoped lang="postcss">
10
8
  .SSheetFooter {
11
9
  border-top: 1px solid var(--c-divider-light);
12
10
  padding: 0 16px;
11
+
12
+ @media (min-width: 512px) {
13
+ padding: 0 24px;
14
+ }
13
15
  }
14
16
  </style>
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <div class="SSheetFooterAction">
3
3
  <SButton
4
- size="medium"
5
- :type="type"
6
- :mode="mode"
4
+ size="small"
5
+ :type="type ?? 'primary'"
6
+ :mode="mode ?? 'neutral'"
7
7
  :label="label"
8
8
  block
9
9
  @click="$emit('click')"
@@ -11,22 +11,17 @@
11
11
  </div>
12
12
  </template>
13
13
 
14
- <script lang="ts">
15
- import { PropType, defineComponent } from '@nuxtjs/composition-api'
14
+ <script setup lang="ts">
16
15
  import SButton from './SButton.vue'
17
16
 
18
17
  type Type = 'primary' | 'secondary' | 'tertiary' | 'text' | 'mute'
19
18
  type Mode = 'neutral' | 'info' | 'success' | 'warning' | 'danger'
20
19
 
21
- export default defineComponent({
22
- components: {
23
- SButton
24
- },
20
+ defineProps<{
21
+ type?: Type
22
+ mode?: Mode
23
+ label?: string
24
+ }>()
25
25
 
26
- props: {
27
- type: { type: String as PropType<Type>, default: 'primary' },
28
- mode: { type: String as PropType<Mode>, default: 'neutral' },
29
- label: { type: String, default: null }
30
- }
31
- })
26
+ defineEmits(['click'])
32
27
  </script>
@@ -5,15 +5,13 @@
5
5
  </template>
6
6
 
7
7
  <style lang="postcss" scoped>
8
- @import "@/assets/styles/variables";
9
-
10
8
  .SSheetFooterActions {
11
9
  display: flex;
12
10
  justify-content: flex-end;
13
- padding: 12px 0 11px;
11
+ padding: 16px 0 15px;
14
12
  }
15
13
 
16
- .SSheetFooterActions >>> .SSheetFooterAction + .SSheetFooterAction {
14
+ .SSheetFooterActions :deep(.SSheetFooterAction + .SSheetFooterAction) {
17
15
  padding-left: 8px;
18
16
  }
19
17
  </style>
@@ -5,38 +5,30 @@
5
5
  </template>
6
6
 
7
7
  <style lang="postcss" scoped>
8
- @import "@/assets/styles/variables";
9
-
10
8
  .SSheetMedium {
11
- padding: 16px;
12
- }
13
-
14
- .SSheetMedium >>> h1 {
15
- line-height: 32px;
16
- font-size: 20px;
17
- font-weight: 500;
18
- }
9
+ padding: 12px 16px 20px;
19
10
 
20
- .SSheetMedium >>> h1 + p {
21
- margin-top: 8px;
11
+ @media (min-width: 512px) {
12
+ padding: 16px 24px 26px;
13
+ }
22
14
  }
23
15
 
24
- .SSheetMedium >>> p {
16
+ .SSheetMedium :deep(p) {
25
17
  margin: 16px 0;
26
18
  line-height: 24px;
27
19
  font-size: 14px;
28
20
  font-weight: 400;
29
21
  }
30
22
 
31
- .SSheetMedium >>> p:first-child {
23
+ .SSheetMedium :deep(p:first-child) {
32
24
  margin-top: 0;
33
25
  }
34
26
 
35
- .SSheetMedium >>> p:last-child {
27
+ .SSheetMedium :deep(p:last-child) {
36
28
  margin-bottom: 0;
37
29
  }
38
30
 
39
- .SSheetMedium >>> a {
31
+ .SSheetMedium :deep(a) {
40
32
  font-weight: 500;
41
33
  color: var(--c-info);
42
34
  transition: color .25s;
@@ -46,22 +38,22 @@
46
38
  }
47
39
  }
48
40
 
49
- .SSheetMedium >>> ul {
41
+ .SSheetMedium :deep(ul) {
50
42
  margin: 16px 0;
51
43
  }
52
44
 
53
- .SSheetMedium >>> ul:last-child {
45
+ .SSheetMedium :deep(ul:last-child) {
54
46
  margin-bottom: 0;
55
47
  }
56
48
 
57
- .SSheetMedium >>> li {
49
+ .SSheetMedium :deep(li) {
58
50
  position: relative;
59
51
  padding-left: 20px;
60
52
  font-size: 14px;
61
53
  font-weight: 400;
62
54
  }
63
55
 
64
- .SSheetMedium >>> li::before {
56
+ .SSheetMedium :deep(li::before) {
65
57
  position: absolute;
66
58
  top: 9px;
67
59
  left: 4px;
@@ -72,11 +64,11 @@
72
64
  content: "";
73
65
  }
74
66
 
75
- .SSheetMedium >>> li + li {
67
+ .SSheetMedium :deep(li + li) {
76
68
  margin-top: 4px;
77
69
  }
78
70
 
79
- .SSheetMedium >>> li > ul {
71
+ .SSheetMedium :deep(li > ul) {
80
72
  margin: 4px 0 0;
81
73
  }
82
74
  </style>
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <header class="SSheetTitle">
3
+ <h1 class="title">
4
+ <slot />
5
+ </h1>
6
+ </header>
7
+ </template>
8
+
9
+ <style lang="postcss" scoped>
10
+ .title {
11
+ padding: 20px 48px 0 16px;
12
+ line-height: 28px;
13
+ font-size: 20px;
14
+ font-weight: 500;
15
+
16
+ @media (min-width: 512px) {
17
+ padding: 24px 64px 0 24px;
18
+ }
19
+ }
20
+ </style>