@servicetitan/link-item 41.1.0 → 41.2.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
- import { FC, PropsWithChildren } from 'react';
2
- import { RouteComponentProps } from 'react-router-dom';
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ import type { RouteComponentProps } from 'react-router-dom';
3
3
  interface SideNavLinkItemProps extends PropsWithChildren<{}> {
4
4
  exact?: boolean;
5
5
  pathname: string;
@@ -1 +1 @@
1
- {"version":3,"file":"sidenav-link-item.d.ts","sourceRoot":"","sources":["../src/sidenav-link-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAc,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAI9E,UAAU,oBAAqB,SAAQ,iBAAiB,CAAC,EAAE,CAAC;IACxD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AA+BD,eAAO,MAAM,eAAe,oTAAuC,CAAC"}
1
+ {"version":3,"file":"sidenav-link-item.d.ts","sourceRoot":"","sources":["../src/sidenav-link-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAK5D,UAAU,oBAAqB,SAAQ,iBAAiB,CAAC,EAAE,CAAC;IACxD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AA+BD,eAAO,MAAM,eAAe,oTAAuC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/sidenav-link-item.tsx"],"sourcesContent":["import { useMemo, useCallback, FC, PropsWithChildren } from 'react';\nimport { withRouter, RouteComponentProps, matchPath } from 'react-router-dom';\n\nimport { SideNav } from '@servicetitan/design-system';\n\ninterface SideNavLinkItemProps extends PropsWithChildren<{}> {\n exact?: boolean;\n pathname: string;\n search?: string;\n className?: string;\n}\n\nconst SideNavLinkItemUnwrapped: FC<SideNavLinkItemProps & RouteComponentProps> = ({\n exact,\n pathname,\n search,\n className,\n children,\n history,\n}) => {\n const href = useMemo(\n () => history.createHref({ pathname, search }),\n [history, pathname, search]\n );\n\n const handleClick = useCallback(() => {\n history.push(pathname + (search ?? ''));\n }, [history, pathname, search]);\n\n return (\n <SideNav.Item\n href={href}\n active={!!matchPath(history.location.pathname, { exact, path: pathname })}\n onClick={handleClick}\n className={className}\n >\n {children}\n </SideNav.Item>\n );\n};\n\nexport const SideNavLinkItem = withRouter(SideNavLinkItemUnwrapped);\n"],"names":["useMemo","useCallback","withRouter","matchPath","SideNav","SideNavLinkItemUnwrapped","exact","pathname","search","className","children","history","href","createHref","handleClick","push","Item","active","location","path","onClick","SideNavLinkItem"],"mappings":";AAAA,SAASA,OAAO,EAAEC,WAAW,QAA+B,QAAQ;AACpE,SAASC,UAAU,EAAuBC,SAAS,QAAQ,mBAAmB;AAE9E,SAASC,OAAO,QAAQ,8BAA8B;AAStD,MAAMC,2BAA2E,CAAC,EAC9EC,KAAK,EACLC,QAAQ,EACRC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACRC,OAAO,EACV;IACG,MAAMC,OAAOZ,QACT,IAAMW,QAAQE,UAAU,CAAC;YAAEN;YAAUC;QAAO,IAC5C;QAACG;QAASJ;QAAUC;KAAO;IAG/B,MAAMM,cAAcb,YAAY;QAC5BU,QAAQI,IAAI,CAACR,YAAYC,mBAAAA,oBAAAA,SAAU;IACvC,GAAG;QAACG;QAASJ;QAAUC;KAAO;IAE9B,qBACI,KAACJ,QAAQY,IAAI;QACTJ,MAAMA;QACNK,QAAQ,CAAC,CAACd,UAAUQ,QAAQO,QAAQ,CAACX,QAAQ,EAAE;YAAED;YAAOa,MAAMZ;QAAS;QACvEa,SAASN;QACTL,WAAWA;kBAEVC;;AAGb;AAEA,OAAO,MAAMW,kBAAkBnB,WAAWG,0BAA0B"}
1
+ {"version":3,"sources":["../src/sidenav-link-item.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from 'react';\nimport { useMemo, useCallback } from 'react';\nimport type { RouteComponentProps } from 'react-router-dom';\nimport { withRouter, matchPath } from 'react-router-dom';\n\nimport { SideNav } from '@servicetitan/design-system';\n\ninterface SideNavLinkItemProps extends PropsWithChildren<{}> {\n exact?: boolean;\n pathname: string;\n search?: string;\n className?: string;\n}\n\nconst SideNavLinkItemUnwrapped: FC<SideNavLinkItemProps & RouteComponentProps> = ({\n exact,\n pathname,\n search,\n className,\n children,\n history,\n}) => {\n const href = useMemo(\n () => history.createHref({ pathname, search }),\n [history, pathname, search]\n );\n\n const handleClick = useCallback(() => {\n history.push(pathname + (search ?? ''));\n }, [history, pathname, search]);\n\n return (\n <SideNav.Item\n href={href}\n active={!!matchPath(history.location.pathname, { exact, path: pathname })}\n onClick={handleClick}\n className={className}\n >\n {children}\n </SideNav.Item>\n );\n};\n\nexport const SideNavLinkItem = withRouter(SideNavLinkItemUnwrapped);\n"],"names":["useMemo","useCallback","withRouter","matchPath","SideNav","SideNavLinkItemUnwrapped","exact","pathname","search","className","children","history","href","createHref","handleClick","push","Item","active","location","path","onClick","SideNavLinkItem"],"mappings":";AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,QAAQ;AAE7C,SAASC,UAAU,EAAEC,SAAS,QAAQ,mBAAmB;AAEzD,SAASC,OAAO,QAAQ,8BAA8B;AAStD,MAAMC,2BAA2E,CAAC,EAC9EC,KAAK,EACLC,QAAQ,EACRC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACRC,OAAO,EACV;IACG,MAAMC,OAAOZ,QACT,IAAMW,QAAQE,UAAU,CAAC;YAAEN;YAAUC;QAAO,IAC5C;QAACG;QAASJ;QAAUC;KAAO;IAG/B,MAAMM,cAAcb,YAAY;QAC5BU,QAAQI,IAAI,CAACR,YAAYC,mBAAAA,oBAAAA,SAAU;IACvC,GAAG;QAACG;QAASJ;QAAUC;KAAO;IAE9B,qBACI,KAACJ,QAAQY,IAAI;QACTJ,MAAMA;QACNK,QAAQ,CAAC,CAACd,UAAUQ,QAAQO,QAAQ,CAACX,QAAQ,EAAE;YAAED;YAAOa,MAAMZ;QAAS;QACvEa,SAASN;QACTL,WAAWA;kBAEVC;;AAGb;AAEA,OAAO,MAAMW,kBAAkBnB,WAAWG,0BAA0B"}
@@ -1,5 +1,5 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- import { RouteComponentProps } from 'react-router-dom';
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ import type { RouteComponentProps } from 'react-router-dom';
3
3
  interface TabLinkItemProps extends PropsWithChildren<{}> {
4
4
  exact?: boolean;
5
5
  pathname: string;
@@ -1 +1 @@
1
- {"version":3,"file":"tab-link-item.d.ts","sourceRoot":"","sources":["../src/tab-link-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAc,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAI9E,UAAU,gBAAiB,SAAQ,iBAAiB,CAAC,EAAE,CAAC;IACpD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AA2BD,eAAO,MAAM,WAAW,wSAAmC,CAAC"}
1
+ {"version":3,"file":"tab-link-item.d.ts","sourceRoot":"","sources":["../src/tab-link-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAK5D,UAAU,gBAAiB,SAAQ,iBAAiB,CAAC,EAAE,CAAC;IACpD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AA2BD,eAAO,MAAM,WAAW,wSAAmC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/tab-link-item.tsx"],"sourcesContent":["import { useMemo, useCallback, FC, PropsWithChildren } from 'react';\nimport { withRouter, RouteComponentProps, matchPath } from 'react-router-dom';\n\nimport { Tab } from '@servicetitan/design-system';\n\ninterface TabLinkItemProps extends PropsWithChildren<{}> {\n exact?: boolean;\n pathname: string;\n className?: string;\n}\n\nconst TabLinkItemUnwrapped: FC<TabLinkItemProps & RouteComponentProps> = ({\n exact,\n pathname,\n className,\n children,\n history,\n}) => {\n const href = useMemo(() => history.createHref({ pathname }), [history, pathname]);\n\n const handleClick = useCallback(() => {\n history.push(pathname);\n }, [history, pathname]);\n\n return (\n <Tab\n href={href}\n active={!!matchPath(history.location.pathname, { exact, path: pathname })}\n onClick={handleClick}\n className={className}\n >\n {children}\n </Tab>\n );\n};\n\nexport const TabLinkItem = withRouter(TabLinkItemUnwrapped);\n"],"names":["useMemo","useCallback","withRouter","matchPath","Tab","TabLinkItemUnwrapped","exact","pathname","className","children","history","href","createHref","handleClick","push","active","location","path","onClick","TabLinkItem"],"mappings":";AAAA,SAASA,OAAO,EAAEC,WAAW,QAA+B,QAAQ;AACpE,SAASC,UAAU,EAAuBC,SAAS,QAAQ,mBAAmB;AAE9E,SAASC,GAAG,QAAQ,8BAA8B;AAQlD,MAAMC,uBAAmE,CAAC,EACtEC,KAAK,EACLC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,OAAO,EACV;IACG,MAAMC,OAAOX,QAAQ,IAAMU,QAAQE,UAAU,CAAC;YAAEL;QAAS,IAAI;QAACG;QAASH;KAAS;IAEhF,MAAMM,cAAcZ,YAAY;QAC5BS,QAAQI,IAAI,CAACP;IACjB,GAAG;QAACG;QAASH;KAAS;IAEtB,qBACI,KAACH;QACGO,MAAMA;QACNI,QAAQ,CAAC,CAACZ,UAAUO,QAAQM,QAAQ,CAACT,QAAQ,EAAE;YAAED;YAAOW,MAAMV;QAAS;QACvEW,SAASL;QACTL,WAAWA;kBAEVC;;AAGb;AAEA,OAAO,MAAMU,cAAcjB,WAAWG,sBAAsB"}
1
+ {"version":3,"sources":["../src/tab-link-item.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from 'react';\nimport { useMemo, useCallback } from 'react';\nimport type { RouteComponentProps } from 'react-router-dom';\nimport { withRouter, matchPath } from 'react-router-dom';\n\nimport { Tab } from '@servicetitan/design-system';\n\ninterface TabLinkItemProps extends PropsWithChildren<{}> {\n exact?: boolean;\n pathname: string;\n className?: string;\n}\n\nconst TabLinkItemUnwrapped: FC<TabLinkItemProps & RouteComponentProps> = ({\n exact,\n pathname,\n className,\n children,\n history,\n}) => {\n const href = useMemo(() => history.createHref({ pathname }), [history, pathname]);\n\n const handleClick = useCallback(() => {\n history.push(pathname);\n }, [history, pathname]);\n\n return (\n <Tab\n href={href}\n active={!!matchPath(history.location.pathname, { exact, path: pathname })}\n onClick={handleClick}\n className={className}\n >\n {children}\n </Tab>\n );\n};\n\nexport const TabLinkItem = withRouter(TabLinkItemUnwrapped);\n"],"names":["useMemo","useCallback","withRouter","matchPath","Tab","TabLinkItemUnwrapped","exact","pathname","className","children","history","href","createHref","handleClick","push","active","location","path","onClick","TabLinkItem"],"mappings":";AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,QAAQ;AAE7C,SAASC,UAAU,EAAEC,SAAS,QAAQ,mBAAmB;AAEzD,SAASC,GAAG,QAAQ,8BAA8B;AAQlD,MAAMC,uBAAmE,CAAC,EACtEC,KAAK,EACLC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,OAAO,EACV;IACG,MAAMC,OAAOX,QAAQ,IAAMU,QAAQE,UAAU,CAAC;YAAEL;QAAS,IAAI;QAACG;QAASH;KAAS;IAEhF,MAAMM,cAAcZ,YAAY;QAC5BS,QAAQI,IAAI,CAACP;IACjB,GAAG;QAACG;QAASH;KAAS;IAEtB,qBACI,KAACH;QACGO,MAAMA;QACNI,QAAQ,CAAC,CAACZ,UAAUO,QAAQM,QAAQ,CAACT,QAAQ,EAAE;YAAED;YAAOW,MAAMV;QAAS;QACvEW,SAASL;QACTL,WAAWA;kBAEVC;;AAGb;AAEA,OAAO,MAAMU,cAAcjB,WAAWG,sBAAsB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/link-item",
3
- "version": "41.1.0",
3
+ "version": "41.2.0",
4
4
  "description": "",
5
5
  "homepage": "https://docs.st.dev/docs/frontend/link-item",
6
6
  "repository": {
@@ -34,5 +34,5 @@
34
34
  "cli": {
35
35
  "webpack": false
36
36
  },
37
- "gitHead": "8f8350c50fa1bbe118b418b9022105bd84d68efa"
37
+ "gitHead": "a27c08d5c4a695eb24110ec1477fa23ccf28a148"
38
38
  }
@@ -1,5 +1,7 @@
1
- import { useMemo, useCallback, FC, PropsWithChildren } from 'react';
2
- import { withRouter, RouteComponentProps, matchPath } from 'react-router-dom';
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ import { useMemo, useCallback } from 'react';
3
+ import type { RouteComponentProps } from 'react-router-dom';
4
+ import { withRouter, matchPath } from 'react-router-dom';
3
5
 
4
6
  import { SideNav } from '@servicetitan/design-system';
5
7
 
@@ -1,5 +1,7 @@
1
- import { useMemo, useCallback, FC, PropsWithChildren } from 'react';
2
- import { withRouter, RouteComponentProps, matchPath } from 'react-router-dom';
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ import { useMemo, useCallback } from 'react';
3
+ import type { RouteComponentProps } from 'react-router-dom';
4
+ import { withRouter, matchPath } from 'react-router-dom';
3
5
 
4
6
  import { Tab } from '@servicetitan/design-system';
5
7