Comparing version 1.0.8-beta.1 to 1.0.8-beta.3
@@ -16,4 +16,13 @@ // src/plugin.ts | ||
// src/components.ts | ||
import { OAvatar, OAvatarGroup, OButton, OCard, OIcon } from "@onu-ui/components"; | ||
var components_default = [OAvatar, OAvatarGroup, OButton, OIcon, OCard]; | ||
import { OAlert, OAvatar, OAvatarGroup, OButton, OCard, OIcon, OMessage, OTag } from "@onu-ui/components"; | ||
var components_default = [ | ||
OAvatar, | ||
OAvatarGroup, | ||
OButton, | ||
OIcon, | ||
OCard, | ||
OAlert, | ||
OTag, | ||
OMessage | ||
]; | ||
@@ -388,4 +397,4 @@ // src/defaults.ts | ||
var handler = createValueHandler(valueHandlers); | ||
function getThemeColor(theme, colors) { | ||
let obj = theme.colors; | ||
function getThemeColor(theme2, colors) { | ||
let obj = theme2.colors; | ||
let index = -1; | ||
@@ -407,3 +416,3 @@ for (const c of colors) { | ||
} | ||
function parseColor$1(body, theme) { | ||
function parseColor$1(body, theme2) { | ||
const split = body.split(/(?:\/|:)/); | ||
@@ -437,3 +446,3 @@ let main, opacity; | ||
no = scale; | ||
colorData = getThemeColor(theme, colors.slice(0, -1)); | ||
colorData = getThemeColor(theme2, colors.slice(0, -1)); | ||
if (!colorData || typeof colorData === "string") | ||
@@ -444,6 +453,6 @@ color = void 0; | ||
} else { | ||
colorData = getThemeColor(theme, colors); | ||
colorData = getThemeColor(theme2, colors); | ||
if (!colorData && colors.length <= 2) { | ||
[, no = no] = colors; | ||
colorData = getThemeColor(theme, [name]); | ||
colorData = getThemeColor(theme2, [name]); | ||
} | ||
@@ -675,2 +684,3 @@ if (typeof colorData === "string") | ||
"fc": "flex justify-center", | ||
"fi": "flex items-center", | ||
"fcc": "flex justify-center items-center", | ||
@@ -690,64 +700,70 @@ "fs": "flex justify-start", | ||
// ../preset/src/constants.ts | ||
var SwitchSizeMap = { | ||
sm: ["2rem", "1.125rem", "0.85rem"], | ||
md: ["2.5rem", "1.375rem", "1.1rem"], | ||
lg: ["3rem", "1.625rem", "1.375rem"] | ||
}; | ||
// ../preset/src/index.ts | ||
var theme = { | ||
colors: { | ||
context: "rgba(var(--onu-c-context),%alpha)", | ||
primary: "#a855f7", | ||
secondary: "#1ABCFE", | ||
success: "#0ACF83", | ||
warning: "#FF9F43", | ||
error: "#FF5C5C", | ||
info: "#373e47", | ||
placeholder: "#dcdcdc" | ||
}, | ||
fontFamily: { | ||
sans: "Avenir, Helvetica, Arial, sans-serif" | ||
}, | ||
boxShadow: { | ||
xs: "var(--un-shadow-inset) 0 1px 1px 0 var(--un-shadow-color, rgba(0,0,0,0.03))", | ||
switch: "calc(var(--o-switch-offset) * -1) 0 0 2px var(--o-switch-bc) inset, 0 0 0 2px var(--o-switch-bc) inset;", | ||
switchActive: "calc(var(--o-switch-offset)) 0 0 2px var(--o-switch-c) inset, 0 0 0 2px var(--o-switch-c) inset;" | ||
}, | ||
animation: { | ||
keyframes: { | ||
switching: `{0%{ box-shadow: 0 0 0 2px #1890ff66; } | ||
60%{ box-shadow: 0 0 0 4px #1890ff33; } | ||
80%{ box-shadow: 0 0 0 6px #1890ff1a; } | ||
100%{ box-shadow: 0 0 0 8px #1890ff0d; }}` | ||
}, | ||
durations: { | ||
switching: "0.3s" | ||
} | ||
} | ||
}; | ||
function parseColors(body, _theme = theme) { | ||
return parseColor$1(body, _theme); | ||
} | ||
function presetOnu() { | ||
return { | ||
name: "@onu-ui/preset", | ||
theme: { | ||
colors: { | ||
context: "rgba(var(--onu-c-context),%alpha)", | ||
primary: "#a855f7", | ||
secondary: "#1ABCFE", | ||
success: "#0ACF83", | ||
warning: "#FF9F43", | ||
error: "#FF5C5C", | ||
info: "#373e47", | ||
placeholder: "#dcdcdc" | ||
}, | ||
fontFamily: { | ||
sans: "Avenir, Helvetica, Arial, sans-serif" | ||
}, | ||
boxShadow: { | ||
xs: "var(--un-shadow-inset) 0 1px 1px 0 var(--un-shadow-color, rgba(0,0,0,0.03))" | ||
}, | ||
animation: { | ||
keyframes: { | ||
switching: `{0%{ box-shadow: 0 0 0 2px #1890ff66; } | ||
60%{ box-shadow: 0 0 0 4px #1890ff33; } | ||
80%{ box-shadow: 0 0 0 6px #1890ff1a; } | ||
100%{ box-shadow: 0 0 0 8px #1890ff0d; }}` | ||
}, | ||
durations: { | ||
switching: "0.3s" | ||
} | ||
} | ||
}, | ||
theme, | ||
rules: [ | ||
[ | ||
/^o-(.*)$/, | ||
([, body], { theme }) => { | ||
var _a; | ||
const color = parseColor$1(body, theme); | ||
if (((_a = color == null ? void 0 : color.cssColor) == null ? void 0 : _a.type) === "rgb" && color.cssColor.components) { | ||
return { | ||
"--onu-c-context": `${color.cssColor.components.join(",")}` | ||
}; | ||
} | ||
[/^o-(.*)$/, ([, body], { theme: theme2 }) => { | ||
var _a; | ||
const color = parseColor$1(body, theme2); | ||
if (((_a = color == null ? void 0 : color.cssColor) == null ? void 0 : _a.type) === "rgb" && color.cssColor.components) { | ||
return { | ||
"--onu-c-context": `${color.cssColor.components.join(",")}` | ||
}; | ||
} | ||
], | ||
}], | ||
[/^o-switch-(.+)$/, ([, s]) => { | ||
if (["sm", "md", "lg"].includes(s)) { | ||
return { | ||
"--o-switch-offset": SwitchSizeMap[s][2], | ||
"width": SwitchSizeMap[s][0], | ||
"height": SwitchSizeMap[s][1] | ||
}; | ||
} | ||
}], | ||
["o-dashed", { "border-style": "dashed" }], | ||
[ | ||
"o-solid", | ||
{ | ||
"background-color": "rgba(var(--onu-c-context), 1) !important", | ||
"border-color": "rgba(var(--onu-c-context), 1)", | ||
"color": "white !important" | ||
} | ||
], | ||
[ | ||
"o-disabled", | ||
{ | ||
opacity: 0.4, | ||
cursor: "not-allowed" | ||
} | ||
] | ||
["o-solid", { "background-color": "rgba(var(--onu-c-context), 1) !important", "border-color": "rgba(var(--onu-c-context), 1)", "color": "white !important" }], | ||
["o-disabled", { opacity: 0.4, cursor: "not-allowed !important" }] | ||
], | ||
@@ -808,4 +824,4 @@ variants: [ | ||
"o-avatar-group-base": "flex space-x--4 children-relative", | ||
"o-card-bg": "bg-gradient-from-rgba(255, 255, 255, 0.2) bg-gradient-to-rgba(255, 255, 255, 0.035) backdrop-blur-lg", | ||
"o-card-base": "o-transition list-none relative rounded-md c-context w-full of-hidden", | ||
"o-card-bg": "bg-gradient-linear bg-gradient-from-rgba(255, 255, 255, 0.2) bg-gradient-to-rgba(255, 255, 255, 0.035) backdrop-blur-lg", | ||
"o-card-base": "o-card-bg o-transition list-none relative rounded-md c-context w-full of-hidden", | ||
"o-card": "o-card-base h-fit", | ||
@@ -818,25 +834,14 @@ "o-card-md": "rounded-md shadow-md text-sm", | ||
"o-card-header-title": "text-md", | ||
"o-card-header-description": "text-xs c-context:60 break-all", | ||
"o-card-header-description": "text-xs c-context:60 break-all !m-0", | ||
"o-card-header-extra": "", | ||
"o-card-body": "p-4 pt-1.5 leading-normal text-sm", | ||
"o-card-actions": "p-4 pt-2", | ||
"o-card-bordered": "border b-context:50 important-shadow-none hover-important-shadow-md", | ||
"o-card-hoverable": "hover-translate-y--1", | ||
"o-card-bordered": "border border-light-700 dark:border-#4C4D4F important-shadow-none", | ||
"o-card-hoverable": "hover-translate-y--1 hover-important-shadow-md", | ||
"o-icon-base": "c-context text-md", | ||
"o-switch": "!animate-count-1 relative flex rounded-999px cursor-pointer items-center bg-context", | ||
"o-switch-size-small": "w-min h-1em leading-1em min-w-1.6em", | ||
"o-switch-size-medium": "w-min h-1.4em leading-1.4em min-w-2.2em", | ||
"o-switch-size-large": "w-min h-1.8em leading-1.8em min-w-3em", | ||
"o-switch-circle": "fcc rounded-999px bg-white", | ||
"o-switch-size-small-circle": "h-0.75em w-0.75em", | ||
"o-switch-size-medium-circle": "h-1em w-1em", | ||
"o-switch-size-large-circle": "h-1.45em w-1.45em", | ||
"o-switch-uncheck-circle": "absolute mr-0.1em left-0.1em", | ||
"o-switch-check-circle": "absolute ml-0.1em right-0.1em", | ||
"o-switch-small-slot-check": "ml-0.25em mr-1em", | ||
"o-switch-medium-slot-check": "ml-0.25em mr-1.25em", | ||
"o-switch-large-slot-check": "ml-0.25em mr-1.5em", | ||
"o-switch-small-slot-uncheck": "mr-0.25em ml-1em", | ||
"o-switch-medium-slot-uncheck": "mr-0.25em ml-1.25em", | ||
"o-switch-large-slot-uncheck": "mr-0.25em ml-1.5em", | ||
"o-switch-base": "b-(~ $o-switch-bc) bg-$o-switch-dot", | ||
"o-switch-base-active": "checked-(b-context bg-$o-switch-dot-active)", | ||
"o-switch-shadow": "shadow-switch checked-shadow-switchActive", | ||
"o-switch": "o-switch-base o-switch-base-active o-switch-shadow appearance-none cursor-pointer flex-shrink-0 o-transition duration-300 rounded-full", | ||
"o-switch-disabled": "o-disabled", | ||
"o-checkbox-base": "fsc gap-1 inline-flex cursor-pointer", | ||
@@ -847,3 +852,30 @@ "o-checkbox": "o-transition text-md rounded border fcc peer-checked-(bg-context b-context scale-full children-scale-full)", | ||
"o-checkbox-lg": "w-5 h-5", | ||
"o-checkbox-disabled": "o-disabled" | ||
"o-checkbox-disabled": "o-disabled", | ||
"o-alert-base": "pr p-3 fi rounded o-transition w-full of-hidden c-context shadow-context:50 o-solid border fi", | ||
"o-alert-light": "o-light", | ||
"o-alert-content": "flex flex-col justify-center w-full", | ||
"o-alert-header": "fb items-center", | ||
"o-alert-title": "flex-1 text-sm font-600", | ||
"o-alert-close": "text-md cursor-pointer pa top-3 right-3 fcc", | ||
"o-alert-icon": "fi pr-5", | ||
"o-alert-description": "flex break-all items-center text-sm", | ||
"o-badge": "pr inline-block align-middle", | ||
"o-badge-sup": "bg-context text-xs min-w-4.5 h-4.5 leading-4.5 whitespace-nowrap fcc inline-flex rounded-full px-1 z-1", | ||
"o-badge-sup-fixed": "pa top-0 right-0 translate-x-[calc(50%-1px)] translate-y-[calc(-50%+1px)]", | ||
"o-badge-sup-dot": "!min-w-auto !h-2 !w-2 rounded-full", | ||
"o-tag-base": "fcc gap-1 rounded inline-flex box-border !outline-none c-context o-solid mx-1", | ||
"o-tag-is-closable": "pr-7px", | ||
"o-tag-xs": "px-1.5 h-5 text-xs", | ||
"o-tag-sm": "px-2.5 h-6 text-sm", | ||
"o-tag-md": "px-3 h-7 text-sm ", | ||
"o-tag-lg": "px-4 h-8 text-md", | ||
"o-tag-plain": "bg-context:20", | ||
"o-tag-light": "c-context border !border-context:60 bg-context:12", | ||
"o-tag-disabled": "o-disabled", | ||
"o-tag-rounded": "rounded-full", | ||
"o-tag-close": "ml-1.5 cursor-pointer c-context", | ||
"o-message-base": `fixed top-5 o-solid left-1/2 translate-x--1/2 z-1000 o-transition | ||
shadow-md p3 fi rounded of-hidden gap-3`, | ||
"o-message-closable": "cursor-pointer", | ||
"o-message-content": "fi gap-2" | ||
}, | ||
@@ -867,2 +899,17 @@ [/^o-avatar-group-(.*)$/, ([, s]) => { | ||
} | ||
}], | ||
[/^o-message-icon-(.*)$/, ([, s]) => { | ||
const iconType = s; | ||
const themeType = ["primary", "secondary", "success", "warning", "error", "info"]; | ||
if (themeType.includes(iconType)) { | ||
const iconThemeMap = { | ||
primary: "i-carbon-stop-sign", | ||
secondary: "i-carbon-software-resource", | ||
success: "i-carbon-checkmark-outline", | ||
warning: "i-carbon-warning-alt", | ||
error: "i-carbon-close-outline", | ||
info: "i-carbon-information" | ||
}; | ||
return `${iconThemeMap[iconType]}`; | ||
} | ||
}] | ||
@@ -885,2 +932,9 @@ ] | ||
}; | ||
var withInstallFunction = (fn, name) => { | ||
fn.install = (app) => { | ||
fn._context = app._context; | ||
app.config.globalProperties[name] = fn; | ||
}; | ||
return fn; | ||
}; | ||
@@ -938,5 +992,8 @@ // ../utils/shared/common.ts | ||
isValue, | ||
parseColors, | ||
presetOnu, | ||
theme, | ||
toTypeString, | ||
withInstall | ||
withInstall, | ||
withInstallFunction | ||
}; |
{ | ||
"name": "onu-ui", | ||
"type": "module", | ||
"version": "1.0.8-beta.1", | ||
"version": "1.0.8-beta.3", | ||
"description": "Onu-UI for web glassmorphism components generate by UnoCSS.", | ||
@@ -36,3 +36,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@onu-ui/components": "1.0.8-beta.1" | ||
"@onu-ui/components": "1.0.8-beta.3" | ||
}, | ||
@@ -39,0 +39,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
63540
1996
+ Added@onu-ui/components@1.0.8-beta.3(transitive)
+ Added@onu-ui/preset@1.0.8-beta.3(transitive)
+ Added@onu-ui/utils@1.0.8-beta.3(transitive)
- Removed@onu-ui/components@1.0.8-beta.1(transitive)