amotify 0.3.16 → 0.3.17

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,9 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import { Box } from '../atoms';
3
3
  declare namespace Plate {
4
- type Input = {
4
+ type Input<E extends React.ElementType = typeof Box> = {
5
5
  size?: 'MIN' | 'XS' | 'S' | 'R' | 'L' | 'XL' | 'MAX';
6
- } & Box.DefaultInput;
6
+ jsxElement?: E;
7
+ } & (E extends typeof Box ? Box.DefaultInput : Omit<React.ComponentPropsWithoutRef<E>, 'jsxElement'>);
8
+ type Component = {
9
+ <E extends React.ElementType = typeof Box>(p: Input<E>): React.JSX.Element;
10
+ };
7
11
  }
8
- declare const Plate: React.FC<Plate.Input>;
12
+ declare const Plate: Plate.Component;
9
13
  export { Plate, Plate as default };
package/dist/fn/Plate.js CHANGED
@@ -1 +1 @@
1
- import{b as t,c as o,d as s}from"../chunk-C5N2D3ZX.js";import{jsx as u}from"react/jsx-runtime";import{Box as r}from"../atoms";const p=l=>{let a=l,{size:i="R"}=a,e=s(a,["size"]),n={MIN:36,XS:48,S:60,R:72,L:84,XL:100,MAX:120}[i];return u(r,o(t({margin:[0,"auto"],width:1},e),{xcss:t({maxWidth:12*n},e.xcss)}))};export{p as Plate,p as default};
1
+ import{b as e,c as n,d as p}from"../chunk-C5N2D3ZX.js";import{jsx as i}from"react/jsx-runtime";import{useState as r}from"react";import{Box as E}from"../atoms";const s=a=>{let o=a,{jsxElement:m=E,size:x="R"}=o,t=p(o,["jsxElement","size"]),[l]=r(()=>({MIN:36,XS:48,S:60,R:72,L:84,XL:100,MAX:120})[x||"R"]);return i(m,n(e({margin:[0,"auto"],width:1},t),{xcss:e({maxWidth:12*l},t.xcss)}))};export{s as Plate,s as default};
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ import * as fn from './fn';
11
11
  export * from './fn';
12
12
  declare const amotify: {
13
13
  RootViewController: fn.RootViewController.Methods;
14
- Plate: React.FC<fn.Plate.Input>;
14
+ Plate: fn.Plate.Component;
15
15
  PageViewController: React.FC<fn.PageViewController.Input>;
16
16
  SwipeView: (p: fn.SwipeView.Input) => import("react/jsx-runtime").JSX.Element;
17
17
  TabBar: React.FC<fn.TabBar.Input>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amotify",
3
- "version": "0.3.16",
3
+ "version": "0.3.17",
4
4
  "description": "UI Component for React,NextJS,esbuild",
5
5
  "scripts": {
6
6
  "start": "run-p clean build:*",