@krakentech/blueprint-utils
54.2.1
Patch Changes
-
2567a7c: New bundling strategy for better performance
-
Unbundle mode Packages are now bundled using tsdown's unbundle mode. This mode drastically reduces the number of generated file compared to the glob-filtered entries we used before, and prevented proper tree-shaking.
-
Automatic package.json exports tsdown is now responsible for generating the
package.jsonexports,main,module, andtypesfields. This ensures packages follow best practices.
-
54.2.0
Minor Changes
-
045ff0a:
useMeasurementFilters: added support for a "smart" anchor date that automatically picks the most relevant date based on available data. The way it works is:- We query for the last 2 days measurements for a given
propertyId+marketSupplyPointId. - If we have the full day data for yesterday, we set the anchor date to yesterday.
- If we don't have full day data for yesterday, but we have full day data for the day before yesterday, we set the anchor date to the day before yesterday.
- If we don't have full day data for either yesterday or the day before yesterday, we set the anchor date to yesterday (as before).
This is useful for Krakens where data is not always available up to yesterday, as it allows us to show the most recent data available.
No Kraken has up to date data for today at the moment, so we never consider today as a possible anchor date.
const measurementFilters = useMeasurementFilters({
+ enableSmartAnchorDate: true,
initialDateRange,
+ marketSupplyPointId,
+ propertyId,
});Bear in mind that passing
enableSmartAnchorDate: truewon't allow you to also pass aninitialAnchorDate, as the anchor date will be determined automatically. - We query for the last 2 days measurements for a given
54.1.1
Patch Changes
- 4ed355d: ConsumptionGraph: Add the
widthprop back to the CoralChartPrimitive. This was mistakenly removed in a previous commit.
54.1.0
Minor Changes
- 10fefa7: ConsumptionGraph: Support title and description props which will then be used by the coral chart (and ultimately Victory). Remove aria-hidden from the parent element to make these newly created props available to screen readers.
54.0.3
Patch Changes
- fd0f99c: This release refactors the Blueprint
DualConsumptionGraphto separate it's business logic from the UI component
54.0.2
Patch Changes
- 631c0a4: Fix colours for ConsumptionCharts
54.0.1
Patch Changes
-
c045425: Fix peer dependencies to use
^instead of exact versions.- "@krakentech/blueprint-api": "3.3.0",
+ "@krakentech/blueprint-api": "^3.3.0",
- "@vercel/edge-config": "1.1.0",
+ "@vercel/edge-config": "^1.1.0",
54.0.0
Major Changes
-
157c128: Enable
@sentry/nextjsv9 and v10, but v8 is still supported.Follow the migration guide from v8 to v9, and from v9 to v10.
53.0.0
Major Changes
-
f975b8d: Bump
coraldependencies to latest major versions (v24)Follow the migration guide here: https://coral.octopus.energy/docs/releases/v24.0.0
blueprintpackages should just work once thecoraldependencies are updated.If you want to learn more about how this release is being managed by us, check out our release process documentation
52.1.3
Patch Changes
- 4dd3ddf: Utils: upgrade Coral icons package for latest a11y changes
52.1.2
Patch Changes
-
f6a6131: - Introduced a new
ignoreCostViewPreferenceprop to theuseMeasurementhook.- Introduced a new
ignoreStoredFiltersprop to theuseMeasurementFiltershook.
These props allow consumers to opt out of reading from or writing to localStorage for cost view and measurement filter preferences, respectively. This is useful in contexts where persisting user preferences is not desired, such as in testing or stateless environments.
- Introduced a new
52.1.1
Patch Changes
-
eda73b0: Fix inconsistent data display across consumption chart views by removing today's data filtering logic.
Previously, the consumption chart filtered out today's values in week and monthly views, causing discrepancies between different chart views (e.g., monthly totals didn't match yearly view bars for the same period). This change removes the filtering logic to display all available data consistently across all views, including today's values when available in day view.
This ensures data consistency where monthly totals now equal their corresponding bars in yearly view.
52.1.0
Minor Changes
- 67c5e79: ConsumptionTable: adds hasRowHeader to table for a11y improvements
52.0.0
Major Changes
-
715c95e: Revert "Remove chmod from postinstall script in utils package"
The removal of chmod support (to enable Windows compatibility) caused a regression in the CLI script. This change restores the previous behavior:
- Restore chmod in postinstall
- Remove .mjs CLI wrapper
- Point bin back to TypeScript file
- Re-add shebang to TS file
- Drop bin directory from published files
Windows support will be reintroduced in a future release
51.0.0
Patch Changes
- Updated dependencies [7dc77b4]
- @krakentech/blueprint-api@3.3.0
50.1.0
Minor Changes
-
63447ac: Allow Next 15 and React 19 as peer dependencies.
The minimum required versions are still the same:
next@14.2.25react@18.2.0react-dom@18.2.0.@types/react@18.3.23
-
5e83d4a: Introduces the
useFlagshook, an alternative togetFlagsOnClientfor rendering, preventing hydration errors.Usage
useFlagscan safely be used in render
import { useFlags } from "@krakentech/blueprint-utils/feature-flags";
export default function Page() {
const flags = useFlags();
if (flags.example) {
return <div>Flag enabled</div>;
}
return <div>Flag disabled</div>;
}getFlagsOnClientcan be used to lazily access feature flags in event callbacks
import { getFlagsOnClient } from "@krakentech/blueprint-utils/feature-flags";
export default function Page() {
function handleClick() {
const flags = getFlagsOnClient();
if (flags.example) {
alert("Flag enabled");
} else {
alert("Flag disabled");
}
}
return <button onClick={handleClick}>Click me!</button>;
}
50.0.2
Patch Changes
- Updated dependencies [e4dc37d]
- @krakentech/blueprint-api@3.2.1
50.0.1
Patch Changes
- 4059149: ConsumptionGraphControl: add aria-labels to the consumption graph prev and next buttons.
50.0.0
Patch Changes
- Updated dependencies [72176a1]
- Updated dependencies [12e020f]
- @krakentech/blueprint-api@3.2.0
49.0.0
Patch Changes
- Updated dependencies [8982f0f]
- @krakentech/blueprint-api@3.1.0
48.2.0
Minor Changes
-
0fc8725:
ConsumptionTable: correctly set date labels for the different date ranges."DAY": usestranslations.table-time-label(defaults to"Time")"WEEK"/"MONTH": usestranslations.table-date-label(defaults to"Date")"YEAR": usestranslations.table-month-label(defaults to"Month")
48.1.1
Patch Changes
- Updated dependencies [bf089bc]
- @krakentech/blueprint-api@3.0.1
48.1.0
Minor Changes
-
3acedcd:
ConsumptionGraph: make it possible to customize the date range label format of both the graph and table through thedateRangeLabelFormatandtableDateRangeLabelFormatprops, respectively.<ConsumptionGraph
dateRangeLabelFormat={{
DAY: "HH",
WEEK: "eeeeee",
MONTH: "d",
YEAR: "LLL",
}}
tableDateRangeLabelFormat={{
DAY: "HH:mm",
WEEK: "eeee, d MMMM",
MONTH: "d MMMM yyyy",
YEAR: "LLLL yyyy",
}}
/>
48.0.0
Major Changes
- bad97b4: Bump graphql-request from
^6.1.0to^7.2.0
Patch Changes
- Updated dependencies [bad97b4]
- @krakentech/blueprint-api@3.0.0
47.1.0
Minor Changes
- 80c3ca9: Fixes rounding errors in statistics cards values.
47.0.0
Major Changes
-
3d97864: ````markdown
- Windows Compatibility: Fixed installation errors on Windows by removing
chmodfrom postinstall script - CLI Improvements: Restructured feature flag generator as a proper cross-platform CLI tool
- The feature flag generator is no longer automatically executed on install
- Users must now run
npx generate-featureflags-declaration-file --dir ./typesmanually when needed
If you were relying on the automatic postinstall behavior:
- Remove any workarounds you had for Windows installation issues
- Run the CLI manually in your app directories:
npx generate-featureflags-declaration-file --dir ./types - Consider adding this to your package.json scripts for convenience:
{
"scripts": {
"generate-flags": "generate-featureflags-declaration-file --dir ./src/types"
}
}
- Windows Compatibility: Fixed installation errors on Windows by removing
46.0.2
Patch Changes
- 38bd1ce: Flyout Padding Adjustment: Updated the
flyoutPaddingto dynamically adjust based on screen size. Tooltip Width Logic: Added support to determine tooltip width dynamically based on the presence of Japanese or Chinese characters in the text.
46.0.1
Patch Changes
- bbd469f: Measurements/Statistics: add title to OverviewCharts for screen readers
46.0.0
Patch Changes
- Updated dependencies [6ed7c25]
- @krakentech/blueprint-api@2.0.0
45.0.3
Patch Changes
- d373c87: Measurements/StatisticsCard: fix a11y layout issues
45.0.2
Patch Changes
- 1225973: Fix build-time crash caused by using static named imports from the CommonJS-only
@sentry/nextjspackage. Replaced with dynamic import to ensure compatibility with ESM builds, without requiring consumers to usetranspilePackages.
45.0.1
Patch Changes
- 8f195fc: Set files: ["dist"]
- Updated dependencies [8f195fc]
- @krakentech/blueprint-api@1.2.1
45.0.0
Major Changes
-
2e70ef3: Add flexible titleTypography prop to Statistics Cards for independent control of main heading semantics and styling. The titleTypography prop accepts optional level and variant properties, while headingLevels now only controls subheadings ('week-before', 'last-week', 'cost').
Breaking: removed 'at-a-glance' from StatisticCardHeadingLevels - use titleTypography instead.
Before:
<SingleStatisticsCard headingLevels={{ "at-a-glance": "h4", cost: "h5" }} />After:
<SingleStatisticsCard
titleTypography={{ level: "h4" }}
headingLevels={{ cost: "h5" }}
/>
44.0.1
Patch Changes
- 5033ff5: Split GraphQL operations from client components.
- 51b100b: OverviewCharts: Fallback to
spanelement on chart labels if no heading levels provided
44.0.0
Patch Changes
- Updated dependencies [0401bcc]
- @krakentech/blueprint-api@1.2.0
43.0.0
Patch Changes
- Updated dependencies [9926ab8]
- @krakentech/blueprint-api@1.1.0
42.1.0
Minor Changes
-
c9bab3f: added headingLevels to StatisticsCard and ConsumptionGraph
example:
headingLevels={{ 'fuel-name': 'h3', 'selected-date-range': 'h3' }}
42.0.0
Major Changes
- e13846f: Move all client-side code into a dedicated /client submodule.
Patch Changes
- f9b23e8: ConsumptionChart: fix standing charge colour contrast
- Updated dependencies [507d46c]
- @krakentech/blueprint-api@1.0.0
41.2.0
Minor Changes
- 56b684d: added validation to feature flag utils: a broken edge config will now result in missing flag values instead of throwing errors. went with 'best possible outcome approach': the utils try to salvage what's possible from a broken config, returning as much as possible.
41.1.2
Patch Changes
- 5d9b4f8: Improve icon contrast on table toggle button for better accessibility.
41.1.1
Patch Changes
- 7113d84: add a space between value and unit in y tick data set
41.1.0
Minor Changes
-
9dc0500:
generateFeatureFlagsDeclarationFile: fix issue with@next/envimport introduced when we changed the package to ESM.Link to
@next/envissue: https://github.com/vercel/next.js/issues/68091
41.0.0
Patch Changes
- Updated dependencies [639224c]
- @krakentech/blueprint-api@0.8.0
40.0.0
Minor Changes
-
6343863: Turn the package into an ES Module. This includes:
- Adding
"type": "module"to thepackage.json - Updating the
exportsfield to include both ESM and CommonJS versions - Ensuring all imports and exports are compatible with ESM
It shouldn't break any existing functionality, as the CommonJS version is still available for compatibility.
- Adding
Patch Changes
- Updated dependencies [6343863]
- @krakentech/blueprint-api@0.7.0
39.0.0
Major Changes
-
be6f2f4: Major Accessibility Update:
- Added a screen reader-compliant table for the consumption chart, significantly improving accessibility for users relying on assistive technologies.
- Introduced the new
tableDescriptionprop to the consumption table component:- This optional prop allows you to provide a description of the table's context and purpose, giving screen readers additional context about what the table represents and how it should be interpreted.
- Updated the table to use new translation keys for description, date, and total labels, ensuring better localization and accessibility.
- Refactored the consumption chart and graph components to render the table alongside the chart, and improved ARIA attributes for better screen reader support.
- These changes help ensure that all users, including those using assistive technologies, have a clear and accessible understanding of the data presented in consumption charts.
38.5.1
Patch Changes
- 40852dc:
createRewritesAndRedirects: use readdirSync instead of readdir
38.5.0
Minor Changes
-
58ae710: - Removed internal
EventTypeenum in favor of a genericeventTypetype (defaults to string). Consumers can now pass custom types viareportEvent<T>().- Extended documentation with detailed examples and best practices.
Patch Changes
-
971dd01: # Enable tree-shaking of blueprint packages
The blueprint packages are now code-split and tagged as side-effect free. Bundlers such as Webpack are able to perform tree-shaking and only include necessary code in application bundles.
-
Updated dependencies [971dd01]
- @krakentech/blueprint-api@0.6.1
38.4.2
Patch Changes
- 5b87e1e: ConsumptionGraphControl: increase the size of the calendar custom interval dropdown for usability improvements.
38.4.1
Patch Changes
- 166da4b: ConsumptionGraphControl: display calendar option on all devices
38.4.0
Minor Changes
- 1a2df65: Create a new
/loggingsubmodule with areportEventfn that enables unified logging for both Datadog and Sentry. It logs structured JSON to Datadog (via log drain on server, or@datadog/browser-logson client), and captures the event in Sentry. You can sent the event to Datadog, Sentry or both.
38.3.1
Patch Changes
- 0f4e196: ConsumptionGraphControl: fix ToggleButton options not displaying correctly on smaller devices
38.3.0
Minor Changes
- e638560: Add a
localStoragecheck onuseMeasurementanduseMeasurementFiltersto avoid errors in the browser when thelocalStorageis not available (e.g. in a server-side rendered environment).
Patch Changes
- 6c15008: Fix x-labels on the day view of consumption chart
38.2.0
Minor Changes
- 326b5d8: Measurements/tooltip: increase contrast ratio of the text outputting the current date
38.1.4
Patch Changes
- 1bbc0dd: Add method 'POST' to form for secure data handling.
38.1.3
Patch Changes
- 7ced975:
ConsumptionGraph: change headings level fromh4/h5toh3/h4(no visual change)
38.1.2
Patch Changes
- b7303a5: This change standardize the measurement unit in case of kWh
38.1.1
Patch Changes
- 7778715: fix bottom padding on consumption chart tooltip
38.1.0
Minor Changes
- 531f335:
ConsumptionGraphandConsumptionGraphControl: addpaddingoptional prop
38.0.3
Patch Changes
- a1dbce8: Re-generate the graphql schema
38.0.2
Patch Changes
- 030f41b: This change fixes the issue with corner radius in the Year view of consumption chart on the consumption view
38.0.1
Patch Changes
-
2feeb9a:
/feature-flags: use the appropriate decryption function for the overrides (decryptFlagValues->decryptOverrides)With
flagsv4,decryptwas split into dedicated functions and I didn't account for that when I bumped the package version and used the samedecryptfunction for both the flag values and the overrides which breaks the override functionality.
38.0.0
Major Changes
-
a4fea3f: Bump
flagsto v4 (formerly known as@vercel/flags).Just to be clear, we replaced
@vercel/flagswithflagsand upgraded it tov4.0.0and you'll have to do the same in your project. You wont't have to change anything other than the dependencies if you're not importing it yourself but, if you are, here's the upgrade guide. -
b929f1c: Split
feature-flagrelated client-side code into its own submodule.import {
getFlagsOnClient,
GetFlagsOnClientProps
- } from '@krakentech/blueprint-utils/feature-flags';
+ } from '@krakentech/blueprint-utils/feature-flags/client';This fixes a
Module not found: Can't resolve 'async_hooks'error because theasync_hooksmodule is not available client-side and the server-side functions from theflagsdependency that we are using make use of that module which breaks the app build if we don't split it like this.
37.0.0
Major Changes
-
b6e615f: Introduced a dynamic approach to retrieve custom graph colors using the Coral theme. Replaced hardcoded hex values with theme-based colors for consistency with the Coral design system. Added a new useAllowedCustomGraphColors hook to fetch theme-based colors dynamically. Updated the AllowedCustomGraphColors type to use keys from the useAllowedCustomGraphColors hook.
+ export const useAllowedCustomGraphColors = () => {
+ const theme = useCoralTheme();
+ return {
+ PRIMARY_MAIN: theme.color.primary.main,
+ PRIMARY_LIGHT: theme.color.primary.light,
+ ACTION_SUCCESS: theme.color.action.success,
+ TEXT_MAIN: theme.color.text.main,
+ TERTIARY_MAIN: theme.color.tertiary.main,
+ TERTIARY_LIGHT: theme.color.tertiary.light,
+ SECONDARY_LIGHT: theme.color.secondary.light,
+ SECONDARY_MAIN: theme.color.secondary.main,
+ };
+ };
-export enum AllowedCustomGraphColorsEnum {
- // Electricity colors
- SOHO_LIGHTS = '#F050F8',
- AKOYA = '#FA98FF',
- GREEN = '#10C395',
- ICE = '#F0FFFF',
- // Gas colors
- VOLTAGE = '#60F0F8',
- AQUAMARINE = '#BDF2FF',
- BLUE_TANG = '#6675F6',
- INK = '#5840FF',
-}
- export type AllowedCustomGraphColors =
- keyof typeof AllowedCustomGraphColorsEnum;
+ export type AllowedCustomGraphColors = keyof typeof useAllowedCustomGraphColors;
36.0.0
Major Changes
-
4693845: This change adds a list of allowed custom colors for the consumption chart.
Introduced
AllowedCustomGraphColorsas an enum to define a fixed set of allowed colors with corresponding hex values. Updated thesetCustomColorScalefunction to use theAllowedCustomGraphColorsenum for type safety and consistency.setCustomColorScale?: (
legendEntries: string[]
) => AllowedCustomGraphColors[];export enum AllowedCustomGraphColorsEnum {
// Electricity colors
SOHO_LIGHTS = '#F050F8',
AKOYA = '#FA98FF',
GREEN = '#10C395',
ICE = '#F0FFFF',
// Gas colors
VOLTAGE = '#60F0F8',
AQUAMARINE = '#BDF2FF',
BLUE_TANG = '#6675F6',
INK = '#5840FF',
}
export type AllowedCustomGraphColors =
keyof typeof AllowedCustomGraphColorsEnum;
35.0.0
Major Changes
-
901e568: This release replaces the
ConsumptionOverviewcomponent with theConsumptionGraphcomponent. The newConsumptionGraphcomponent retains the same props, now defined as ConsumptionGraphProps (previously ConsumptionOverviewProps).Key Changes: Component Replacement:
ConsumptionOverviewhas been replaced withConsumptionGraph. Update your imports and usage accordingly. Props Update: The callbacks prop has been destructured, and its child functions are now exposed as standalone props:onCostOfUsageChange: Triggered when the cost of usage selection changes.onDateRangeChange: Triggered when the date range selection changes.return (
- <ConsumptionOverview
+ <ConsumptionGraph
label={label}
currency={config.i18n.currency}
translations={translations}
locale={locale}
measurements={measurements}
measurementFilters={measurementFilters}
/>
);- export type ConsumptionOverviewProps = {
+ export type ConsumptionGraphProps = {
...
- callbacks?: {
- onCostOfUsageChange?: (event: unknown) => void;
- onDateRangeChange?: (event: unknown) => void;
- };
+ /**
+ * Callback function triggered when the cost of usage selection changes.
+ * @param event - The event object associated with the change.
+ * This function is no longer a child of `callbacks` and can be used directly.
+ */
+ onCostOfUsageChange?: (event: unknown) => void;
+ /**
+ * Callback function triggered when the date range selection changes.
+ * @param event - The event object associated with the change.
+ * This function is no longer a child of `callbacks` and can be used directly.
+ */
+ onDateRangeChange?: (event: unknown) => void;
}Upgrade Notes: Replace ConsumptionOverview with ConsumptionGraph in your codebase. Pass all existing props directly to ConsumptionGraph. If you were using the callbacks prop, ensure you update your implementation to use the new standalone callback props. This is a major upgrade, so review your usage carefully to ensure compatibility.
34.2.0
Minor Changes
-
f08f3aa: add util to format amount to 2 decimal places
-
00b5faa: This allows the consumption chart to have statistics breakdown on the consumption view This change introduced new props to the
ConsumptionOverviewcomponent.export type ConsumptionOverviewProps = {
...
noDataComponent?: Maybe<JSX.Element>;
/**
* Function to customize the color scale of the consumption graph.
* @param legendEntries - Array of current legend entry labels (e.g., ['Standing charge', 'Off peak', 'Peak'])
* @returns Array of color strings (hex, rgb, or theme colors) matching the length of legendEntries
* @example
* setCustomColorScale={(legendEntries) => {
* return legendEntries.map((entry) => {
* switch (entry) {
* case 'Off Peak Usage':
* return theme.color.secondary.main;
* case 'Peak Usage':
* return theme.color.action.success;
* case 'Cozy':
* return theme.color.primary.main;
* case 'Standing Charge':
* default:
* return theme.color.primary.light;
* }
* });
* }}
*/
setCustomColorScale?: (legendEntries: string[]) => string[];
/**
* Function to override the default legend entries of the consumption graph.
* @param legendEntries - Array of current legend entry labels (e.g., ['M', 'F1', 'F2', 'F3'])
* @returns Array of custom legend entry strings to replace the defaults
* @example
* setCustomLegendEntries={(legendEntries) => {
* return legendEntries.map((entry) => {
* switch (entry) {
* case 'M':
* return 'Peak Usage';
* case 'F1':
* return 'Off Peak Usage';
* case 'F2':
* return 'Cozy';
* case 'F3':
* default:
* return 'Standing Charge';
* }
* });
* }}
*/
setCustomLegendEntries?: (legendEntries: string[]) => string[];
};
34.1.1
Patch Changes
- 751df59: Re-generate the graphql schema
34.1.0
Minor Changes
- 9c24225: Use DeepPartial type for mock data
34.0.0
Patch Changes
- Updated dependencies [d580b2f]
- @krakentech/blueprint-api@0.6.0
33.0.3
Patch Changes
- 3a9660b: Bump next peerDependency from ^14.2.9 to ^14.2.25 in order to address a security vulnerability
33.0.2
Patch Changes
- 3c29cde: Create tsup.config file and mark
react/react-domas externals - Updated dependencies [3c29cde]
- @krakentech/blueprint-api@0.5.1
33.0.1
Patch Changes
- f365f81: Small tooltip improvements on the ConsumptionGraph
33.0.0
Major Changes
- 4c31ca4: Upgrade packages to Coral v23.2.0
32.0.0
Major Changes
-
17cb84c: This is a major change as it modifies the query structure and the way data is fetched for the
useMeasurementhook. There is no change to the data structure or the response.There is a breaking change to the raw data for the query. If you use the raw data, please review the structure change in the query.
This change updates the
getAccountMeasurementsquery by replacing theaccount.propertiesquery with thepropertyquery.No action is required for the upgrade as long as you do not use the raw data.
+query getAccountMeasurements(
- $accountNumber: String!
+ $propertyId: ID!
+ $first: Int!
+ $utilityFilters: [UtilityFiltersInput!]
+ $startOn: Date
+ $endOn: Date
+ $startAt: DateTime
+ $endAt: DateTime
+ $timezone: String
+ ){
- account(id: $accountNumber) {
- properties {
- id
- measurements(
- first: $first
- utilityFilters: $utilityFilters
- startOn: $startOn
- ...
- } ...
+ property(id: $propertyId) {
+ measurements(
+ first: $first
+ utilityFilters: $utilityFilters
+ startOn: $startOn
endOn: $endOn
startAt: $startAt
endAt: $endAt
timezone: $timezone
) {
edges {
node {
value
unit
...
}
}
}
}
}
31.0.0
Major Changes
-
0333338: Configurable EdgeConfig store key and cookie name for feature flags.
Breaking:
FEATURE_FLAG_COOKIE_KEYSwas deleted and replaced byDEFAULT_FEATURE_FLAG_COOKIE_NAMEandFEATURE_FLAGS_OVERRIDES_COOKIE_NAME.import {
- FEATURE_FLAG_COOKIE_KEYS,
+ DEFAULT_FEATURE_FLAG_COOKIE_NAME,
+ FEATURE_FLAGS_OVERRIDES_COOKIE_NAME,
} from '@krakentech/blueprint-utils/feature-flags';
console.log(
"feature-flag cookie name",
- FEATURE_FLAG_COOKIE_KEYS.base,
+ DEFAULT_FEATURE_FLAG_COOKIE_NAME,
);
console.log(
"feature-flag overrides cookie name",
- FEATURE_FLAG_COOKIE_KEYS.overrides,
+ FEATURE_FLAGS_OVERRIDES_COOKIE_NAME,
);Breaking:
getFlagssignature was updated, it now expects acontextoption instead ofreq. Depending where you're callinggetFlagsthe context option can be of type:GetServerSidePropsContextingetServerSideProps,GetStaticPropsContextingetStaticProps,{ req: NextApiRequest, res: NextApiResponse }in API routes of the pages router,{ req: NextRequest, res: NextResponse }in API routes of the app router and in the Next.js middleware,
Notes:
- using
getFlagsingetStaticPropsmay result in stale flag values - server-components are not supported yet.
export async function getServerSideProps(context: GetServerSidePropsContext) {
- const flags = await getFlags({ req });
+ const flags = await getFlags({ context });
}export default async function handler(req: NextApiRequest, res: NextApiResponse) {
- const flags = await getFlags({ req });
+ const flags = await getFlags({ context: { req, res }});
}export default async function middleware(req: NextRequest) {
const res = NextResponse.next()
- const flags = await getFlags({ req });
+ const flags = await getFlags({ req, res });
}
30.0.1
Patch Changes
- b0e1a3a: Bump Coral to fix Button's text overlapping container and spill over issues
30.0.0
Major Changes
- de936a6: Upgrade Coral versions
29.2.0
Minor Changes
-
75babc2:
createRewritesAndRedirects: sort routes that share the same base path with params after routes without params in the array (+ alphabetical order so that they are easier to look through)This is necessary because the rewrites and redirects are processed in order, which means that, if the routes with params come before the routes without params in the array, the routes without params won't be setup correctly and the rewrite/redirect won't work, the user will be sent to the 404 page instead
29.1.0
Minor Changes
-
138d271:
createRewritesAndRedirects: addappRoutesLanguageprop so that, if for some reason, a consumer uses a different language to write their app routes than the app's default language, they can pass in the language they are using.For example, if a consumer wrote their routes in English (
en) but the app's default language is French (fr), they can pass inappRoutesLanguage: 'en'tocreateRewritesAndRedirectsto ensure that the rewrites and redirects are generated correctly:const { rewrites } = createRewritesAndRedirects({
i18n: {
defaultLocale: 'fr',
locales: ['fr', 'en', 'de],
},
pathToAppRoot: './',
routeTranslations: {
dashboard: {
de: 'armaturenbrett',
en: 'dashboard',
fr: 'espace-client',
},
},
+ appRoutesLanguage: 'en',
});
29.0.2
Patch Changes
- 7bda6f3: Match date range's end date to the bar chart's actual data that's being displayed
29.0.1
Patch Changes
- 879afd0: Make the useI18nUtils hooks callbacks to prevent multiple re-renders when they are used as dependencies.
29.0.0
Major Changes
-
014bd21: The
<GraphQLClientProvider />is no longer exported from@krakentech/blueprint-utils. Consumers should now wrap their app with anApiProviderfrom@krakentech/blueprint-apiinstead since it exposes thegraphqlClientvalue needed by theutilscomponents (namely, theuseMeasurementsandusePaymentInstructionhooks).It also allows consumers to use the new
useKrakenQuery,useInfiniteKrakenQuery, anduseKrakenMutationhooks.
Patch Changes
- Updated dependencies [ebf8ae7]
- @krakentech/blueprint-api@0.5.0
28.0.0
Major Changes
- 0854e70: Bump @storyblok/react to ^3.0.15
27.1.0
Minor Changes
-
8844cba: Implement updated requirement to the consumption chart page's date value setting store feature
-
56daed8: This change extracts the
useI18nUtilsfrom blueprint-core into blueprint-utils. TheuseI18nUtilsnow takes in propsi18n,localeanddefaultLocale.Example usage:
import { useI18nUtils } from '@krakentech/blueprint-utils/client';
const { locale, defaultLocale } = useRouter();
const { i18n } = useConfig();
const { formatDateForDisplay } = useI18nUtils({ i18n, locale, defaultLocale });
27.0.0
Major Changes
-
d7da386:
InfiniteScroll: improve typings so that thedatathat theRenderComponentprop exposes is typed and replaceisLoadingwithisFetchingsinceisLoadingis onlytruewhen the hook fetches the first page of data. Also removed therootMarginoption from theIntersectionObserverso that the next page of the data is fetched as soon as the user scrolls to the bottom of the component.<InfinteScroll
- isLoading={isLoading}
+ isFetching={isFetching}
...
>
Minor Changes
- 01d3165: Save cost/consumption view preference in localStorage. Amend previously added functionality in useMeasurementFilters hook to not to save accountNumber information.
26.1.0
Minor Changes
- d01ecd9: Fix dual consumption chart in cases where the data for the date range is incomplete. e.g half of the week.
26.0.0
Major Changes
- bd5524b: Major Coral upgrade to
v22.1.0. Coral release notes ReplacedivinconsumptionGraphControlwith coralContainer. - 2db0294: Replaced translation label
half-hour-pricing-labelwithunit-rate-pricing-labelto make it more generic for places that don't use half-hourly data.
Minor Changes
- 12135c5: Save users Measurement Date settings in localStorage
Patch Changes
-
492b806: Updated deprecated coral icons to the recommended equivalent.
<IconAccount/> ==> <IconCircleUser/>
<IconBill/> ==> <IconFileList/>
<IconPayment/> ==> <IconWallet/>
<IconElectricity/> ==> <IconBolt/>
<IconGas/> ==> <IconFire/>
<IconGasElectricity/> ==> <IconBoltFire/>
<IconExport/> ==> <IconArrowFromHome/>
<IconSuccess/> ==> <IconCircleCheckmarkFilled/>
<IconEdit/> ==> <IconPenToSquare/>
<IconPlus/> ==> <IconCircleAdd/>
<IconAward/> ==> <IconRosette/>
<IconWind/> ==> <IconWindTurbine/>
<IconNoExitFees/> ==> <IconCircleCross/>
<IconEmail/> ==> <IconEnvelope/>
<IconCharger/> ==> <IconChargerHead/>
<IconError/> ==> <IconCircleExclamationFilled/>
<IconDismiss/> ==> <IconCross/>
<IconSearch/> ==> <IconMagnifyingGlass/>
<IconHidePassword/> ==> <IconEyeSlash/>
<IconShowPassword/> ==> <IconEye/>
<IconInfoOutlined/> ==> <IconCircleInformationOutlined/>
<IconQuestion/> ==> <IconCircleQuestionFilled/>
<IconEV/> ==> <IconElectricVehicle/>
25.4.0
Minor Changes
- 439ccf7: Give option to hide costOfConsumptionSwitch
25.3.0
Minor Changes
- ae1d8fd: Add more helpful error messages to useMeasurements hook
25.2.2
Patch Changes
-
d064456: Adds a skeleton in place of the total consumption value when it's in the loading state to ensure a fixed height for the
TotalAmountcomponent.Switched the position of the
costOfUsagetoggle and theshowStandingChargeFiltercheckbox to reduce the amount of things that move around switching between the two views.
25.2.1
Patch Changes
- 355c7a4: Update labels for unit rate line
25.2.0
Minor Changes
- 95820b9: Normalise unit rate line data to plot with consumption data
25.1.1
Patch Changes
- 3198ddc: Return initialAnchorDate prop from useMeasurementFilters hook
25.1.0
Minor Changes
- 6e4515a: Add optional initialAnchorDate to useMeasurements hook
25.0.2
Patch Changes
- 1f120a8: Fixes the
handleResizefunction to preventstackValuefrom beingundefined.undefinedstackValuecausescornerRadiusto beNaNwhich crashes the app.
25.0.1
Patch Changes
- 427d2f3: Add optional prop for opt-in to using raw interval for day view
- ce5bc43: Fixed negative corner radius in consumption chart with negative values
25.0.0
Major Changes
-
55eda74: Use raw data interval for daily view.
This release makes it possible to show half hourly graphs in the UK, or 15 minute graphs in the US, which are the finest resolutions available for smart data in those regions.
To support this, we have made a change to where we format dates for the x (time) value on the chart. Previously this was done in the useMeasurements hook, but it makes more sense to move this into the formatTicks function in the chart itself. This means the ChartData will now have different types - previously it was
{ x: string, y: number }, now it's{x: number, y: number}.To support this, consuming apps may need to:
- update types for ChartData if you've set them in your app. For example
type ChartItem = {
- x: string;
+ x: number;
y: number;
}- if you're implementing your own useMeasurements hook, you'll want to update your query to add durationInSeconds
account(accountNumber: $accountNumber) {
properties {
id
measurements(
first: $first
utilityFilters: $utilityFilters
startOn: $startOn
endOn: $endOn
startAt: $startAt
endAt: $endAt
timezone: $timezone
) {
edges {
node {
value
unit
... on IntervalMeasurementType {
startAt
endAt
+ durationInSecondsand update DATE_RANGE_READING_INTERVAL_MAPING
export const DATE_RANGE_READING_INTERVAL_MAPING = {
- [DateRange.DAY]: ReadingFrequencyType.HourInterval,
+ [DateRange.DAY]: ReadingFrequencyType.RawInterval,
[DateRange.WEEK]: ReadingFrequencyType.DayInterval,
[DateRange.MONTH]: ReadingFrequencyType.DayInterval,
[DateRange.YEAR]: ReadingFrequencyType.MonthInterval,
};and chart data labels
const labels = {
date: startAt,
- durationInSeconds: measurement?.durationInSeconds,
};
24.0.4
Patch Changes
- 25136b8: Use RawInterval for Daily view
24.0.3
Patch Changes
- 68bae46: Adds background color to custom date toggle component as it's part of the sticky controls in consumption chart.
24.0.2
Patch Changes
- 70454f9: Fix consumption chart colorscale in storybook
24.0.1
Patch Changes
- e6dd6e8: This fixes the background of sticky controls on consumption chart
24.0.0
Major Changes
-
40959c6: Updated
useMeasurementhook to take inuseMeasurementFiltersas props. This is to ensure props related to filtering data and used in the controls are only contained in theuseMeasurementFiltershook.The
useMeasurementhook now looks like this:const measurements = useMeasurements({
return useMeasurements({
variables: {
accountNumber,
propertyId,
utilityType,
dateLocale: config.i18n.dateLocales[locale || ''],
marketSupplyPointId: prm.id,
enabled: true,
- dateRangeToggleValue,
- customDateRangeSelectValue,
- anchorDate,
+ measurementFilters,
},
errorCallback: handleKrakenErrors,
});
- 25621da: Upgrade to Coral 21
## 23.2.0
### Minor Changes
- 21a31b2: Added props to make `ConsumptionGraphControl` component sticky.
```
stickyProps?: {
/**
* Whether the component should be sticky
* @default false
*/
enabled?: boolean;
/**
* The top position of the sticky component
* The value needs to be a valid 'top' css value
* @default '72px'
*/
top?: string;
/**
* zIndex for sticky component;
* @default '35'
*/
zIndex?: number;
};
```
## 23.1.1
### Patch Changes
- 5a8f4fa: Fix dual consumption chartData
## 23.1.0
### Minor Changes
- 6409dd7: Add `octopusSecurityRedirect`. This redirect should be added to the `redirects` array in your `next.config.js` file. It provides a well-known entry point for white-hat hackers to report issues to Octopus Energy Group: `'/.well-known/security.txt'` -> `'https://octopusenergy.group/.well-known/security.txt'`.
## 23.0.2
### Patch Changes
- 09593e6: Adjust the position of consumption chart tooltip, to avoid it disappering towards the bottom of the chart
## 23.0.1
### Patch Changes
- 1038af6: Hide total amount in consumption graphs when value is zero
## 23.0.0
### Major Changes
- ffb499d: Exclude `costOfUsageSelected` from useMeasurement filters as it is not part of the controls exported from the consumption graph container.
### Minor Changes
- 70eab4d: `createRewritesAndRedirects`: remove default redirect and add a `routesToRedirect` prop of type `Redirect[]` to allow for more control over the redirects created by this function.
### Patch Changes
- 21308c2: Bump @krakentech/icons to v2.6.1
## 22.0.0
### Major Changes
- 382d64a: Made use of a single set of graph controls for all the graphs on a page.
The `ConsumptionOverview` component now only contains the `ConsumptionGraph` component.
The `ConsumptionGraphControl` is exported separately and used in apps as the single controls for all the graphs on a particular page.
The `measurementFilter` function is used in the page component and passed down as props into children components. For example:
In `demo-site`; we have:
```
const measurementFilters = useMeasurementFilters({
initialDateRange: DateRangeToggleValue.WEEK,
defaultConsumptionMeasurement: 'cost',
});
```
And the `ConsumptionGraphControl` looks like this:
```
<ConsumptionGraphControl
translations={{
'graph.day': t('dashboard.consumption.graph.day'),
'graph.week': t('dashboard.consumption.graph.week'),
'graph.month': t('dashboard.consumption.graph.month'),
'graph.year': t('dashboard.consumption.graph.year'),
'start-date': t('dashboard.consumption.start-date'),
'custom-interval': t('dashboard.consumption.custom-interval' ),
}}
locale={locale}
measurements={measurementsForChart}
measurementFilters={measurementFilters}
/>
```
## 21.0.0
### Major Changes
- 711583e: Extracted state from the `useMeasurement` hook into a `useMeasurementFilters` hook.
This meant adding the following props to the useMeasurement hook:
`dateRangeToggleValue`, `customDateRangeSelectValue`, `anchorDate`, `costOfUsageSelected`.
With this refactor, you can use the same filters in multiple useMeasurement usages in the same page/component.
Previously the `useMeasurement` hook looked like this:
```
const measurements = useMeasurements({
variables: {
accountNumber,
dateLocale,
dateRange,
enabled,
marketSupplyPointId,
propertyId,
utilityType,
},
errorCallback,
locale,
});
```
Now, we need to pass some additional state related values returned by the new `useMeasurementFilters` hook:
```diff
const {
anchorDate,
costOfUsageSelected,
customDateRangeSelectValue,
dateRangeToggleValue,
} = useMeasurementFilters({
initialDateRange,
});
const measurements = useMeasurements({
variables: {
accountNumber,
dateLocale,
- dateRange,
enabled,
marketSupplyPointId,
propertyId,
utilityType,
+ anchorDate,
+ costOfUsageSelected,
+ customDateRangeSelectValue,
+ dateRangeToggleValue,
},
errorCallback,
- locale,
};
```
## 20.0.0
### Major Changes
- af7911a: Update GraphQL schema and associated types.
Since the last schema update, `UtilityType` has been replaced with `FuelType`, so you may need to update your own schema to reflect this.
## 19.3.1
### Patch Changes
- 072e5b9: Changes the color for standing charge pattern to 'theme.color.primary.light'
- db162ba: Fixed the offset difference and inconsistencies in dual consumption charts
## 19.3.0
### Minor Changes
- 750d623: Add MasqueradeForbiddenAlert util component
## 19.2.0
### Minor Changes
- b79c2ff: Add option to show cost in charts without tax
## 19.1.2
### Patch Changes
- 3df6bc7: Custom no data component for consumption graph
## 19.1.1
### Patch Changes
- 147016f: Updated styles for the bars in consumption chart
Added pattern to standing charge bars and updated Off-peak, Peak and Night-rate bar colors.
## 19.1.0
### Minor Changes
- ab536d0: New DualConsumptionGraph component with two measurement datasets
## 19.0.1
### Patch Changes
- 688a416: Options to override responsiveness and icon size of StatisticsCard
## 19.0.0
### Major Changes
- 34b50e1: Included line chart in the day view of consumption chart.
Restructured consumption charts to use Coral charts primitives instead of Coral charts.
Included label for price-per-unit in translations: "half-hour-pricing-label"
### Patch Changes
- 434d77d: Changed line chart point on tooltip
## 18.1.1
### Patch Changes
- 67b1fc0: Fix duplicated values prior to start date
## 18.1.0
### Minor Changes
- 6b93a5f: kWh difference display in SingleStatisticsCard
### Patch Changes
- 8b698db: Style overrides for bar width and chart height in SingleStatisticsCard charts
## 18.0.2
### Patch Changes
- efe611d: Remove incorrect rounding from useMeasurements hook. Graph component handles this for us.
## 18.0.1
### Patch Changes
- 5b33429: Card theme override for the ConsumptionOverview component
- 8239575: Changed the legends for standard tariff to use just 'consumption' which is the new `label` for consumption
## 18.0.0
### Major Changes
- 8dd3f5c: Added statisticsLabels function to the use measurement hook.
Modified prepareChartData function to include statistics labels.
Made the day view of consumption charts display colors based on the rates used on the hour
## 17.0.1
### Patch Changes
- bb6c584: Fix and improve rounding of totals in useMeasurements hook
## 17.0.0
### Major Changes
- 8ae26da: Added colors to represent each rates for different tariffs,
Reformatted legendEntries in useMeasurement hook to only display the labels of each rate e.g 'Standing charge', 'Off peak', 'Day rate', 'Night rate' etc.
Displayed chart labels in horizontal direction
### Patch Changes
- 7aacd00: CardWrapper for Single- and MultiStatisticsCard components to allow theme overrides
## 16.0.2
### Patch Changes
- e651098: fix consumption chart bars on mobile screen
## 16.0.1
### Patch Changes
- 49368d5: Apply removing standing charge cost from total consumption
## 16.0.0
### Major Changes
- 95a536c: Add type to cost of use statistics query
This will need to be added separately for projects not using the useMeasurements hook.
Previous fragment looked like this:
```
metaData {
statistics {
costInclTax {
costCurrency
estimatedAmount
}
value
description
label
}
}
```
It should now look like this
```
metaData {
statistics {
costInclTax {
costCurrency
estimatedAmount
}
value
description
label
type
}
}
```
Which can be validated like this using yup
```
import { mixed } from 'yup';
import { ReadingStatisticTypeEnum } from '../../types/generated/graphql/schema';
...
label: string().nullable(),
type: mixed<ReadingStatisticTypeEnum>()
.oneOf(Object.values(ReadingStatisticTypeEnum))
.nullable(),
...
```
## 15.2.0
### Minor Changes
- 8a3a4c5: Add logging callbacks to statistics card
### Patch Changes
- a028366: fix the storyblok redirects warning issues
## 15.1.0
### Minor Changes
- ea545c9: Swap cost of usage from excluding tax to including tax
## 15.0.3
### Patch Changes
- 539db87: Added border radius to negative chart values.
- 43ebf74: Add border radius to the negative value chart data
## 15.0.2
### Patch Changes
- 2b5f215: Fix chart formatting for days when clocks go back
## 15.0.1
### Patch Changes
- 26bdb72: Remove "f" character that accidently was left in the code
## 15.0.0
### Major Changes
- 266a83e: Upgrade to Coral 20
## 14.2.0
### Minor Changes
- c943bf0: Add new prop to ConsumptionOverview to all a custom text value to be passed to display for cost of usage switch
### Patch Changes
- 9a58320: SingleStatisticsCard: add chartMaxWidth optional prop
- 844cd64: fix: add fallback to getFlags function. in case the util cannot find the flags cookie, it now tries to fetch from the edge config store directly - this fixes the case of users with a fresh session not receiving the flag values on their first request
## 14.1.1
### Patch Changes
- 2fa0ba6: Update Next to latest minor version
## 14.1.0
### Minor Changes
- de28585: addition of new callbacks to ConsumptionGraph & ConsumptionGraphControl to be passed from ConsumptionOverview in consuming app
## 14.0.1
### Patch Changes
- cde15f9: Pass 'showStandingChargeFilter' from ConsumptionOverview component to ConsumptionGraph so it can be set by client.
## 14.0.0
### Major Changes
- e15a490: Added 'defaultConsumptionMeasurement' prop to the useMeasurement function. Based on this value, each app can set this value make cost default or otherwise
Changed useMeasurement props to a single object that contains all the old props including 'defaultConsumptionMeasurement'
Here is an example of how to pass the updated arguments to the useMeasurements function for a clear example of upgrading with a before and after:
Before:
```javascript
const measurementsForChart = useMeasurements(
{
accountNumber: accountNumber,
propertyId: propertyId,
utilityType: UtilityType.Electricity,
dateLocale,
enabled: isAuthenticated,
dateRange: DateRangeToggleValue.WEEK,
},
handleKrakenErrors
);
```
After:
```javascript
const measurementsForChart = useMeasurements({
variables: {
accountNumber,
propertyId: propertyId,
utilityType: UtilityType.Electricity,
dateLocale,
enabled: isAuthenticated,
dateRange: DateRangeToggleValue.WEEK,
},
defaultConsumptionMeasurement: "cost",
errorCallback: handleKrakenErrors,
});
```
## 13.0.2
### Patch Changes
- 442091e: Fixes bug to do with a feature flag check
## 13.0.1
### Patch Changes
- ae3ed7a: upgraded coral charts to 6.2.1.
## 13.0.0
### Major Changes
- 1eb7c43: Added a checkbox to filter out standing charge.
Added a 'showStandingChargeFilter' prop to consumption graph to give the option to
not use the checkbox if standing charge is not used in your country.
Edited the consumption translations to include 'show-standing-charge'
### Patch Changes
- 28e40b9: Moved the consumption graph controls into the main consumtion overview card
- d7912b0: Increased the corner radius on consumption charts
## 12.0.0
### Major Changes
- 54651ab: Included the copy for when the percentage difference is zero on statistics card. The copy gives information that you have 'spent' or 'earned' or 'generated' or 'used' about the same energy.
Change translation file for consumption graphs to include:
'you-have-used-about-the-same',
'you-have-spent-about-the-same'
'you-have-earned-about-the-same'
'you-have-generated-about-the-same',
### Patch Changes
- 328df42: Added an outline around the circles in consumption chart tooltip
- 9d27351: Increase width of bars on charts
## 11.0.2
### Patch Changes
- 8a4ff09: Updates Typescript and adds noUncheckedIndexedAccess rule to utils package
- d82f69a: Improved typing in feature flag declaration file. Established compatibility with noUncheckedIndexedAccess ts setting.
## 11.0.1
### Patch Changes
- 286e968: fix(ConsumptionOverview): round every value we display to min 0 decimals and max 2 decimals
## 11.0.0
### Major Changes
- 2ff9936: You don't have to do anything if you're not using environment related utils:
- `isVercelPreviewDeployment`
- `isVercelProductionDeployment`
- `isVercelDeployment`
- `getVercelOrigin`
If you are, you need to import them from the `environment` submodule from now on, like so:
```diff
- import { getVercelOrigin } from '@krakentech/blueprint-utils';
+ import { getVercelOrigin } from '@krakentech/blueprint-utils/environment';
```
### Patch Changes
- e74597b: Fix: render tariff legends that share the same description
Previously, if the `statistics` entries shared the same `description` but a different `label`, we wouldn't add them to the `legendEntries` Set which looked weird since we would have less legends than bar stacks
## 10.0.2
### Patch Changes
- e3174a9: Adds ability for Statistic Cards to fallback to consumption data if cost data is found to be invalid
## 10.0.1
### Patch Changes
- 4bf685a: Change Gas Usage bar chart to a darker color for better contrast with standing charge
## 10.0.0
### Major Changes
- 98bad06: Upgrade Coral to next major version
This upgrades the Coral peer dependency from v18 to v19, which involved reworking the responsive props from desktop first to mobile first.
It's important that your project is using Coral v19 to upgrade past this point if you're using the Consumption components, otherwise your layouts of Graph components won't look right.
## 9.0.1
### Patch Changes
- 6ef1baf: Fix environment related utils (`isVercelPreviewDeployment`, `isVercelProductionDeployment`, `isVercelDeployment` and `getVercelOrigin`) so that they work both on client and server side by referencing both the `NEXT_PUBLIC_` prepended environment variables and their non-prefixed counterparts. They previously only worked client-side.
- 798d8eb: Updated the chart colors to match design
## 9.0.0
### Major Changes
- 2b53542: Add error message translation to display on Consumption charts query error
## 8.0.2
### Patch Changes
- da30ad9: Consumption Charts: Fix interval width
## 8.0.1
### Patch Changes
- 9452974: Prevent word break on Statistic card labels and cost
## 8.0.0
### Major Changes
- 47cd88a: Included translation for 'you have spent less or more' on single statistics card when the chart is representing consumption
## 7.0.3
### Patch Changes
- a7e2a2e: Design updates for the Charts components and Statistics cards
## 7.0.2
### Patch Changes
- 6060c74: if any of the data for displaying the energy usage insight is not available, it doesn't display the statistics card.
## 7.0.1
### Patch Changes
- 05d39b3: Tweek axis padding calculation again to account for correct font
## 7.0.0
### Major Changes
- 2bd8ee2: Adds the option to use cost in the statistics card
Added 'displayCost' prop to both SingleStatisticsCard and MultiStatisticsCard
Changed percentage value in the translation fields to difference to accommodate cost change
Added more fields to translations files for statisticsCard:
'you-have-spent-less', 'you-have-spent-more': For when comparing usage cost between two full weeks
'you-have-earned-less', 'you-have-earned-more': For when comparing generation values when comparing two full weeks
'less-on-cost', 'more-on-cost', 'about-the-same-on-cost': To describe the difference in usage cost.
## 6.0.0
### Major Changes
- 931f912: Upgrade to react-query 5
## 5.0.2
### Patch Changes
- e7fb817: Filter out incomplete days and fix bucketing of measurements
## 5.0.1
### Patch Changes
- 3346d63: Programatically work out padding required for y-axis for consumption graphs
## 5.0.0
### Major Changes
- 7c68dfb: Change the statistics card to include full week periods and change the translations for the description text on statistic card.
## 4.0.6
### Patch Changes
- 09ad829: getVercelOrigin: pass the default values in such a way that consumers don't have to pass an empty object.
getVercelOrigin({}) -> getVercelOrigin()
- 682bb7d: Use `process.env.PORT` as the `getVercelOrigin` `port` default value
## 4.0.5
### Patch Changes
- fe1000b: Tooltip behaviour when date is in the future or data is not present
## 4.0.4
### Patch Changes
- 0c38ee1: Fix Storyblok Redirects for external destination urls
## 4.0.3
### Patch Changes
- 4f9622e: Changed the width of dropdown on consumption overview page.
## 4.0.2
### Patch Changes
- 9ba0bc7: fixes issue with no data checks in the enenergy statistic cards
## 4.0.1
### Patch Changes
- a028fe7: Some superficial css fixes, a no data safety net, and doc updates for the energy statistic cards.
## 4.0.0
### Major Changes
- adac2cf: Revert to Coral 18 to provide more graceful upgrade path.
We previously released a change to upgrade our components to use Coral 19, however we didn't have
a way to provide fixes to older versions and not all projects can upgrade to Coral 19 immediately.
This change reverts us back to Coral 18 while we work on a better way to upgrade.
## 3.0.0
### Major Changes
- efdae3f: The dependency Coral major update to 19.11.1
### Minor Changes
- aa30661: Add error handler callback to useMeasurements hook
## 2.10.4
### Patch Changes
- 27639c3: Fixed the consumption label unit visibilty. Made both units visible.
## 2.10.3
### Patch Changes
- b49e1c3: Feature Flags: Grouped all exports under `@krakentech/blueprint-utils/feature-flags` to avoid running into issues with the edge runtime when using `getFlags` in the middleware: The functions where previously distributed with other utils from the package, some of them using node apis under the hood that are incompatible with the edge runtime, hence this split needed to happen.
## 2.10.2
### Patch Changes
- ba8187b: Feature flag utils: fixed bug which caused the overrides to not be recognized in encrypted mode
## 2.10.1
### Patch Changes
- 4f13b47: Rename the getOrigin helper to getVercelOrigin and amend it so that it always prepends the https protocol when used within a Vercel deployment.
Expose new environment related constants: `isVercelPreviewDeployment`, `isVercelProductionDeployment` and `isVercelDeployment`.
## 2.10.0
### Minor Changes
- 409b024: Adds feature flagging utilities to blueprint/utils.
- Integrates with the vercel toolbar
- Relies on the edge config store to switch flags on and off without re-deployment
- Sets the feature flag values via a cookie in the middleware.
- Encrypts flag values by default (no leakage in the DOM), but can be disabled to make flags available on the client (see explanation below)
- Comes with a utility to fetch flag values within getServerSideProps and middleware.ts
- Comes with a utility to fetch flag values on the client (unencrypted flags only!)
- Optionally 100% type-safe flags with the help of a script that fetches the flags from the edge config store and generates types based on that
## 2.9.0
### Minor Changes
- fef2721: Adds new InfiniteScroll component to assist with pagination
- 8161083: Expose new Storyblok api routes
## 2.8.2
### Patch Changes
- 1fb86dc: Add optional prop for layout
## 2.8.1
### Patch Changes
- 44b5b94: Fix logic related to how we build the measurementsLastWeek array
## 2.8.0
### Minor Changes
- 5d43485: Exports the 2 new statistic overview card components - `SingleEnergyStatisticsCard` & `MultiEnergyStatisticsCard` (and marks the pre-existing `ConsumptionOverviewStatisticsCard` as deprecated).
## 2.7.0
### Minor Changes
- 1a26ad5: Extend Storyblok Redirects with the possibility to redirect to absolute URLs
## 2.6.0
### Minor Changes
- d493583: Make next-redirects config story permanently redirected to /404 page by default
### Patch Changes
- 8d49ee0: Fix several issues regarding next redirects generation
- Prevents duplicated "/" on the home story url
- Prevents failing build caused by uncaught fetch error in the redirects generation
## 2.5.0
### Minor Changes
- be3a9c9: Add getOrigin helper so that consumers can have a unified way of asserting the app's origin
## 2.4.0
### Minor Changes
- eb0e7d9: Added the Storyblok utils that every region is sharing. These utils are exposed in '@krakentech/blueprint-utils/storyblok'
## 2.3.0
### Minor Changes
- 30a899e: - Export PaymentInstruction component and usePaymentInstruction hook from blueprint-utils
## 2.2.1
### Patch Changes
- e1793a9: display default consumption period filter as selected
## 2.2.0
### Minor Changes
- 18c65d5: Update consumption graph colours to match new designs
## 2.1.0
### Minor Changes
- 6370bf4: set form input theme prop as default override from theme
## 2.0.2
### Patch Changes
- 87328ee: Removing the calendar option on mobile for consumption graphs due to disappearing when in mobile view
## 2.0.1
### Patch Changes
- d5d0334: moving the alignment of consumption chart dates and chart labels
## 2.0.0
### Major Changes
- 83e8ddd: Remove exports that cause import issues now they have submodules.
# How to migrate
## Changes for Stripe
```typescript
import { initializeStripeObject } from "@krakentech/blueprint-utils";
```
to
```typescript
import { initializeStripeObject } from "@krakentech/blueprint-utils/stripe";
```
## Changes for i18n
```javascript
const { createNextI18NextConfig } = require("@krakentech/blueprint-utils");
```
```javascript
const {
createNextI18NextConfig,
} = require("@krakentech/blueprint-utils/i18n");
```
This means we can remove this from our `next.config.js` files
// Fix for "Module not found: Error: Can't resolve 'fs'". Reference: https://stackoverflow.com/a/68098547
config.resolve.fallback = { fs: false };
## 1.1.2
### Patch Changes
- 0d898f9: Revert small mobile change as it was buggy
## 1.1.1
### Patch Changes
- 6aeecb8: Hide consumption chart toggles for small mobile sizes
## 1.1.0
### Minor Changes
- 2ecb323: Fix no-data consumption chart label logic
## 1.0.1
### Patch Changes
- 65c02aa: Remove error related utils that are currently only being using within Blueprint
## 1.0.0
### Major Changes
- c19dadc: Consumption graphs
## 0.3.0
### Minor Changes
- 35ff94a: Add seperate @blueprint/utils modules for stripe and i18n
## 0.2.6
### Patch Changes
- 57bbdd9: fixes issue with initialising stripe when running code on the server
## 0.2.5
### Patch Changes
- a9aa708: Adding balance to FilteredLedger type and add JSDOCs
## 0.2.4
### Patch Changes
- e8961de: upgrade deps and types and small measurement component fixes
## 0.2.3
### Patch Changes
- 408fcb4: put coral-charts as a peer/dev dep
## 0.2.2
### Patch Changes
- 17ef9d5: update generated types from graphql schema
## 0.2.1
### Patch Changes
- 4f0d0af: Add format options to currency related util functions
## 0.2.0
### Minor Changes
- 5bad47c: add measurement components `<ConsumptionOverview />` and `<ConsumptionOverviewStatisticsCard />`
## 0.1.5
### Patch Changes
- 984432e: Add Kraken errors utils:
- `isErrorWithMessage`
- `errorWithMessage`
- `getResponseErrorMessage`
- `getKrakenErrorDetails`
- `getErrorType`
- `isMappedErrorCode`
- `isKrakenErrorResponse`
## 0.1.4
### Patch Changes
- 6775666: Small type change and new function name for initialiseStripeObject
## 0.1.3
### Patch Changes
- e9ee60f: Remove createBlueprintI18nConfig function in favor of exporting each individual config related util in order to avoid issues with server-side code (like middleware):
- createRewritesAndRedirects (meant to be used in the next.config.js file)
- createNextI18nConfig
- createNextSitemapConfig
## 0.1.2
### Patch Changes
- c492de1: Add i18n config related util functions
## 0.1.1
### Patch Changes
- bbbefdd: Unpin dependency versions
## 0.1.0
### Minor Changes
- 88b412e: Additional utils, including:
- initialiseStripeObject util func
- filterLedgers util func
- currency utils
- Type helpers: Brand and PickPartial
## 0.0.2
### Patch Changes
- 458b065: Add first example utilities to utils package
## 0.0.1
### Patch Changes
- 67da6e9: Create empty package