@globalbrain/sefirot 3.10.0 → 3.11.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.
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- export type Space = 'compact' | 'wide'
2
+ export type Space = 'compact' | 'wide' | 'xwide'
3
3
 
4
4
  defineProps<{
5
5
  space?: Space
@@ -19,6 +19,7 @@ defineProps<{
19
19
 
20
20
  &.compact { padding: 24px; }
21
21
  &.wide { padding: 32px; }
22
+ &.xwide { padding: 48px; }
22
23
  }
23
24
 
24
25
  .SCard > .SCardBlock:first-child {
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- export type Space = 'compact' | 'wide'
2
+ export type Space = 'compact' | 'wide' | 'xwide'
3
3
 
4
4
  defineProps<{
5
5
  space?: Space
@@ -13,5 +13,6 @@
13
13
 
14
14
  .SCardFooter.compact > & { padding: 12px 24px; }
15
15
  .SCardFooter.wide > & { padding: 16px 32px; }
16
+ .SCardFooter.xwide > & { padding: 24px 48px; }
16
17
  }
17
18
  </style>
@@ -11,8 +11,31 @@
11
11
  gap: 12px;
12
12
  }
13
13
 
14
+ .SContent :deep(h1),
15
+ .SContent :deep(.h1) {
16
+ margin: 0;
17
+ max-width: 640px;
18
+ line-height: 40px;
19
+ font-size: 32px;
20
+ font-weight: 500;
21
+ color: var(--c-text-1);
22
+ }
23
+
24
+ .SContent :deep(h2),
25
+ .SContent :deep(.h2) {
26
+ border-top: 0;
27
+ margin: 0;
28
+ padding: 0;
29
+ max-width: 640px;
30
+ line-height: 28px;
31
+ font-size: 20px;
32
+ font-weight: 500;
33
+ color: var(--c-text-1);
34
+ }
35
+
14
36
  .SContent :deep(p) {
15
37
  margin: 0;
38
+ max-width: 640px;
16
39
  line-height: 24px;
17
40
  font-size: 14px;
18
41
  font-weight: 400;
@@ -36,6 +59,7 @@
36
59
  .SContent :deep(ol) {
37
60
  margin: 0;
38
61
  padding-left: 0;
62
+ max-width: 640px;
39
63
  list-style: none;
40
64
  }
41
65
 
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <div class="SDivider">
3
+ <div class="line" />
4
+ </div>
5
+ </template>
6
+
7
+ <style scoped lang="postcss">
8
+ .SDivider {
9
+ padding: var(--divider-padding);
10
+ }
11
+
12
+ .line {
13
+ height: 1px;
14
+ background-color: var(--c-divider);
15
+ }
16
+ </style>
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <div class="SDoc">
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+ <style scoped lang="postcss">
8
+ .SDoc {
9
+ display: flex;
10
+ flex-direction: column;
11
+ gap: 24px;
12
+ }
13
+
14
+ .SDoc {
15
+ --divider-padding: 24px 0;
16
+ }
17
+ </style>
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="SDocSection">
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+ <style scoped lang="postcss">
8
+ .SDocSection {
9
+ display: flex;
10
+ flex-direction: column;
11
+ gap: 24px;
12
+ }
13
+ </style>
@@ -1,3 +1,4 @@
1
+ import isEqual from 'lodash-es/isEqual'
1
2
  import isPlainObject from 'lodash-es/isPlainObject'
2
3
  import { watch } from 'vue'
3
4
  import { useRoute, useRouter } from 'vue-router'
@@ -38,7 +39,7 @@ export function useUrlQuerySync(
38
39
  flattenState[key] = cast ? cast(value) : value
39
40
  })
40
41
 
41
- Object.assign(state, unflattenObject(flattenState))
42
+ deepAssign(state, unflattenObject(flattenState))
42
43
  }
43
44
 
44
45
  async function setQueryFromState() {
@@ -53,7 +54,7 @@ export function useUrlQuerySync(
53
54
  const value = flattenState[key]
54
55
  const initialValue = flattenInitialState[key]
55
56
 
56
- if (value === initialValue) {
57
+ if (isEqual(value, initialValue)) {
57
58
  delete flattenQuery[key]
58
59
  } else {
59
60
  flattenQuery[key] = value
@@ -94,3 +95,25 @@ function unflattenObject(obj: Record<string, any>) {
94
95
  return acc
95
96
  }, {} as Record<string, any>)
96
97
  }
98
+
99
+ function deepAssign(target: Record<string, any>, source: Record<string, any>) {
100
+ const dest = target
101
+ const src = source
102
+
103
+ if (isPlainObject(src)) {
104
+ Object.keys(src).forEach((key) => deepAssignBase(dest, src, key))
105
+ } else if (Array.isArray(src)) {
106
+ dest.length = src.length
107
+ src.forEach((_, key) => deepAssignBase(dest, src, key))
108
+ } else {
109
+ throw new TypeError('[deepAssign] src must be an object or array')
110
+ }
111
+ }
112
+
113
+ function deepAssignBase(dest: Record<string, any>, src: Record<string, any>, key: string | number) {
114
+ if (typeof src[key] === 'object' && src[key] !== null) {
115
+ deepAssign(dest[key], src[key])
116
+ } else {
117
+ dest[key] = src[key]
118
+ }
119
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
- "version": "3.10.0",
4
- "packageManager": "pnpm@8.11.0",
3
+ "version": "3.11.0",
4
+ "packageManager": "pnpm@8.12.1",
5
5
  "description": "Vue Components for Global Brain Design System.",
6
6
  "author": "Kia Ishii <ka.ishii@globalbrains.com>",
7
7
  "license": "MIT",
@@ -56,7 +56,7 @@
56
56
  "postcss": "^8.4.32",
57
57
  "postcss-nested": "^6.0.1",
58
58
  "v-calendar": "^3.1.2",
59
- "vue": "^3.3.10",
59
+ "vue": "^3.3.11",
60
60
  "vue-router": "^4.2.5"
61
61
  },
62
62
  "dependencies": {
@@ -82,7 +82,7 @@
82
82
  "@types/node": "^20.10.4",
83
83
  "@types/qs": "^6.9.10",
84
84
  "@vitejs/plugin-vue": "^4.5.2",
85
- "@vitest/coverage-v8": "^1.0.2",
85
+ "@vitest/coverage-v8": "^1.0.4",
86
86
  "@vue/test-utils": "^2.4.3",
87
87
  "@vuelidate/core": "^2.0.3",
88
88
  "@vuelidate/validators": "^2.0.4",
@@ -99,13 +99,13 @@
99
99
  "postcss": "^8.4.32",
100
100
  "postcss-nested": "^6.0.1",
101
101
  "punycode": "^2.3.1",
102
- "release-it": "^17.0.0",
102
+ "release-it": "^17.0.1",
103
103
  "typescript": "~5.3.3",
104
104
  "v-calendar": "^3.1.2",
105
- "vite": "^5.0.6",
105
+ "vite": "^5.0.9",
106
106
  "vitepress": "1.0.0-rc.31",
107
- "vitest": "^1.0.2",
108
- "vue": "^3.3.10",
107
+ "vitest": "^1.0.4",
108
+ "vue": "^3.3.11",
109
109
  "vue-router": "^4.2.5",
110
110
  "vue-tsc": "^1.8.25"
111
111
  }