Skip to content

Commit

Permalink
Merge branch 'main' into 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd authored Aug 26, 2024
2 parents fadd75d + e5f47f7 commit 731e462
Show file tree
Hide file tree
Showing 171 changed files with 3,882 additions and 4,453 deletions.
File renamed without changes.
File renamed without changes.
35 changes: 33 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,42 @@


# [3.51.0](https://github.com/globalbrain/sefirot/compare/v3.50.0...v3.51.0) (2024-08-26)
# [4.2.0](https://github.com/globalbrain/sefirot/compare/v4.1.1...v4.2.0) (2024-08-16)


### Features

* **Http:** add headers option ([d925072](https://github.com/globalbrain/sefirot/commit/d92507204dfbe4288428f2087a78c46b3a3217cc))
* **composables/Utils:** add `computedArrayWhen` ([01d2a11](https://github.com/globalbrain/sefirot/commit/01d2a113b7ecc00b5e8fb757428f8ecc5fd00a45))

## [4.1.1](https://github.com/globalbrain/sefirot/compare/v4.1.0...v4.1.1) (2024-08-06)

# [4.1.0](https://github.com/globalbrain/sefirot/compare/v4.0.0...v4.1.0) (2024-08-05)


### Features

* **input:** add `<SInputFileUpload>` ([#544](https://github.com/globalbrain/sefirot/issues/544)) ([#546](https://github.com/globalbrain/sefirot/issues/546)) ([442cccb](https://github.com/globalbrain/sefirot/commit/442cccba043befa0a8513e0c70840382fd2d73c6))

# [4.0.0](https://github.com/globalbrain/sefirot/compare/v3.50.0...v4.0.0) (2024-08-03)

### BREAKING CHANGES

* `@iconify-icons/` are replaced with unplugin-icons.
* Package is now ESM only.
* Trivial utilities like `isNullish` and `isArray` are removed.
* Deprecated props and components are removed.
* Old versions of `useData`, `useValidation`, `useForm` are removed.

### Features

* Newer icons available.
* Better ESM Support.
* New base config for Vite and Nuxt projects.
* New utilities like `isFetchError`.

### Migration

* Refer comments on [#539](https://github.com/globalbrain/sefirot/pull/539) for migration guide.
* Refer [docs](https://sefirot.globalbrains.com) for updated documentation.

# [3.50.0](https://github.com/globalbrain/sefirot/compare/v3.49.0...v3.50.0) (2024-07-18)

Expand Down
4 changes: 4 additions & 0 deletions client.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// <reference types="vite/client" />
/// <reference types="unplugin-icons/types/vue3" />

// this file contains public types which are exposed to external modules
4 changes: 4 additions & 0 deletions config/nuxt.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// @ts-ignore
declare const defineConfig: import('nuxt/config').DefineNuxtConfig

export { defineConfig }
31 changes: 31 additions & 0 deletions config/nuxt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// @ts-check

import { fileURLToPath } from 'node:url'
import icons from 'unplugin-icons/nuxt'
import { mergeConfig } from 'vite'
import { baseConfig as baseViteConfig } from './vite.js'

delete baseViteConfig.plugins
delete baseViteConfig.resolve?.alias

export const baseConfig = {
alias: { sefirot: fileURLToPath(new URL('../lib', import.meta.url)) },
app: { teleportId: 'sefirot-modals' },
modules: [
/**
* @param {any} _
* @param {any} nuxt
*/
function (_, nuxt) {
// eslint-disable-next-line @typescript-eslint/no-invalid-this
return icons.bind(this, { scale: 1 }, nuxt)()
}
],
postcss: { plugins: { 'postcss-nested': {} } },
telemetry: false,
vite: baseViteConfig
}

export function defineConfig(config = {}) {
return mergeConfig(baseConfig, config)
}
8 changes: 8 additions & 0 deletions config/vite.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
declare const baseConfig: import('vite').UserConfig

declare function defineConfig(config?: import('vite').UserConfig): import('vite').UserConfig
declare function defineConfig(config?: Promise<import('vite').UserConfig>): Promise<import('vite').UserConfig>
declare function defineConfig(config?: import('vite').UserConfigFnObject): import('vite').UserConfigFnObject
declare function defineConfig(config?: import('vite').UserConfigExport): import('vite').UserConfigExport

export { baseConfig, defineConfig }
69 changes: 69 additions & 0 deletions config/vite.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// @ts-check

/**
* Adapted from
* @see https://github.com/unplugin/unplugin-icons/blob/67fd9b7791dc1754cb8dc46b854b22c8bb4cf380/src/core/compilers/vue3.ts
* @see https://github.com/unplugin/unplugin-icons/blob/639ec9691e022e52c641d0f96f585dbf04dab095/src/core/svgId.ts
*
* Original licenses:
*
* Copyright (c) 2020 Anthony Fu <https://github.com/antfu>
* @license MIT
*/

import { fileURLToPath } from 'node:url'
import icons from 'unplugin-icons/vite'
import { mergeConfig } from 'vite'

/** @type {import('vite').UserConfig} */
export const baseConfig = {
plugins: [icons({ scale: 1 })],

resolve: {
alias: { 'sefirot/': fileURLToPath(new URL('../lib/', import.meta.url)) },

dedupe: [
'@sentry/browser',
'@tanstack/vue-virtual',
'@tinyhttp/content-disposition',
'@tinyhttp/cookie',
'@vue/reactivity',
'@vuelidate/core',
'@vuelidate/validators',
'@vueuse/core',
'body-scroll-lock',
'dayjs',
'file-saver',
'fuse.js',
'lodash-es',
'markdown-it',
'normalize.css',
'ofetch',
'pinia',
'qs',
'v-calendar',
'vue-router',
'vue'
]
},

ssr: { noExternal: [/sentry/] },

optimizeDeps: {
include: [
'dayjs',
'dayjs/plugin/relativeTime',
'dayjs/plugin/timezone',
'dayjs/plugin/utc',
'markdown-it'
]
}
}

/**
* @param {import('vite').UserConfigExport} config
*/
export function defineConfig(config = {}) {
return async (/** @type {import("vite").ConfigEnv} */ configEnv) =>
mergeConfig(baseConfig, await (typeof config === 'function' ? config(configEnv) : config))
}
9 changes: 4 additions & 5 deletions docs/.vitepress/config.mts → docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig, type DefaultTheme } from 'vitepress'
import { baseConfig } from '../../config/vite'

function getStoryHost(): string {
if (process.env.CONTEXT !== 'production' && process.env.DEPLOY_PRIME_URL) {
Expand All @@ -16,11 +17,7 @@ export default defineConfig({
lastUpdated: true,

vite: {
resolve: {
alias: {
'sefirot/': new URL('../../lib/', import.meta.url).pathname
}
},
...baseConfig,
define: {
__STORY_HOST__: JSON.stringify(getStoryHost())
}
Expand Down Expand Up @@ -76,6 +73,7 @@ function sidebar(): DefaultTheme.SidebarItem[] {
{ text: 'SButtonGroup', link: '/components/button-group' },
{ text: 'SCard', link: '/components/card' },
{ text: 'SContent', link: '/components/content' },
{ text: 'SControl', link: '/components/control' },
{ text: 'SDesc', link: '/components/desc' },
{ text: 'SDivider', link: '/components/divider' },
{ text: 'SDoc', link: '/components/doc' },
Expand All @@ -88,6 +86,7 @@ function sidebar(): DefaultTheme.SidebarItem[] {
{ text: 'SInputCheckbox', link: '/components/input-checkbox' },
{ text: 'SInputCheckboxes', link: '/components/input-checkboxes' },
{ text: 'SInputFile', link: '/components/input-file' },
{ text: 'SInputFileUpload', link: '/components/input-file-upload' },
{ text: 'SInputHMS', link: '/components/input-hms' },
{ text: 'SInputImage', link: '/components/input-image' },
{ text: 'SInputNumber', link: '/components/input-number' },
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { type Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'

import 'sefirot/styles/variables.css'
import 'sefirot/styles/utilities.css'
import './styles.css'

import Layout from './components/Layout.vue'
Expand Down
7 changes: 6 additions & 1 deletion docs/.vitepress/theme/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ textarea {
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.m-0 { margin: 0 !important; }
.pl-24 { padding-left: 24px; }
.pr-16 { padding-right: 16px; }

.py-8 { padding-top: 8px; padding-bottom: 8px; }
.px-24 { padding-right: 24px; padding-left: 24px; }

.max-w-128 { max-width: 128px; }
.max-w-192 { max-width: 192px; }
Expand All @@ -78,6 +82,7 @@ textarea {
.h-64 { height: 64px; }

.text-14 { font-size: 14px !important; }
.font-w-600 { font-weight: 600; }

.bg-info { background-color: var(--c-bg-info-1); }

Expand Down
45 changes: 16 additions & 29 deletions docs/components/action-list.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script setup lang="ts">
import IconActivity from '@iconify-icons/ph/activity-bold'
import IconEye from '@iconify-icons/ph/eye-bold'
import IconTrash from '@iconify-icons/ph/trash-bold'
import IconActivity from '~icons/ph/activity-bold'
import IconEye from '~icons/ph/eye-bold'
import IconTrash from '~icons/ph/trash-bold'
import SActionList, { type ActionList } from 'sefirot/components/SActionList.vue'

const list: ActionList = [
{ leadIcon: IconActivity, text: 'Show activity' },
{ leadIcon: IconEye, text: 'Preview' },
{ leadIcon: IconTrash, text: 'Delete item' }
{ leadIcon: IconActivity, label: 'Show activity' },
{ leadIcon: IconEye, label: 'Preview' },
{ leadIcon: IconTrash, label: 'Delete item' }
]
</script>

Expand All @@ -28,15 +28,15 @@ const list: ActionList = [

```vue
<script setup lang="ts">
import IconActivity from '@iconify-icons/ph/activity-bold'
import IconEye from '@iconify-icons/ph/eye-bold'
import IconTrash from '@iconify-icons/ph/trash-bold'
import IconActivity from '~icons/ph/activity-bold'
import IconEye from '~icons/ph/eye-bold'
import IconTrash from '~icons/ph/trash-bold'
import SActionList, { type ActionList } from '@globalbrain/sefirot/lib/components/SActionList.vue'
const list: ActionList = [
{ leadIcon: IconActivity, text: 'Show activity' },
{ leadIcon: IconEye, text: 'Preview' },
{ leadIcon: IconTrash, text: 'Delete item' }
{ leadIcon: IconActivity, label: 'Show activity' },
{ leadIcon: IconEye, label: 'Preview' },
{ leadIcon: IconTrash, label: 'Delete item' }
]
</script>
Expand All @@ -52,8 +52,6 @@ const list: ActionList = [
The options to be listed.

```ts
import { type IconifyIcon } from '@iconify/vue/dist/offline'

interface Props {
list?: ActionList
}
Expand All @@ -62,15 +60,15 @@ type ActionList = ActionListItem[]

interface ActionListItem {
// The icon to be displayed on the left side of the text.
leadIcon?: IconifyIcon

// The text to be displayed.
text: string
leadIcon?: Component

// The link to be navigated to when the item is clicked. When this
// prop is set, the item is rendered via `<SLink>`.
link?: string

// The text to be displayed.
label: string

// Whether the item is disabled.
disabled?: boolean

Expand Down Expand Up @@ -123,14 +121,3 @@ type ActionList = ActionListItem[]
### `ActionListItem`
The type of action list item. See `:list` for the details.
```ts
import { type IconifyIcon } from '@iconify/vue/dist/offline'

interface ActionListItem {
leadIcon?: IconifyIcon
text: string
link?: string
onClick?(): void
}
```
10 changes: 4 additions & 6 deletions docs/components/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,17 @@ type Mode =
### `:icon`
Prepend the given icon to the button. You may pass any `@iconify-icons` icons.
Prepend the given icon to the button. You may pass any Iconify icons.
```ts
import { IconifyIcon } from '@iconify/vue/dist/offline'

interface Props {
icon?: IconifyIcon
icon?: Component
}
```

```vue
<script setup lang="ts">
import IconCheckCircle from '@iconify-icons/ph/check-circle-bold'
import IconCheckCircle from '~icons/ph/check-circle-bold'
</script>
<template>
Expand Down Expand Up @@ -195,7 +193,7 @@ type Mode =
```vue
<script setup lang="ts">
import IconCheckCircle from '@iconify-icons/ph/check-circle-bold'
import IconCheckCircle from '~icons/ph/check-circle-bold'
</script>

<template>
Expand Down
Loading

0 comments on commit 731e462

Please sign in to comment.