@stackshift-ui/system 6.1.0-beta.1 → 7.0.0-beta.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.
- package/package.json +4 -4
- package/src/default-component.tsx +19 -8
- package/src/sanity-link.ts +30 -6
- package/dist/chunk-7XY5RGCQ.mjs +0 -1
- package/dist/chunk-IV3CAAWU.mjs +0 -1
- package/dist/chunk-JVS3FWLZ.mjs +0 -1
- package/dist/chunk-ZZCEB2NX.mjs +0 -1
- package/dist/cn.d.ts +0 -2
- package/dist/cn.js +0 -1
- package/dist/cn.mjs +0 -1
- package/dist/default-component.d.ts +0 -2
- package/dist/default-component.js +0 -1
- package/dist/default-component.mjs +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -2
- package/dist/index.mjs +0 -2
- package/dist/sanity-link.d.ts +0 -17
- package/dist/sanity-link.js +0 -1
- package/dist/sanity-link.mjs +0 -1
- package/dist/system.d.ts +0 -11
- package/dist/system.js +0 -1
- package/dist/system.mjs +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/system",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-beta.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"typescript": "^5.6.2",
|
|
26
26
|
"vite-tsconfig-paths": "^5.0.1",
|
|
27
27
|
"vitest": "^2.1.1",
|
|
28
|
-
"@stackshift-ui/
|
|
29
|
-
"@stackshift-ui/
|
|
28
|
+
"@stackshift-ui/eslint-config": "6.0.10",
|
|
29
|
+
"@stackshift-ui/typescript-config": "6.0.10"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"nextjs-darkmode": "^1.0.4",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react18-loaders": "latest",
|
|
37
37
|
"clsx": "^2.1.1",
|
|
38
38
|
"tailwind-merge": "^2.5.4",
|
|
39
|
-
"@stackshift-ui/scripts": "
|
|
39
|
+
"@stackshift-ui/scripts": "7.0.0-beta.3"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@types/react": "16.8 - 19",
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const Component = as;
|
|
3
|
+
type PolymorphicProps<T extends React.ElementType, P = {}> = P & { as?: T } & Omit<
|
|
4
|
+
React.ComponentPropsWithRef<T>,
|
|
5
|
+
keyof P | "as"
|
|
6
|
+
>;
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
type DefaultElement = "div";
|
|
9
|
+
|
|
10
|
+
export const DefaultComponent = React.forwardRef(
|
|
11
|
+
<T extends React.ElementType = DefaultElement>(
|
|
12
|
+
props: PolymorphicProps<T>,
|
|
13
|
+
ref: React.Ref<any>,
|
|
14
|
+
) => {
|
|
15
|
+
const { as, ...restProps } = props;
|
|
16
|
+
const Component = as || "div";
|
|
17
|
+
return <Component ref={ref} {...restProps} />;
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
DefaultComponent.displayName = "DefaultComponent";
|
package/src/sanity-link.ts
CHANGED
|
@@ -1,10 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export interface LabeledRoute extends ConditionalLink {
|
|
2
|
+
ariaLabel?: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
linkTarget?: string;
|
|
5
|
+
linkType?: string;
|
|
6
|
+
_type?: string;
|
|
7
|
+
linkInternal?: any;
|
|
8
|
+
linkExternal?: any;
|
|
7
9
|
referenceType?: string;
|
|
10
|
+
multipleRoutes?: LabeledRouteWithKey[];
|
|
11
|
+
multipleInnerRoutes?: LabeledRouteWithKey[];
|
|
12
|
+
}
|
|
13
|
+
export interface ConditionalLink {
|
|
14
|
+
type?: string;
|
|
15
|
+
internalLink?: string | null;
|
|
16
|
+
externalLink?: string | null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface LabeledRouteWithKey extends LabeledRoute {
|
|
20
|
+
_key?: string;
|
|
21
|
+
image?: string;
|
|
22
|
+
alt?: string;
|
|
23
|
+
multipleRoutes?: LabeledRouteWithKey[];
|
|
24
|
+
featuredRoute?: {
|
|
25
|
+
featuredLink: LabeledRoute;
|
|
26
|
+
mainImage: {
|
|
27
|
+
image: string;
|
|
28
|
+
alt: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
routeType?: string;
|
|
8
32
|
}
|
|
9
33
|
|
|
10
34
|
interface SanityLink {
|
package/dist/chunk-7XY5RGCQ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createContext as n,useContext as r}from"react";import{jsx as p}from"react/jsx-runtime";var o=n({}),s=({components:e={},children:t})=>p(o.Provider,{value:e,children:t}),i=()=>r(o);export{s as a,i as b};
|
package/dist/chunk-IV3CAAWU.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function n(e){return e?e.type==="linkInternal"&&!e.referenceType?{href:`/${e.internalLink}`,target:"_self",rel:"noopener noreferrer"}:e.type==="linkInternal"&&e.referenceType?{href:`/${e.referenceType.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}/${e.internalLink}`,target:"_self",rel:"noopener noreferrer"}:e.type==="linkExternal"?{href:`${e.externalLink}`,target:"_blank",rel:"noopener noreferrer"}:{href:"/page-not-found"}:{href:"/page-not-found"}}export{n as a};
|
package/dist/chunk-JVS3FWLZ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as n}from"react/jsx-runtime";var p=o=>{let{as:t="div",...e}=o;return n(t,{...e})};export{p as a};
|
package/dist/chunk-ZZCEB2NX.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{clsx as e}from"clsx";import{twMerge as t}from"tailwind-merge";function s(...r){return t(e(r))}export{s as a};
|
package/dist/cn.d.ts
DELETED
package/dist/cn.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var c=(r,e)=>{for(var o in e)l(r,o,{get:e[o],enumerable:!0})},f=(r,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of p(e))!u.call(r,t)&&t!==o&&l(r,t,{get:()=>e[t],enumerable:!(s=n(e,t))||s.enumerable});return r};var i=r=>f(l({},"__esModule",{value:!0}),r);var C={};c(C,{cn:()=>x});module.exports=i(C);var a=require("clsx"),m=require("tailwind-merge");function x(...r){return(0,m.twMerge)((0,a.clsx)(r))}0&&(module.exports={cn});
|
package/dist/cn.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-ZZCEB2NX.mjs";export{a as cn};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var f=(t,o)=>{for(var e in o)p(t,e,{get:o[e],enumerable:!0})},i=(t,o,e,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of c(o))!T.call(t,n)&&n!==e&&p(t,n,{get:()=>o[n],enumerable:!(s=m(o,n))||s.enumerable});return t};var l=t=>i(p({},"__esModule",{value:!0}),t);var a={};f(a,{DefaultComponent:()=>C});module.exports=l(a);var r=require("react/jsx-runtime"),C=t=>{let{as:o="div",...e}=t;return(0,r.jsx)(o,{...e})};0&&(module.exports={DefaultComponent});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-JVS3FWLZ.mjs";export{a as DefaultComponent};
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";var i=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var k=(e,n)=>{for(var r in n)i(e,r,{get:n[r],enumerable:!0})},S=(e,n,r,p)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of g(n))!L.call(e,t)&&t!==r&&i(e,t,{get:()=>n[t],enumerable:!(p=d(n,t))||p.enumerable});return e};var h=e=>S(i({},"__esModule",{value:!0}),e);var T={};k(T,{DefaultComponent:()=>c,StackShiftUIProvider:()=>C,buildSanityLink:()=>m,cn:()=>s,useStackShiftUIComponents:()=>y});module.exports=h(T);var a=require("clsx"),f=require("tailwind-merge");function s(...e){return(0,f.twMerge)((0,a.clsx)(e))}var l=require("react/jsx-runtime"),c=e=>{let{as:n="div",...r}=e;return(0,l.jsx)(n,{...r})};function m(e){return e?e.type==="linkInternal"&&!e.referenceType?{href:`/${e.internalLink}`,target:"_self",rel:"noopener noreferrer"}:e.type==="linkInternal"&&e.referenceType?{href:`/${e.referenceType.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}/${e.internalLink}`,target:"_self",rel:"noopener noreferrer"}:e.type==="linkExternal"?{href:`${e.externalLink}`,target:"_blank",rel:"noopener noreferrer"}:{href:"/page-not-found"}:{href:"/page-not-found"}}var o=require("react"),u=(0,o.createContext)({}),C=({components:e={},children:n})=>(0,l.jsx)(u.Provider,{value:e,children:n}),y=()=>(0,o.useContext)(u);0&&(module.exports={DefaultComponent,StackShiftUIProvider,buildSanityLink,cn,useStackShiftUIComponents});
|
package/dist/index.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";import{a as o}from"./chunk-ZZCEB2NX.mjs";import{a as t}from"./chunk-JVS3FWLZ.mjs";import{a as e}from"./chunk-IV3CAAWU.mjs";import{a as r,b as n}from"./chunk-7XY5RGCQ.mjs";export{t as DefaultComponent,r as StackShiftUIProvider,e as buildSanityLink,o as cn,n as useStackShiftUIComponents};
|
package/dist/sanity-link.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
type LinkType = "linkInternal" | "linkExternal" | string;
|
|
2
|
-
interface LabeledRoute {
|
|
3
|
-
type: LinkType;
|
|
4
|
-
internalLink?: string;
|
|
5
|
-
externalLink?: string;
|
|
6
|
-
referenceType?: string;
|
|
7
|
-
}
|
|
8
|
-
interface SanityLink {
|
|
9
|
-
href: string;
|
|
10
|
-
target?: string;
|
|
11
|
-
rel?: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Builds a href attribute from a Sanity LabeledRoute object.
|
|
15
|
-
*/
|
|
16
|
-
export declare function buildSanityLink(link: LabeledRoute): SanityLink;
|
|
17
|
-
export {};
|
package/dist/sanity-link.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var l=(e,r)=>{for(var t in r)i(e,t,{get:r[t],enumerable:!0})},g=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of o(r))!p.call(e,n)&&n!==t&&i(e,n,{get:()=>r[n],enumerable:!(a=f(r,n))||a.enumerable});return e};var y=e=>g(i({},"__esModule",{value:!0}),e);var s={};l(s,{buildSanityLink:()=>L});module.exports=y(s);function L(e){return e?e.type==="linkInternal"&&!e.referenceType?{href:`/${e.internalLink}`,target:"_self",rel:"noopener noreferrer"}:e.type==="linkInternal"&&e.referenceType?{href:`/${e.referenceType.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}/${e.internalLink}`,target:"_self",rel:"noopener noreferrer"}:e.type==="linkExternal"?{href:`${e.externalLink}`,target:"_blank",rel:"noopener noreferrer"}:{href:"/page-not-found"}:{href:"/page-not-found"}}0&&(module.exports={buildSanityLink});
|
package/dist/sanity-link.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-IV3CAAWU.mjs";export{a as buildSanityLink};
|
package/dist/system.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
interface Components {
|
|
3
|
-
[key: string]: React.ComponentType<any>;
|
|
4
|
-
}
|
|
5
|
-
interface ComponentProviderProps {
|
|
6
|
-
components?: Components;
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
}
|
|
9
|
-
export declare const StackShiftUIProvider: React.FC<ComponentProviderProps>;
|
|
10
|
-
export declare const useStackShiftUIComponents: () => Components;
|
|
11
|
-
export {};
|
package/dist/system.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var d=(e,o)=>{for(var n in o)p(e,n,{get:o[n],enumerable:!0})},P=(e,o,n,C)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of m(o))!a.call(e,t)&&t!==n&&p(e,t,{get:()=>o[t],enumerable:!(C=i(o,t))||C.enumerable});return e};var v=e=>P(p({},"__esModule",{value:!0}),e);var R={};d(R,{StackShiftUIProvider:()=>f,useStackShiftUIComponents:()=>x});module.exports=v(R);var r=require("react"),s=require("react/jsx-runtime"),c=(0,r.createContext)({}),f=({components:e={},children:o})=>(0,s.jsx)(c.Provider,{value:e,children:o}),x=()=>(0,r.useContext)(c);0&&(module.exports={StackShiftUIProvider,useStackShiftUIComponents});
|
package/dist/system.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk-7XY5RGCQ.mjs";export{a as StackShiftUIProvider,b as useStackShiftUIComponents};
|